Skip to main content
POST
/
api
/
v1
/
payments
/
{id}
/
refund
Refund a payment
curl --request POST \
  --url https://payments.oaknetwork.org/api/v1/payments/{id}/refund \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 2500,
  "metadata": {
    "reason": "Customer request"
  }
}
'
{
  "msg": "Transaction was Initiated Successfully!",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "provider": "<string>",
    "source": {
      "amount": 123,
      "currency": "<string>",
      "payment_method": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": "<string>",
        "chain": "<string>"
      },
      "customer": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      }
    },
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "settlement_date": "2023-11-07T05:31:56Z",
    "metadata": {}
  }
}

Authorizations

Authorization
string
header
required

Merchant authentication token. Obtained via POST /api/v1/merchant/token/grant. Pass as: Authorization: Bearer

Path Parameters

id
string<uuid>
required

Payment transaction ID (UUID)

Body

application/json
amount
integer

Refund amount in smallest currency unit. Omit for full refund.

Required range: x >= 1
metadata
object

Additional metadata for the refund

Response

Refund initiated

msg
string
required

Human-readable message describing the result

Example:

"Transaction was Initiated Successfully!"

data
object
required

Payment transaction response object