Payments
POST
/ api/ payments/ {id}/ refundsRefund a payment
Refunds a payment if supported by the payment method.
Server-side request · headers
mid + terminal-idTry it in Sandbox Path parameters
| Field | Type | Description |
|---|---|---|
idRequired | string | Payment request Id, Transaction Id and Order Id |
Request body
| Field | Type | Description |
|---|---|---|
amountOptional | number | The amount to refund. If not specified, the full payment amount will be refunded. |
referenceOptional | string | A reference you can later use to identify this refund request. |
metadataOptional | object | A set of key-value pairs that you can attach to the refund request. This can be useful for storing additional information in a structured format. Note that this object only allows one level of depth, so cannot accept non-primitive data types such as objects or arrays. |
Headers
| Field | Type | Description |
|---|---|---|
midRequired | string | Your MID, starts with ul-mid. |
terminal-idRequired | string | Your terminal id, starts with ul-tid. |
Responses
| Status | Description |
|---|---|
| 200 OK | Success |
| 400 Bad request | Bad Request |
| 401 Unauthorized | Unauthorized |
| 402 Payment required | Refund Failed |
| 403 Forbidden | Forbidden request |
| 404 Not found | Not Found |
POST
https://sandbox.geturbanledger.com/api/payments/ID/refundscurl -X POST "https://sandbox.geturbanledger.com/api/payments/ID/refunds" \
-H "Content-Type: application/json" \
-H "mid: sb-ul-mid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
-H "terminal-id: ul-tid-xxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"amount": 100,
"reference": "ORD-5023-4E89",
"metadata": {
"channel": "web",
"customer_ref": "CUST-10482"
}
}'Response
200 OK · Success
{
"message": "Your refund requested will be executed once you have enough balance in the current settlement cycle."
}