The Refunds API allows you to create, manage, and retrieve transaction refunds seamlessly. This helps ensure your customers can receive timely refunds for any issues with their transactions.

1. Create Refund

This endpoint allows you to initiate a refund for a specific transaction using its reference or ID.

Endpoint: POST /refund

Headers

KeyTypeValue
AuthorizationStringBearer SECRET_KEY
Content-TypeStringapplication/json

Body Parameters

KeyTypeValue
transactionStringTransaction reference or ID
#!/bin/sh
url="https://api.paystack.co/refund"
authorization="Authorization: Bearer YOUR_SECRET_KEY"
content_type="Content-Type: application/json"
data='{ "transaction": 1641 }'

curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST

{
  "status": true,
  "message": "Refund has been queued for processing",
  "data": {
    "transaction": {
      "id": 1004723697,
      "reference": "T685312322670591",
      "amount": 10000,
      "currency": "NGN",
      "paid_at": "2021-08-20T18:34:11.000Z",
      "customer_note": "Refund for transaction T685312322670591"
    },
    "status": "pending",
    "expected_at": "2021-12-16T09:21:17.016Z"
  }
}


2. List Refunds

Retrieve a list of refunds available on your integration.

Endpoint: GET /refund

Headers

KeyTypeValue
AuthorizationStringBearer SECRET_KEY

Query Parameters

KeyTypeValue
transactionString(Optional) The transaction ID
currencyString(Optional) The currency of the refunds
#!/bin/sh
url="https://api.paystack.co/refund"
authorization="Authorization: Bearer YOUR_SECRET_KEY"

curl "$url" -H "$authorization" -X GET

{
  "status": true,
  "message": "Refunds retrieved",
  "data": [
    {
      "id": 1,
      "transaction": 1641,
      "amount": 500000,
      "currency": "NGN",
      "status": "processed",
      "refunded_by": "[email protected]",
      "refund_date": "2018-01-12T10:54:47.000Z"
    },
    {
      "id": 2,
      "transaction": 323896,
      "amount": 500000,
      "currency": "NGN",
      "status": "pending",
      "refunded_by": "[email protected]",
      "refund_date": "2017-09-24T21:11:53.000Z"
    }
  ]
}


3. Fetch Refunds

Retrieve details of a specific refund.

Endpoint: GET /refund

Headers

KeyTypeValue
AuthorizationStringBearer SECRET_KEY
idStringThe ID of the refund
#!/bin/sh
url="https://api.paystack.co/refund/:id"
authorization="Authorization: Bearer YOUR_SECRET_KEY"

curl "$url" -H "$authorization" -X GET

{
  "status": true,
  "message": "Refund retrieved",
  "data": {
    "transaction": 1641,
    "amount": 500000,
    "currency": "NGN",
    "status": "processed",
    "refunded_by": "[email protected]",
    "refund_date": "2018-01-12T10:54:47.000Z"
  }
}