agentsclimarketplace

Paystack disputes

Skill rexedge/paystack/skills/paystack-disputes

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-disputes

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 Disputes API — manage transaction disputes (chargebacks) on your integration. List, fetch, update, resolve, and export disputes. Provide evidence, upload supporting documents, and handle resolution workflows. Use this skill whenever dealing with chargebacks, dispute management, fraud claims, refund disputes, providing evidence for contested transactions, or monitoring dispute status. Also use when you see references to /dispute endpoint, dispute statuses (awaiting-merchant-feedback, pending, resolved), or need to upload dispute evidence files.

SKILL.md

4.5 KB, as published. Nobody here has run it

Paystack Disputes

The Disputes API lets you manage chargebacks and disputes on your integration.

Depends on: paystack-setup for the paystackRequest helper.

Endpoints

MethodEndpointDescription
GET/disputeList disputes
GET/dispute/:idFetch a dispute
GET/dispute/transaction/:idList disputes for a transaction
PUT/dispute/:idUpdate a dispute
POST/dispute/:id/evidenceAdd evidence
GET/dispute/:id/upload_urlGet upload URL for attachment
PUT/dispute/:id/resolveResolve a dispute
GET/dispute/exportExport disputes

Dispute Statuses

StatusDescription
awaiting-merchant-feedbackPaystack is waiting for your response
awaiting-bank-feedbackBank is reviewing evidence
pendingDispute is being processed
resolvedDispute has been resolved

List Disputes

const disputes = await paystackRequest(
  "/dispute?from=2024-01-01&to=2024-12-31&status=awaiting-merchant-feedback"
);

Fetch Dispute

const dispute = await paystackRequest(`/dispute/${disputeId}`);

List Disputes for a Transaction

const txDisputes = await paystackRequest(`/dispute/transaction/${transactionId}`);
// Returns { history: [...], messages: [...] }

Update Dispute

Accept a dispute and set refund amount:

await paystackRequest(`/dispute/${disputeId}`, {
  method: "PUT",
  body: JSON.stringify({
    refund_amount: 1002, // Amount in subunits
    uploaded_filename: "qesp8a4df1xejihd9x5q", // From upload URL
  }),
});

Add Evidence

await paystackRequest(`/dispute/${disputeId}/evidence`, {
  method: "POST",
  body: JSON.stringify({
    customer_email: "[email protected]",
    customer_name: "John Doe",
    customer_phone: "0802345167",
    service_details: "Customer purchased premium plan on Jan 5",
    delivery_address: "123 Main Street, Lagos",
    delivery_date: "2024-01-06",
  }),
});

Get Upload URL

const upload = await paystackRequest(
  `/dispute/${disputeId}/upload_url?upload_filename=receipt.pdf`
);
// upload.data.signedUrl → Use PUT to upload file to this S3 URL
// upload.data.fileName → Reference this in update/resolve calls

Resolve Dispute

await paystackRequest(`/dispute/${disputeId}/resolve`, {
  method: "PUT",
  body: JSON.stringify({
    resolution: "merchant-accepted", // or "declined"
    message: "Customer refund approved",
    refund_amount: 500000,
    uploaded_filename: "uploaded_file_ref",
    evidence: 21, // Evidence ID (optional, for fraud claims)
  }),
});

Export Disputes

const exported = await paystackRequest(
  "/dispute/export?from=2024-01-01&to=2024-12-31"
);
// exported.data.path → CSV download URL

Full Dispute Handling Flow

// 1. List pending disputes
const disputes = await paystackRequest(
  "/dispute?status=awaiting-merchant-feedback"
);

for (const dispute of disputes.data) {
  // 2. Get upload URL for evidence
  const upload = await paystackRequest(
    `/dispute/${dispute.id}/upload_url?upload_filename=evidence.pdf`
  );

  // 3. Upload file to signed URL (use your preferred HTTP client)
  // await uploadToS3(upload.data.signedUrl, fileBuffer);

  // 4. Add evidence
  await paystackRequest(`/dispute/${dispute.id}/evidence`, {
    method: "POST",
    body: JSON.stringify({
      customer_email: "[email protected]",
      customer_name: "Customer Name",
      customer_phone: "08012345678",
      service_details: "Service was delivered successfully",
    }),
  });

  // 5. Resolve — decline the chargeback
  await paystackRequest(`/dispute/${dispute.id}/resolve`, {
    method: "PUT",
    body: JSON.stringify({
      resolution: "declined",
      message: "Service was delivered. Evidence attached.",
      refund_amount: 0,
      uploaded_filename: upload.data.fileName,
    }),
  });
}

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.