Get latest orders
The API provides the ability to fetch orders from the platform. You can filter which orders are retrieved by createdAt, a specific status, or from a specific order ID.
You can either fetch orders for multiple customers by including an ADMIN token, or fetch orders for a specific customer by using a token that belongs to a customer (CUSTOMER).
Request:
query getOrders {
orderConnection(first:2, filter: {createdFrom: "2024-04-16T16:13:03Z"}) {
edges{
node{
id
createdAt
customer{
id
}
shippingAddress {
firstName
lastName
streetAddress
houseNumber
postalCode
city
phone
}
rows{
id
quantity
product{
name{
value
}
}
unitPrice{
currency{
code
rate
}
priceExcludingTax
}
}
paidAt
totals{
price{
priceExcludingTax
}
}
}
}
pageInfo {
endCursor
}
totalCount
}
}
Response:
{
"data": {
"orderConnection": {
"edges": [
{
"node": {
"id": 338,
"createdAt": "2024-05-03T11:32:28Z",
"customer": {
"id": 316
},
"shippingAddress": {
"firstName": "Erik",
"lastName": "Svensson",
"streetAddress": "Järnvägsgatan 11",
"houseNumber": null,
"postalCode": "66133",
"city": "Säffle",
"phone": "+46 73 000 00 00"
},
"rows": [
{
"id": 668,
"quantity": 1,
"product": {
"name": [
{
"value": "Pioneer, DV-585A, DVD-spelare"
}
]
},
"unitPrice": {
"currency": {
"code": "NOK",
"rate": 1
},
"priceExcludingTax": 1303.9075
}
}
],
"paidAt": "2024-05-03T11:32:29Z",
"totals": {
"price": {
"priceExcludingTax": 1303.91
}
}
}
},
{
"node": {
"id": 339,
"createdAt": "2024-05-03T11:34:43Z",
"customer": {
"id": 316
},
"shippingAddress": {
"firstName": "Anna",
"lastName": "Andersson",
"streetAddress": "Järnvägsgatan 11",
"houseNumber": null,
"postalCode": "66130",
"city": "Säffle",
"phone": "+46 73 836 56 88"
},
"rows": [
{
"id": 669,
"quantity": 1,
"product": {
"name": [
{
"value": "ClearSip Elegance"
}
]
},
"unitPrice": {
"currency": {
"code": "NOK",
"rate": 1
},
"priceExcludingTax": 58.473
}
}
],
"paidAt": "2024-05-03T11:34:43Z",
"totals": {
"price": {
"priceExcludingTax": 85.2
}
}
}
}
],
"pageInfo": {
"endCursor": "339"
},
"totalCount": 29
}
}
}