Skip to main content

Capture order (full)

This request will capture all the remaining uncaptured order lines of the order. The order lines included in the request body must match the order lines that are remaining in the uncaptured state. Whether the capture action is available on the order or not, can be determined by inspecting the availableActions array on the suborder chunk. This can be retrieved from the GET order response.

curl -X POST \
-H 'authorization: Bearer v4.public.eyJpc3MiOiJs...' \
-H 'content-type: application/json' \
-H 'Idempotency-Key: da7ca8f9-915b-472b-b5f0-81945bff9e4a' \
-d '{
"orderLines": [
{
"description": "APPLE iPhone 13 Pro 5G 256GB - 6.1\" Smartphone - Guld",
"quantity": 3,
"reference": "1336371",
"totalAmount": 4077000,
"totalVatAmount": 815400,
"type": "physical",
"unitDiscountAmount": 0,
"unitPrice": 1359000,
"vat": 2500
},
{
"description": "Shipping fee",
"quantity": 1,
"reference": "444-555-666",
"totalAmount": 10000,
"totalVatAmount": 2000,
"type": "shippingFee",
"unitDiscountAmount": 0,
"unitPrice": 10000,
"vat": 2500
}
],
"totalCaptureAmount": 4087000
}'
https://api.sandbox.ledyer.com/v1/orders/:orderId/capture

Request Headers

Idempotency-Key

stringOptional

By providing a unique value for this header, the idempotency of the operation will be guaranteed. This means that retries of requests will be safe to apply in case of network errors, socket errors and timeouts, etc. We recommend using UUID version 4 for the key.

Path parameters

orderId

The order ID string that was obtained when the order session was created.

Request body

orderLines

array of orderlines

An array of order lines.

totalCaptureAmount

integer

The sum of all order lines totalAmount.