Idempotency-Key string A unique key for safely retrying a request without duplicating work.
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 Idempotency-Key string orderId string orderLines array description string quantity integer reference string Optional totalAmount integer totalVatAmount integer type string unitDiscountAmount integer Optional unitPrice integer vat integer totalCaptureAmount integer {
"captured": [
{
"availableActions": [
{
"type": "refund"
},
{
"type": "partialRefund"
}
],
"createdAt": "2023-02-12T21:07:34.996030644Z",
"documentReference": "970245072092446903",
"documentUrl": "https://invoice.sandbox.ledyer.com/invoice-970245072",
"ledgerId": "in_251gXaJlexehngiZ7oUW3aTe7SK",
"note": "",
"orderLines": [
{
"description": "APPLE iPhone 13 Pro 5G 256GB - 6.1" Smartphone - Guld",
"id": "ol_251gXZSICCSqIj2uTwfnRy5xLE4",
"quantity": 3,
"reference": "1336371",
"totalAmount": 4077000,
"totalVatAmount": 815400,
"type": "physical",
"unitDiscountAmount": 0,
"unitPrice": 1359000,
"vat": 2500
},
{
"description": "Shipping fee",
"id": "ol_251gXYKdDEMdjR6pCsvBi0G1LSg",
"quantity": 1,
"reference": "444-555-666",
"totalAmount": 10000,
"totalVatAmount": 2000,
"type": "shippingFee",
"unitDiscountAmount": 0,
"unitPrice": 10000,
"vat": 2500
}
],
"status": [],
"totalOrderAmount": {
"amount": "40870.00",
"currency": "SEK",
"formatted": "40,870.00",
"formattedWithCurrency": "SEK 40,870.00",
"minorUnits": 4087000
},
"totalOrderAmountExclVat": {
"amount": "32696.00",
"currency": "SEK",
"formatted": "32,696.00",
"formattedWithCurrency": "SEK 32,696.00",
"minorUnits": 3269600
},
"totalOrderVatAmount": {
"amount": "8174.00",
"currency": "SEK",
"formatted": "8,174.00",
"formattedWithCurrency": "SEK 8,174.00",
"minorUnits": 817400
}
}
],
"capturedAmount": {
"amount": "40870.00",
"currency": "SEK",
"formatted": "40,870.00",
"formattedWithCurrency": "SEK 40,870.00",
"minorUnits": 4087000
},
"createdAt": "2023-02-12T21:07:26.573758Z",
"customer": { ... },
"events": [
{
"amount": {
"amount": "40870.00",
"currency": "SEK",
"formatted": "40,870.00",
"formattedWithCurrency": "SEK 40,870.00",
"minorUnits": 4087000
},
"createdAt": "2023-02-13T21:07:34.99603Z",
"id": "oe_251gYeeCAuO19mDfigbyET5v0X5",
"ledgerId": "in_251gXaJlexehngiZ7oUW3aTe7SK",
"orderId": "or_251gX4vC526p3HER0rX9N0DhWPd",
"type": "fullCapture"
},
{
"amount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"createdAt": "2023-02-12T21:07:27.573758Z",
"id": "oe_251gXZgnGlRIa6H3GOyJcWjUyFN",
"ledgerId": "in_251gXaJlexehngiZ7oUW3aTe7SK",
"orderId": "or_251gX4vC526p3HER0rX9N0DhWPd",
"type": "readyForCapture"
},
{
"amount": {
"amount": "40870.00",
"currency": "SEK",
"formatted": "40,870.00",
"formattedWithCurrency": "SEK 40,870.00",
"minorUnits": 4087000
},
"createdAt": "2023-02-12T21:07:26.573758Z",
"id": "oe_251gXZgnGlRIa6H3GOyJcWjUyFN",
"ledgerId": "in_251gXaJlexehngiZ7oUW3aTe7SK",
"orderId": "or_251gX4vC526p3HER0rX9N0DhWPd",
"type": "create"
}
],
"expiresAt": "2023-02-26T21:07:26.573758Z",
"id": "or_251gX4vC526p3HER0rX9N0DhWPd",
"merchantId": "ac_1xWqkkS5aIbxCJsoseRhSd0OJyD",
"merchantReference": "or_251gX4vC526p3HER0rX9N0DhWPd",
"orderAmount": {
"amount": "40870.00",
"currency": "SEK",
"formatted": "40,870.00",
"formattedWithCurrency": "SEK 40,870.00",
"minorUnits": 4087000
},
"orderReference": "MHC8LGM1",
"paymentMethod": {
"provider": "ledyer",
"type": "advanceInvoice"
},
"refunded": [],
"refundedAmount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"riskProfile": {
"tags": []
},
"status": [
"fullyCaptured"
],
"storeId": "970245072",
"uncaptured": null,
"uncapturedAmount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"updatedAt": "2023-02-13T21:07:34.99603Z"
} captured array availableActions array type property that describes an available action. The following types can be listed: - cancel: The order can be cancelled. - capture: The order can be fully
captured. - editCustomer: The customer details of the order can be
edited. - editOrder: The order lines can be edited. - editPaymentMethod: The payment method of the order can be edited. - extendExpiry: The
expiry date of the order can be extended. - partialCapture: The order can
be partially captured. - partialRefund: The order can be partially
refunded. - refund: The order can be fully refunded.createdAt string ledgerId string documentReference string Optional documentUrl string Optional note string Optional orderLines array description string quantity integer reference string Optional totalAmount integer totalVatAmount integer type string unitDiscountAmount integer Optional unitPrice integer vat integer status array totalOrderAmount integer totalOrderAmountExclVat integer totalOrderVatAmount integer capturedAmount object events array A list of order event snapshots. Each event includes an amount object with amount, currency, formatted, formattedWithCurrency, and minorUnits, plus createdAt, orderId, ledgerId, and type.
Supported type values:
acknowledge: Order has been acknowledged.authorize: Order has been authorized.cancel: Order has been cancelled.create: Order has been created.edit: Order lines and related order details have been edited since
first authorization.editCustomer: Customer details have been edited.editPaymentMethod: Payment method has been changed.extendExpiry: Order expiry has been extended at least once.fullCapture: All order lines have been captured.fullRefund: All order lines have been added to a credit invoice.paid: Order has been paid.partialCapture: Some order lines have been captured.partialRefund: Some order lines have been added to a credit invoice.readyForCapture: Order has been made ready for capture.setReference: Merchant order reference has been updated.status array of strings cancelled: Order has been cancelled.expired: The expiry date of the order is passed.fullyCaptured: All order lines have been captured.fullyPaid: The order has been paid fully.fullyRefunded: All order lines have been added to a credit invoice.partiallyCaptured: Some of the order lines have been captured.partiallyPaid: The order has been paid partially.partiallyRefunded: Some of the order lines have been added to a credit
invoice.unacknowledged: The order has not yet been acknowledged.uncaptured: The order has not yet been captured.uncaptured null uncapturedAmount object updatedAt string