Set or edit order reference
- Example Request
- Example Response
curl -X POST \
-H 'authorization: Bearer v4.public.eyJpc3MiOiJs...' \
-H 'content-type: application/json' \
-H 'Idempotency-Key: da7ca8f9-915b-472b-b5f0-81945bff9e4a' \
-d '{
"reference": "This is an updated merchant order reference"
}'
https://api.sandbox.ledyer.com/v1/orders/:orderId/reference \
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.
Path parameters
orderId
The order ID string that was obtained when the order session was created.
Request body
reference
stringThe desired order reference to be set or edited. Max 50 characters.
{
"authorizeStatus": "authorized",
"captured": [],
"capturedAmount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00"
},
"createdAt": "2022-02-14T13:27:15.894811Z",
"customer": { ... },
"events": [
{
"amount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"createdAt": "2022-02-14T13:37:15.894811Z",
"id": "oe_256Qp2shuTctFUp1aDRa1f2jp5W",
"ledgerId": "in_256Qp7McaZtN8coxjAQW6tETyac",
"orderId": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
"type": "setReference"
},
{
"amount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"createdAt": "2022-02-14T13:27:15.894811Z",
"id": "oe_256Qp2shuTctFUp1aDRa1f2jp5W",
"ledgerId": "in_256Qp7McaZtN8coxjAQW6tETyac",
"orderId": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
"type": "readyForCapture"
},
{
"amount": {
"amount": "5100.00",
"currency": "SEK",
"formatted": "5,100.00",
"formattedWithCurrency": "SEK 5,100.00",
"minorUnits": 510000
},
"createdAt": "2022-02-14T13:27:14.894811Z",
"id": "oe_123Wp2shuTctFUp1aDRa1f2ab6X",
"ledgerId": "in_256Qp7McaZtN8coxjAQW6tETyac",
"orderId": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
"type": "create"
}
],
"expiresAt": "2022-02-28T13:27:15.894811Z",
"id": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
"merchantId": "ac_1xWqkkS5aIbxCJsoseRhSd0OJyD",
"merchantReference": "This is an updated merchant order reference",
"orderAmount": {
"amount": "5100.00",
"currency": "SEK",
"formatted": "5,100.00",
"formattedWithCurrency": "SEK 5,100.00",
"minorUnits": 510000
},
"orderReference": "XP72XUYB",
"paymentMethod": {
"provider": "ledyer",
"type": "invoice"
},
"refunded": [],
"refundedAmount": {
"amount": "0.00",
"currency": "SEK",
"formatted": "0.00",
"formattedWithCurrency": "SEK 0.00",
"minorUnits": 0
},
"riskProfile": {
"tags": []
},
"storeId": "970245072",
"status": [
"uncaptured"
],
"uncaptured": { ... },
"uncapturedAmount": {
"amount": "5100.00",
"currency": "SEK",
"formatted": "5,100.00",
"formattedWithCurrency": "SEK 5,100.00",
"minorUnits": 510000
},
"updatedAt": "2022-02-14T13:37:15.894811Z"
}
events
array of eventsA list of event objects, or snapshots on the order.
Each object contains an amount
object with the strings amount
, currency
formatted
, formattedWithCurrency
and integer minorUnits
pertaining to the event.
The event object also contains the date string createdAt
as well as orderId
and ledgerId
, and finally the event type
.
Events can have one of the following types:
acknowledge
: Order has been acknowledged.authorize
: Order has been authorized.cancel
: Order has been cancelled.create
: Order has been created.edit
: The order lines etc have been edited since first authorized.editCustomer
: The customer details of the order have been edited.editPaymentMethod
: The payment method of the order has been changed.extendExpiry
: The expiry date of the order 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 of the order lines have been captured.partialRefund
: Some of the order lines have been added to a credit invoice.readyForCapture
: Order has been made ready for capture.setReference
: The merchant's order reference has been updated.
merchantReference
stringThe reference that was updated by the request.
updatedAt
stringThe timestamp of the latest added event under events
.