Skip to main content
POST
/
v1
/
refunds
CreateRefund
curl --request POST \
  --url https://api.toffeepay.com/v1/refunds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "payment_id": "<string>",
  "reason": "<string>"
}
'
{
  "id": "<string>",
  "payment_id": "<string>",
  "status": "pending",
  "created_at": "2023-11-07T05:31:56Z",
  "reason": "<string>",
  "succeeded_at": "2023-11-07T05:31:56Z",
  "failed_at": "2023-11-07T05:31:56Z",
  "cancelled_at": "2023-11-07T05:31:56Z",
  "error": {
    "code": "<string>",
    "message": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
payment_id
string
required
reason
string | null

Response

200 - application/json

Success

id
string
required
payment_id
string
required
status
enum<string>
required
Available options:
pending,
succeeded,
failed,
cancelled
created_at
string<date-time>
required
reason
string | null
succeeded_at
string<date-time> | null
failed_at
string<date-time> | null
cancelled_at
string<date-time> | null
error
Error · object

Error handling