Get orders
- Example Request
- Example Response
curl -X GET \
-H 'authorization: Bearer v4.public.eyJpc3MiOiJs...' \
https://api.sandbox.ledyer.com/v1/orders \
Query parameters
createdFrom
stringOptionalA date in ISO 8601 format, ex: 2011-10-05T14:48:00.000Z
.
createdTo
stringOptionalA date in ISO 8601 format, ex: 2011-10-05T14:48:00.000Z
.
cursor
stringOptionalThe value of nextCursor
from the last response of a GET /orders
. Passing in a cursor will return the next batch of orders.
Use this to implement pagination/infinite scroll.
expiresFrom
stringOptionalA date in ISO 8601 format, ex: 2011-10-05T14:48:00.000Z
.
expiresTo
stringOptionalA date in ISO 8601 format, ex: 2011-10-05T14:48:00.000Z
.
fromId
stringOptionalDeprecatedDepracted, use cursor
instead.
An orderId
used to get the next set of orders, where the set size is based on the size
parameter.
It is usually assigned the value from lastId
which was retrieved in the response from the last GET /orders
request.
id
array of stringsOptionalAn array of id
s.
merchantReference
array of stringsOptionalAn array of merchantReference
s.
orderReference
array of stringsOptionalAn array of orderReference
s.
paymentMethodCategory
array of stringsOptionalA list of strings querying categories of payment methods.
advanceInvoice
: An invoice that needs to be paid in advance before order can be ready for capture.card
: Direct payment via card.invoice
: An invoice issued by Ledyer that can be paid within a set amount of days.serviceInvoice
: An invoice administrated by Ledyer.
q
stringOptionalA search query consisting of either an orderId
, orderReference
or a merchantReference
. Matches the full string.
size
numberOptionalThe number of orders to fetch. Defaults to 100.
status
array of stringsOptionalA list of status strings querying orders with matching status/es. Given more than one status string, the query will match orders with any status in the list.
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.
statusAnd
array of stringsOptionalA list of status strings for querying orders with matching status/es. The statuses in queried orders need to match all status strings provided in the query.
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.
storeId
array of stringsOptionalAn array of storeId
s.
{
"lastId": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
"noOfOrders": 1,
"nextCursor": "MjAyMy0wOS0yMFQwNzoxODowMy41MTEwOPVa",
"orders": [
{
"createdAt": "2021-09-01T11:25:32.805672147Z",
"customer": {
"companyId": "559311-3714",
"companyName": "Rocket 4",
"email": "jan@example.com",
"firstName": "Jan",
"lastName": "Persson",
"phone": "+46761010101",
"vatId": "SE559311371401"
},
"expiresAt": "2021-09-11T11:25:32.805672147Z",
"id": "or_1xE2fDBg9rRwh6nENMA3ly3B3Qg",
"merchantId": "ac_1xRXHKwBNxnbzMeJfy2olPJEKP7",
"merchantReference": "xdc-345-xdk-214",
"orderReference": "3HS2I4BJ",
"paymentMethodCategory": "invoice",
"status": ["fullyCaptured"],
"storeId": "421423100",
"totalOrderAmount": {
"amount": "5100.00",
"currency": "SEK",
"formatted": "5,100.00",
"formattedWithCurrency": "SEK 5,100.00",
"minorUnits": 510000
}
}
]
}
lastId
stringDeprecatedDeprecated, use nextCursor
instead.
An order id
that can be used in another GET /orders
request to get the subsequent orders by querying with fromId
.
nextCursor
stringAn id
that can be used in another GET /orders
request. Passing in a cursor will return the next batch of orders. Use this to implement e.g pagination or infinite scroll.
noOfOrders
stringThe number of orders that were received in the response. Can be adjusted by setting the size
query parameter in the request.
Default size is 100.
orders
array of ordersAn array of orders, with the last item indicated by lastId
.