Skip to main content

checkouts Query

Description​

Retrieves a paginated list of checkouts filtered by status, origin, and whether they contain items. Results are sorted by creation date, newest first, unless sort is given.

query checkouts(
$status: String
$origin: String
$nonEmpty: Boolean
$buyerRef: ID
$listingId: String
$page: Int
$limit: Int
$sort: String
$order: Int
) {
checkouts(
status: $status
origin: $origin
nonEmpty: $nonEmpty
buyerRef: $buyerRef
listingId: $listingId
page: $page
limit: $limit
sort: $sort
order: $order
) {
pagination {
limit
count
page
pages
hasMore
capped
}
checkouts {
_id
id
version
origin
created
orderId
updated
expires
status
useSingleAddress
locationRef
}
}
}

Variables​

{
"status": "status",
"origin": "origin",
"nonEmpty": true,
"buyerRef": "8d8c81e4884e7332bb3aeac3",
"listingId": "listingId",
"page": 1,
"limit": 20,
"sort": "sort",
"order": -1
}

Response​

{
"checkouts": {
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true,
"capped": true
},
"checkouts": [
{
"_id": "ad578b9811925a6b1ff89cba",
"id": "cuf-l97Z9",
"version": 42,
"origin": "example",
"created": 1763725450840,
"orderId": "example",
"updated": 1749300938486,
"expires": 1764959709737,
"status": "open",
"useSingleAddress": true,
"locationRef": "b8c47f3176262bc02965c3d2"
}
]
}
}

Arguments​

NameTypeDescription
statusStringStatus to filter checkouts by. Valid values include "open" for active checkouts or "complete" for submitted checkouts. Defaults to "open" if not specified.
originStringOrigin identifier to filter checkouts by, such as "Shop" or "POS". Defaults to "Shop" if not specified.
nonEmptyBooleanWhether to return only checkouts that contain items. If true, returns only checkouts with at least one item.
buyerRefIDReference ID of the buyer to filter checkouts by.
listingIdStringIdentifier of a listing. Returns only checkouts containing that listing.
pageIntThe requested page number. Defaults to 1 if not specified.
limitIntNumber of checkouts per page. Capped by the server maximum.
sortStringField to sort by: "total" for the grand total, "updated" for the last modification date, "created" for the creation date. Defaults to "created".
orderIntSort order: 1 for ascending, -1 for descending. Defaults to -1.

Returns​

CheckoutsConnection!