Payments
POST
/ api/ payments/ {id}/ capturesCapture a payment
Capture Authorized Payment.
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 capture. If not specified, the full payment amount will be captured. |
referenceOptional | string | A reference you can later use to identify this capture request. |
metadataOptional | object | A set of key-value pairs that you can attach to the capture 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 | Capture Failed |
| 403 Forbidden | Forbidden request |
| 404 Not found | Not Found |
POST
https://sandbox.geturbanledger.com/api/payments/ID/capturescurl -X POST "https://sandbox.geturbanledger.com/api/payments/ID/captures" \
-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
{
"status": "Partially Captured",
"message": "The payment was partially captured successfully",
"reference": "ORD-10482"
}