Acknowledgement
In order to make sure Ledyer and your order management are in sync we provide the acknowledge API. When receiving a notification call you should get the order, and confirm to ledyer by making a POST request.
Advance invoice
If the payment method of the order is advanceInvoice
the order can not be captured before an acknowledgement has been made, in all other cases the order can be updated or captured even before acknowledgement.
- Request
- Example response
curl -X POST \
-H 'authorization: Basic dGhpcy1pcy10aGUtY2xpZW50LWlkOnRoaXMtaXMtdGhlLXNlY3JldA==' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'Idempotency-Key: da7ca8f9-9155-4721-b5f0-81945bff9e4a' \
-d grant_type=client_credentials \
https://api.sandbox.ledyer.com/v1/orders/:orderId/acknowledge
Request Headers
Idempotency-Key
stringOptionalBy 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.
{
"authorizeStatus": "authorized",
"captured": [],
"capturedAmount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"createdAt": "2023-04-08T12:02:54.409206Z",
"customer": {
"billingAddress": {
"attentionName": "",
"careOf": "",
"city": "Stockholm",
"companyName": "Kalles kulor AB",
"country": "SE",
"postalCode": "11359",
"streetAddress": "Sveavägen 49"
},
"companyId": "559311-7314",
"companyName": "Kalles kulor AB",
"email": "kalle@kulor.com",
"firstName": "Kalle",
"invoiceChannel": {
"configurations": null,
"details": "",
"state": "",
"type": "email"
},
"lastName": "Kulor",
"paymentMethod": {
"provider": "ledyer",
"type": "invoice"
},
"phone": "0700000000",
"reference1": "",
"reference2": "",
"shippingAddress": {
"attentionName": "",
"careOf": "",
"city": "Stockholm",
"companyName": "Kalles kulor AB",
"country": "SE",
"postalCode": "11359",
"streetAddress": "Sveavägen 49"
},
"vatId": "SE559311731401"
},
"events": [
{
"amount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"createdAt": "2023-04-08T12:02:54.409206Z",
"id": "oe_2O8wApdATWz5YcAPCD5wyDUhtoW",
"ledgerId": "in_2O8wAgBfajKRiAhTpBom3eAf7Lo",
"orderId": "or_2O8wA2vp4XI3XZeJaSMYVM09rve",
"type": "readyForCapture"
},
{
"amount": {
"amount": "5000.00",
"currency": "SEK",
"formatted": "5,000.00",
"formattedWithCurrency": "SEK 5000.00",
"minorUnits": 500000
},
"createdAt": "2023-04-08T12:02:54.409206Z",
"id": "oe_2O8wAj7HT38S9MEKbMZNIJsJ8q0",
"ledgerId": "in_2O8wAgBfajKRiAhTpBom3eAf7Lo",
"orderId": "or_2O8wA2vp4XI3XZeJaSMYVM09rve",
"type": "create"
}
],
"expiresAt": "2023-04-22T12:02:54.409206Z",
"id": "or_2O8wA2vp4XI3XZeJaSMYVM09rve",
"merchantId": "ac_1xWqkkS5aIbxCJsoseRhSd0OJyD",
"merchantReference": "",
"orderAmount": {
"amount": "5000.00",
"currency": "SEK",
"formatted": "5,000.00",
"formattedWithCurrency": "SEK 5,000.00",
"minorUnits": 500
},
"orderReference": "AT341NKD",
"paymentMethod": { "provider": "ledyer", "type": "invoice" },
"refunded": [],
"refundedAmount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"riskProfile": { "tags": [] },
"status": ["uncaptured", "unacknowledged"],
"storeId": "343096764",
"uncaptured": {
"createdAt": "2023-04-08T12:02:54.409206981Z",
"ledgerId": "in_2O8wAgBfajKRiAhTpBom3eAf7Lo",
"orderLines": [
{
"description": "SAMSUNG Galaxy S20 FE 4G 128GB (6GB RAM) 6.5 Smartphone - Cloud Navy",
"id": "ol_2O8wAcJfkfOK5hZU8Gf0fM0xqwQ",
"quantity": 1,
"reference": "1334227",
"totalAmount": 500000,
"totalVatAmount": 100000,
"type": "physical",
"unitDiscountAmount": 0,
"unitPrice": 500000,
"vat": 2500
}
],
"totalOrderAmount": {
"amount": "5000.00",
"currency": "SEK",
"formatted": "5,000.00",
"formattedWithCurrency": "SEK 5,000.00",
"minorUnits": 500000
},
"totalOrderAmountExclVat": {
"amount": "4000.00",
"currency": "SEK",
"formatted": "4,000.00",
"formattedWithCurrency": "SEK 4,000.00",
"minorUnits": 400000
},
"totalOrderVatAmount": {
"amount": "1000.00",
"currency": "SEK",
"formatted": "1,000.00",
"formattedWithCurrency": "SEK 1,000.00",
"minorUnits": 100000
},
"status": []
},
"uncapturedAmount": {
"amount": "5000.00",
"currency": "SEK",
"formatted": "5,000.00",
"formattedWithCurrency": "SEK 5,000.00",
"minorUnits": 500000
},
"updatedAt": "2023-04-08T12:02:54.409206Z"
}