Skip to content
Docs

Payments

POST/api/payments/{id}/refunds

Refund a payment

Refunds a payment if supported by the payment method.

Server-side request · headers mid + terminal-idTry it in Sandbox

Path parameters

FieldTypeDescription
idRequiredstring

Payment request Id, Transaction Id and Order Id

Request body

FieldTypeDescription
amountOptionalnumber

The amount to refund. If not specified, the full payment amount will be refunded.

e.g. 100
referenceOptionalstring

A reference you can later use to identify this refund request.

e.g. ORD-5023-4E89
metadataOptionalobject

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

FieldTypeDescription
midRequiredstring

Your MID, starts with ul-mid.

e.g. ul-mid-696f12de-46d0-48c4-a7c8-bb*********5
terminal-idRequiredstring

Your terminal id, starts with ul-tid.

e.g. ul-tid-6208df4ad7329e*********e

Responses

StatusDescription
200 OKSuccess
400 Bad requestBad Request
401 UnauthorizedUnauthorized
402 Payment requiredRefund Failed
403 ForbiddenForbidden request
404 Not foundNot Found
POSThttps://sandbox.geturbanledger.com/api/payments/ID/refunds
curl -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."
}
Talk to ustalk-to-us