Get order withdrawals
A withdrawal case is created when a customer exercises their right of withdrawal on an order. Each case belongs to an order, holds the customer's comment, and lists the order rows the customer wants to withdraw.
You can filter the cases by status, by the orders or customers they belong to, by specific withdrawal IDs, or by when they were created.
Which cases you get back depends on the token you use. With an ADMIN token you receive withdrawals for all customers. With a CUSTOMER token you only receive withdrawals tied to that customer's own orders.
The log field is available to ADMIN tokens only, and is omitted from customer-scoped queries.
Request:
query getWithdrawals {
orderWithdrawalConnection(first: 2, filter: {status: NEW}) {
edges {
node {
id
orderId
status
comment
createdAt
updatedAt
rows {
orderRowId
orderRow {
id
quantity
product {
name {
value
}
}
}
}
log {
id
message
addedAt
}
}
}
pageInfo {
endCursor
}
totalCount
}
}
Response:
{
"data": {
"orderWithdrawalConnection": {
"edges": [
{
"node": {
"id": 3312,
"orderId": 338,
"status": "NEW",
"comment": "Changed my mind about the purchase",
"createdAt": "2024-05-06T09:14:02Z",
"updatedAt": "2024-05-06T09:14:02Z",
"rows": [
{
"orderRowId": 668,
"orderRow": {
"id": 668,
"quantity": 1,
"product": {
"name": [
{
"value": "Pioneer, DV-585A, DVD-spelare"
}
]
}
}
}
],
"log": [
{
"id": 4521,
"message": "Withdrawal registered by customer",
"addedAt": "2024-05-06T09:14:02Z"
}
]
}
},
{
"node": {
"id": 3313,
"orderId": 339,
"status": "NEW",
"comment": "Ordered the wrong size",
"createdAt": "2024-05-07T14:41:55Z",
"updatedAt": "2024-05-07T14:41:55Z",
"rows": [
{
"orderRowId": 669,
"orderRow": {
"id": 669,
"quantity": 1,
"product": {
"name": [
{
"value": "ClearSip Elegance"
}
]
}
}
}
],
"log": [
{
"id": 4522,
"message": "Withdrawal registered by customer",
"addedAt": "2024-05-07T14:41:55Z"
}
]
}
}
],
"pageInfo": {
"endCursor": "3313"
},
"totalCount": 7
}
}
}