agentsclimarketplace

Paystack payment requests

Skill rexedge/paystack/skills/paystack-payment-requests

24 AI agent skills for Paystack API integration — automate payment workflows with TypeScript, Node.js, and Next.js

Install
npx -y skills add rexedge/paystack --skill paystack-payment-requests

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Paystack Payment Requests (Invoicing) API — create, manage, and send payment requests (invoices) to customers. Supports line items, taxes, due dates, draft mode, auto invoice numbering, split payments, email notifications, and archiving. Use this skill whenever building invoicing systems, sending payment requests to customers, managing invoice line items and taxes, tracking invoice totals and statuses, or implementing B2B payment collection. Also use when you see references to /paymentrequest endpoint, PRQ_ prefixed codes, invoice numbers, or payment request finalization.

SKILL.md

4.7 KB, as published. Nobody here has run it

Paystack Payment Requests

The Payment Requests API lets you create and manage invoices for goods and services.

Depends on: paystack-setup for the paystackRequest helper.
Related: paystack-customers for customer codes used in requests.

Endpoints

MethodEndpointDescription
POST/paymentrequestCreate a payment request
GET/paymentrequestList payment requests
GET/paymentrequest/:id_or_codeFetch a payment request
PUT/paymentrequest/:id_or_codeUpdate a payment request
GET/paymentrequest/verify/:codeVerify a payment request
POST/paymentrequest/notify/:codeSend notification
GET/paymentrequest/totalsGet totals/metrics
POST/paymentrequest/finalize/:codeFinalize a draft
POST/paymentrequest/archive/:codeArchive a request

Create Payment Request

ParamTypeRequiredDescription
customerstringYesCustomer ID or code
amountintegerNoAmount in subunits (if no line items)
due_datedatetimeNoISO 8601 due date
descriptionstringNoShort description
line_itemsarrayNo[{ name, amount, quantity? }]
taxarrayNo[{ name, amount }]
currencystringNoCurrency code (default: NGN)
send_notificationbooleanNoSend email (default: true)
draftbooleanNoSave as draft (default: false)
has_invoicebooleanNoAdd auto-incrementing invoice number
invoice_numberintegerNoOverride invoice number
split_codestringNoSplit code for revenue sharing
// Invoice with line items and tax
const invoice = await paystackRequest<{
  id: number;
  request_code: string;
  invoice_number: number;
}>("/paymentrequest", {
  method: "POST",
  body: JSON.stringify({
    customer: "CUS_xwaj0txjryg393b",
    description: "Q1 2024 Services",
    due_date: "2024-03-31",
    line_items: [
      { name: "Consulting (10 hours)", amount: 500000, quantity: 1 },
      { name: "Design work", amount: 200000, quantity: 1 },
    ],
    tax: [
      { name: "VAT (7.5%)", amount: 52500 },
    ],
    send_notification: true,
    has_invoice: true,
  }),
});
// invoice.data.request_code → "PRQ_1weqqsn2wwzgft8"

// Draft invoice (no notification sent)
await paystackRequest("/paymentrequest", {
  method: "POST",
  body: JSON.stringify({
    customer: "CUS_xwaj0txjryg393b",
    amount: 100000,
    description: "Draft invoice",
    draft: true,
  }),
});

List Payment Requests

const requests = await paystackRequest(
  "/paymentrequest?status=pending&currency=NGN&perPage=20"
);

Fetch / Verify

// Fetch
const req = await paystackRequest(`/paymentrequest/${encodeURIComponent("PRQ_code")}`);

// Verify (includes payment status)
const verified = await paystackRequest(
  `/paymentrequest/verify/${encodeURIComponent("PRQ_code")}`
);

Send Notification

Re-send the payment request email to the customer:

await paystackRequest(`/paymentrequest/notify/${encodeURIComponent("PRQ_code")}`, {
  method: "POST",
});

Get Totals

const totals = await paystackRequest("/paymentrequest/totals");
// totals.data.pending → [{ currency: "NGN", amount: 42000 }]
// totals.data.successful → [{ currency: "NGN", amount: 0 }]
// totals.data.total → [{ currency: "NGN", amount: 42000 }]

Finalize Draft

await paystackRequest(`/paymentrequest/finalize/${encodeURIComponent("PRQ_code")}`, {
  method: "POST",
  body: JSON.stringify({ send_notification: true }),
});

Update Payment Request

await paystackRequest(`/paymentrequest/${encodeURIComponent("PRQ_code")}`, {
  method: "PUT",
  body: JSON.stringify({
    customer: "CUS_xwaj0txjryg393b",
    description: "Updated invoice",
    due_date: "2024-06-30",
    amount: 150000,
  }),
});

Archive

await paystackRequest(`/paymentrequest/archive/${encodeURIComponent("PRQ_code")}`, {
  method: "POST",
});

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.