POST
/
api
/
v0
/
test-payment
/
{id}
/
refund
Refund a payment
curl --request POST \
  --url https://api.devdraft.ai/api/v0/test-payment/{id}/refund \
  --header 'idempotency-key: <idempotency-key>' \
  --header 'x-client-secret: <api-key>'
{
  "id": "ref_12345abcdef",
  "paymentId": "pay_12345abcdef",
  "amount": 100.5,
  "status": "succeeded",
  "timestamp": "2023-07-01T12:00:00.000Z"
}

Authorizations

x-client-secret
string
header
required

Your secret API key. Keep this secure and never expose it in client-side code.

Headers

idempotency-key
string<uuid>
required

Unique key to ensure the refund request is idempotent. If a request with the same key is sent multiple times, only the first will be processed, and subsequent requests will return the same response.

Example:

"refund_123456_unique_key"

Path Parameters

id
string
required

Payment ID to refund

Response

200
application/json

Payment refunded successfully

The response is of type object.