Queries and mutations to read Orders, place Orders from the Cart, and manage returns and cancellations.

Queries

Query Orders

QUERYorders

Returns the Order history of the session. For a B2B session, these are the Orders of the selected Business Unit. Otherwise, these are the shopper's own Orders that belong to no Business Unit.

Returns an empty page when the session has no shopper.

Arguments
filter​

Filter to apply.

sort​
Sort order. If omitted, Orders are sorted by PLACED_AT, newest first.
first​
Int​
Number of Orders to return, from 0 to 500. A value outside this range returns a BAD_USER_INPUT error.
Default: 20​
after​
String​
Cursor of the edge to start after, from OrderEdge.cursor or pageInfo.endCursor. A cursor that this API did not issue returns a BAD_USER_INPUT error.
Request Example:graphql
query GetOrders {
  orders(first: 1, sort: {field: PLACED_AT, direction: DESC}) {
    pageInfo { hasNextPage endCursor }
    nodes {
      id
      reference
      orderState
      total { formatted }
    }
  }
}
Response Example:json
{
  "data": {
    "orders": {
      "pageInfo": { "hasNextPage": true, "endCursor": "AW9nZ3NkdDsx" },
      "nodes": [
        {
          "id": "AQIAATs6OzozM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
          "reference": "3b3b3b3b-3333-4333-a333-333333333333",
          "orderState": "CONFIRMED",
          "total": { "formatted": "£93.95" }
        }
      ]
    }
  }
}

Get Order by ID

QUERYorder
Returns an Order of the session. Returns null when the Order does not exist or is not visible to the session.
Arguments
id​
ID​
id of the Order. Accepts Order.id and OrderListItem.id.
Output:Order
Request Example:graphql
query GetOrder {
  order(id: "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA") {
    id
    reference
    orderState
    lines { productName quantity }
    totals {
      grandTotal { formatted }
    }
  }
}
Response Example:json
{
  "data": {
    "order": {
      "id": "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
      "reference": "33333333-3333-4333-a333-333333333333",
      "orderState": "COMPLETE",
      "lines": [
        { "productName": "Oak Dining Chair", "quantity": 2 },
        { "productName": "Linen Cushion", "quantity": 1 }
      ],
      "totals": { "grandTotal": { "formatted": "£186.75" } }
    }
  }
}

Checkout and place Order

Checkout

MUTATIONcheckout

Places the Cart of the session as an Order, for a signed-in Customer. The Order is placed under the Customer's email address.

An empty Cart is refused with EMPTY_CART. A session without a signed-in Customer is refused with NOT_AUTHORIZED.
Arguments
input​

Details of the Order to place.

Request Example:graphql
mutation Checkout {
  checkout(
    input: {shippingAddressId: "ARIDAURFREVERERFpEVERERFREUBCGFDM2RFNWZGAAEAAAAAAAEAAAABAAEAAA", shippingMethodId: "AQsAAdHT09Xh4k8eihuxsrO1tbcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA", payment: {methodKey: "card"}}
  ) {
    order { id reference placedAt orderState }
    userErrors { code message field }
  }
}
Response Example:json
{
  "data": {
    "checkout": {
      "order": {
        "id": "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
        "reference": "33333333-3333-4333-a333-333333333333",
        "placedAt": "2026-09-14T10:15:00.000Z",
        "orderState": "OPEN"
      },
      "userErrors": []
    }
  }
}

Guest checkout

MUTATIONguestCheckout

Places the Cart of the session as an Order, without a Customer account.

An empty Cart is refused with EMPTY_CART. A session with a signed-in Customer is refused with FORBIDDEN_ACTION. Use checkout instead.
Arguments
input​

Details of the Order to place.

Request Example:graphql
mutation GuestCheckout {
  guestCheckout(
    input: {email: "jane.doe@example.com", shippingAddress: {name: "Jane Doe", line1: "1 Example Street", city: "London", postalCode: "SW1A 1AA", country: "GB"}, shippingMethodId: "AQsAAdHT09Xh4k8eihuxsrO1tbcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA", payment: {methodKey: "card"}}
  ) {
    order { id reference orderState email }
    userErrors { code message field }
  }
}
Response Example:json
{
  "data": {
    "guestCheckout": {
      "order": {
        "id": "AQIAATw9PD0zM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
        "reference": "3c3c3c3c-3333-4333-a333-333333333333",
        "orderState": "OPEN",
        "email": "jane.doe@example.com"
      },
      "userErrors": []
    }
  }
}

Place Order

MUTATIONplaceOrder

Places the Cart of the session as a B2B Order for the selected Business Unit. The result reports whether the Order matched an Approval Rule.

An empty Cart is refused with EMPTY_CART. A session without a selected Business Unit returns a BUSINESS_UNIT_REQUIRED error.
Arguments
input​

Details of the Order to place.

Request Example:graphql
mutation PlaceOrder {
  placeOrder(
    input: {purchaseOrderNumber: "PO-2026-0412", shippingAddressId: "ARMDAVVUVVRVVUVUpVRVVVVUVVQBCGhLN2tMOW1PAAEAAAAAAAEAAAABAAEAAA", shippingMethodId: "AQsAAdHT09Xh4k8eihuxsrO1tbcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"}
  ) {
    order { id purchaseOrderNumber orderState }
    approval { required approvalState flowId }
    userErrors { code message field }
  }
}
Response Example:json
{
  "data": {
    "placeOrder": {
      "order": {
        "id": "AQIAAT08PTwzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
        "purchaseOrderNumber": "PO-2026-0412",
        "orderState": "OPEN"
      },
      "approval": {
        "required": true,
        "approvalState": "PENDING",
        "flowId": "AQkAAbGzs7XBwk0cjh_x8vP19fcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
      },
      "userErrors": []
    }
  }
}

Post-purchase

Reorder

MUTATIONreorder
Adds the Product lines of an Order to a Cart, at their current Prices and with the quantities ordered. Lines that cannot be added are listed in unavailable, and the other lines are still added.
An Order that does not exist or is not visible to the session is refused with ORDER_NOT_FOUND.
Arguments
orderId​
ID​
id of the Order to reorder.
into​

Where to add the lines.

Can be ACTIVE_CART, or NEW_CART​Default: ACTIVE_CART​
Request Example:graphql
mutation Reorder {
  reorder(
    orderId: "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
    into: ACTIVE_CART
  ) {
    cart { id lineCount }
    unavailable { sku reason }
    userErrors { code message field }
  }
}
Response Example:json
{
  "data": {
    "reorder": {
      "cart": {
        "id": "AQEAASIjIiMiIkIjoiMiIiIjIiMAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
        "lineCount": 1
      },
      "unavailable": [
        { "sku": "CUSHION-LINEN-GREY", "reason": "OUT_OF_STOCK" }
      ],
      "userErrors": []
    }
  }
}

Request return

MUTATIONrequestReturn
Creates a return for items of an Order, in the shipment state ADVISED.
Offered when Order.availableActions lists RETURN. An Order that has not shipped is refused with RETURN_NOT_ALLOWED. If any line is refused, no return is created. An Order that does not exist or is not visible to the session is refused with ORDER_NOT_FOUND.
Arguments
input​

Return to request.

Request Example:graphql
mutation RequestReturn {
  requestReturn(
    input: {orderId: "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA", lines: [{lineId: "AQ0DATMyMzIzM0MyozIzMzMyMzIA9_f293d3R3emd3Z3d3d3dwEAAAABAAEAAA", quantity: 1, comment: "The colour does not match the photos."}]}
  ) {
    order {
      returns {
        lines { sku quantity }
      }
    }
    userErrors { code message field }
  }
}
Response Example:json
{
  "data": {
    "requestReturn": {
      "order": {
        "returns": [
          { "lines": [{ "sku": "CUSHION-LINEN-GREY", "quantity": 1 }] }
        ]
      },
      "userErrors": []
    }
  }
}

Cancel Order

MUTATIONcancelOrder
Sets the orderState of an Order to CANCELLED.
Offered when Order.availableActions lists CANCEL. An Order that is COMPLETE or CANCELLED is refused with ORDER_NOT_CANCELLABLE. A viewer without permission to cancel is refused with FORBIDDEN_ACTION. An Order that does not exist or is not visible to the session is refused with ORDER_NOT_FOUND.
Arguments
orderId​
ID​
id of the Order to cancel.
Request Example:graphql
mutation CancelOrder {
  cancelOrder(
    orderId: "AQIAATs6OzozM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
  ) {
    order { id reference orderState lastModifiedAt availableActions }
    userErrors { code message field }
  }
}
Response Example:json
{
  "data": {
    "cancelOrder": {
      "order": {
        "id": "AQIAATs6OzozM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
        "reference": "3b3b3b3b-3333-4333-a333-333333333333",
        "orderState": "CANCELLED",
        "lastModifiedAt": "2026-09-22T09:12:00.000Z",
        "availableActions": ["REORDER"]
      },
      "userErrors": []
    }
  }
}

Output types

Order

Purchase placed from a Cart, as returned by order and by the mutations that place or change it. availableActions lists what the viewer can do with it next.
id​
ID​

Unique identifier of the Order.

orderNumber​
String​
User-defined identifier of the Order. null when none is assigned.
reference​
String​
Reference to show to the shopper: orderNumber when set, otherwise the Order's platform identifier.
purchaseOrderNumber​
String​
Purchase order number of the buyer, as passed to placeOrder. null when none was given.
origin​

Origin of the Order.

Can be CUSTOMER, MERCHANT, QUOTE, or RECURRING_ORDER​
fromQuote​
Boolean​

Whether the Order was created from a Quote.

placedAt​

Date and time (UTC) the Order was created.

completedAt​
Date and time (UTC) the Order was completed. null when none is recorded.
lastModifiedAt​

Date and time (UTC) the Order was last updated.

placedBy​
Customer who placed the Order. null for a guest Order. For an Order outside a Business Unit, or from someone who is no longer an Associate of it, the Associate has no name and no roles.
businessUnit​
Business Unit the Order belongs to. null for a B2C Order.
store​
Store the Order belongs to. null when the Order belongs to no Store.
orderState​

State of the Order.

Can be OPEN, CONFIRMED, COMPLETE, or CANCELLED​
shipmentState​
Shipment state of the Order. null when none is set.
Can be PENDING, READY, SHIPPED, DELIVERED, DELAYED, PARTIAL, BACKORDER, or CANCELED​
paymentState​
Payment state of the Order. null when none is set.
Can be PENDING, PAID, FAILED, CREDIT_OWED, or BALANCE_DUE​
state​
State of the Order in the merchant's workflow. null when none is set.
email​
String​

Email address the Order was placed under. Empty when the Order has none.

lines​
Array of OrderLine​

Lines of the Order.

discounts​
Array of AppliedDiscount​
Every discount applied when the order was placed, one entry per discount and target, its amount summed over the order: Product Discounts included, except where a Best Deal rejected them. The non-SHIPPING entries add up to totals.discountTotal.
discountCombination​

How Product Discounts and Cart Discounts were combined on this order.

discountCodes​
Array of DiscountCodeInfo​

The Discount Codes the order was placed with, and where each stands.

totals​

Totals of the Order.

shippingAddress​

Address the Order is shipped to.

billingAddress​

Address the Order is billed to.

returns​
Array of Return​

Returns of the Order. Empty when nothing has been returned.

deliveries​
Array of Delivery​

Deliveries of the Order, in the order the platform stores them: first those of the Order's shipping, then those of each additional Shipping Method. Empty until the merchant records one.

approvalFlow​
Approval Flow that the Order started when it was placed. null when the Order needs no approval.
availableActions​
Array of OrderAction​

Actions the current viewer can take on the Order now.

Can be REORDER, RETURN, or CANCEL​
_ctId​
ID​
Platform identifier (UUID) of the Order, for extensions that correlate the Order with a fulfillment or accounting system. The public id is an opaque global identifier, so don't parse it.
Not part of the public API: an extension can read it with @requires, and it is removed from the composed API schema.

Order Line

Line of an Order as it was placed, with the units shipped so far.

id​
ID​
Unique identifier of the Order line. Pass it as ReturnLineInput.lineId to return units of it.
sku​
String​

SKU of the Product Variant. Empty for a line that has no Product, such as a custom line.

productName​
String​

Name of the Product in the session's locale.

imageUrl​
Url​
URL of the first image of the Product Variant. null when the variant has no image.
quantity​
Int​

Number of units ordered.

shippedQuantity​
Int​

Number of units recorded as shipped, across all deliveries of the Order. Not set on custom lines, so selecting this field on an Order that has a custom line returns an error.

outstandingQuantity​
Int​
Number of units still to ship: quantity minus shippedQuantity, and never less than zero. Not set on custom lines, so selecting this field on an Order that has a custom line returns an error.
isGift​
Boolean​
Whether this is a free Gift Line Item the platform added. Its Portion lists the gift discount that added it, which carries the same id as that discount's entry in discounts.
unitPriceBeforeDiscount​

One unit before any discount, as the order was placed: the Line Item's price.

priceMode​

How the Line Item's price was set; null for a custom line.

Can be PLATFORM, EXTERNAL_PRICE, or EXTERNAL_TOTAL​
discountedPrice​
One unit after its Product Discount, and the Product Discount behind it; null when none applied. Kept where a Best Deal rejected it: see rejectedByBestDeal.
portions​
Array of Portion​

The Line Item's units grouped by what they cost after Cart Discounts; at least one.

lineTotal​
What this Line Item cost after every discount: its Portions' unitPrice times quantity, added up. On an EXTERNAL_TOTAL Line Item it is the total the external system set instead.

Order Workflow State

Custom state from the merchant's State workflow, independent of orderState.
key​
String​

User-defined unique identifier of the State.

name​
String​

Name of the State in the session's locale.

Return

Return of items from an Order. requestReturn creates one.
id​
ID​

Unique identifier of the Return.

requestedAt​

Date and time (UTC) the return was initiated.

returnTrackingId​
String​
Identifier to track the return shipment. null until the merchant sets one.
lines​
Array of ReturnLine​

Items of the return. Each item has its own shipment and refund state.

Return Line

Returned units of one Order line.

sku​
String​

SKU of the returned Product Variant. Empty for a line that has no Product.

productName​
String​

Name of the returned Product in the session's locale. Empty for a line that has no Product.

quantity​
Int​

Number of units returned.

comment​
String​
Comment from the shopper about this item, as sent in ReturnLineInput.comment. null when none was sent.
shipmentState​

Shipment state of this item.

Can be ADVISED, RETURNED, BACK_IN_STOCK, or UNUSABLE​
paymentState​

Refund state of the item.

Can be INITIAL, NON_REFUNDABLE, REFUNDED, or NOT_REFUNDED​

Delivery

Shipment recorded by the merchant for an Order. An Order shipped in parts has several, and each can be split into parcels.

recordedAt​

Date and time (UTC) the Delivery was created.

lines​
Array of DeliveryLine​

Units the Delivery covers. When the Delivery lists no items of its own, these are the contents of its parcels.

parcels​
Array of Parcel​

Parcels of the Delivery. Empty when none are recorded.

address​
Address the parcels are delivered to. null when the Delivery uses the Order's shippingAddress.

Delivery Line

Quantity of one Order line.

sku​
String​

SKU of the Product Variant. Empty for a line that has no Product.

productName​
String​

Name of the Product in the session's locale. Empty for a line that has no Product.

quantity​
Int​

Number of units delivered.

Parcel

Physical package of a Delivery.

recordedAt​

Date and time (UTC) the Parcel was created.

trackingId​
String​
Identifier to track the Parcel. null when none is recorded.
carrier​
String​
Name of the carrier that delivers the Parcel. null when none is recorded.
isReturn​
Boolean​
Whether the Parcel is being returned to the merchant. null when not recorded.
lines​
Array of DeliveryLine​

Units in the Parcel. Empty when the delivery lists its contents instead.

Order List Item

Summary of an Order for order history. For the full Order, query order.
id​
ID​
Unique identifier of the Order. Accepted by order(id:).
orderNumber​
String​
User-defined identifier of the Order. null when none is assigned.
reference​
String​
Reference to show to the shopper: orderNumber when set, otherwise the Order's platform identifier.
origin​

Origin of the Order.

Can be CUSTOMER, MERCHANT, QUOTE, or RECURRING_ORDER​
fromQuote​
Boolean​

Whether the Order was created from a Quote.

placedAt​

Date and time (UTC) the Order was created.

orderState​

State of the Order.

Can be OPEN, CONFIRMED, COMPLETE, or CANCELLED​
shipmentState​
Shipment state of the Order. null when none is set.
Can be PENDING, READY, SHIPPED, DELIVERED, DELAYED, PARTIAL, BACKORDER, or CANCELED​
paymentState​
Payment state of the Order. null when none is set.
Can be PENDING, PAID, FAILED, CREDIT_OWED, or BALANCE_DUE​
businessUnit​
Business Unit the Order belongs to. null for a B2C Order.
total​
Total charged for the Order, including tax. Same amount as Order.totals.grandTotal.
availableActions​
Array of OrderAction​
Actions the current viewer can take on the Order now. Same as Order.availableActions.
Can be REORDER, RETURN, or CANCEL​

Order Connection

Page of order history returned by orders.
edges​
Array of OrderEdge​

Orders on this page, with their cursors.

nodes​
Array of OrderListItem​
Orders on this page, in the same order as edges.
pageInfo​

Pagination information of this page.

totalCount​
Int​

Total number of Orders that match the filter, across all pages.

Order Edge

Edge in an OrderConnection.

node​

The Order, as an order history row.

cursor​
String​
Opaque cursor of this edge. Pass it as after to get the next page.

Order Approval

Approval outcome reported by placeOrder. Afterward, read the Approval Flow on Order.approvalFlow.
required​
Boolean​
Whether the Order matched an Approval Rule when it was created, so an Approval Flow was created for it.
approvalState​

Current state of the Approval Flow.

Can be PENDING, APPROVED, or REJECTED​
flowId​
ID​
id of the Approval Flow.
currentTierPendingApproverRoles​
Array of AssociateRole​

Associate Roles the Approval Flow is waiting on in its current tier.

Unavailable Line

Order line skipped by reorder.
sku​
String​

SKU of the line. Empty when the line has no SKU.

productName​
String​

Name of the Product in the session's locale.

reason​

Why the line was skipped.

Can be DISCONTINUED, OUT_OF_STOCK, or PRICE_CHANGED​

Order State

Lifecycle state of an Order. Shipping and payment progress are tracked separately in ShipmentState and PaymentState.
OPEN
Default state of a new Order.
CONFIRMED
The Order is accepted and being processed.
COMPLETE
The Order is fulfilled.
CANCELLED
The Order is canceled.

Shipment State

Shipping progress of an Order as a whole. Returned items have their own ReturnShipmentState.
PENDING
Shipment of the Order is pending.
READY
The Order is ready to be shipped.
SHIPPED
The Order is shipped.
DELIVERED
The Order is delivered.
DELAYED
Shipment of the Order is delayed.
PARTIAL
Items in the Order are shipped in more than one shipment.
BACKORDER
Items in the Order are not in stock and are delivered once restocked.
CANCELED
Shipment of the Order is canceled.

Payment State

Payment progress of an Order.

PENDING
Payment for the Order is pending.
PAID
The Order is paid for.
FAILED
Payment for the Order has failed.
CREDIT_OWED
Payment for the Order is made on a credit basis.
BALANCE_DUE
A payment balance is due for the Order.

Order Origin

Who or what placed the Order. To find out whether the Order was created from a Quote, read Order.fromQuote.
CUSTOMER
Placed by the shopper.
MERCHANT
Placed on the shopper's behalf, by a sales representative or agent.
QUOTE
Placed from a quotation Cart.
RECURRING_ORDER
Placed as an instalment of a recurring Order.

Order Action

Action on an Order, as listed in availableActions. Resolved from the Order's state, the quantities still returnable, and, for a B2B Order, the viewer's Associate permissions.
REORDER
Add the Order's lines to a Cart with `reorder`. Offered when the Order has lines. Only Product lines are reordered, not custom lines.
RETURN
Return items with `requestReturn`. Offered when the Order is not canceled, is `COMPLETE` or has the shipment state `SHIPPED`, `DELIVERED`, or `PARTIAL`, and has units left to return.
CANCEL
Cancel the Order with `cancelOrder`. Offered when the Order is `OPEN` or `CONFIRMED` and, for a B2B Order, the viewer has permission to update it.

Return Shipment State

Lifecycle of a returned item's shipment. Items created by requestReturn start as ADVISED. A RETURNED item moves to BACK_IN_STOCK or UNUSABLE.
ADVISED
The shopper has announced the return.
RETURNED
The merchant has received the item.
BACK_IN_STOCK
The item is received and restocked.
UNUSABLE
The item is received but cannot be restocked.

Return Payment State

Lifecycle of a returned item's refund. An ADVISED item starts as NON_REFUNDABLE and a RETURNED item starts as INITIAL. From INITIAL, the merchant moves it to REFUNDED or NOT_REFUNDED.
INITIAL
A refund can be made for the item but is not settled yet.
NON_REFUNDABLE
No refund can be made for the item.
REFUNDED
The payment for the item is refunded.
NOT_REFUNDED
The payment for the item is not refunded.

Order Sort Field

Order attribute that orders can sort by.
PLACED_AT
Sort by the date and time the Order was created.
TOTAL
Sort by the total price of the Order. Where prices exclude tax, this is the total before tax, so the order can differ from `OrderListItem.total`, which includes tax.
ORDER_NUMBER
Sort by `orderNumber`.

Reorder Target

Cart that reorder adds the lines to.
ACTIVE_CART
The active Cart of the session. A Cart is created if there is none.
NEW_CART
A new Cart. Refused with `CART_NOT_EMPTY` when the active Cart already has lines.

Unavailable Reason

Cause of a line that reorder could not add.
DISCONTINUED
The Product is no longer sold, for example because the SKU no longer exists or is not in the Store's assortment.
OUT_OF_STOCK
The Product is out of stock.
PRICE_CHANGED
The Product has no Price for the session's currency, country, or channel.

Checkout Result

Result of checkout.
order​
The placed Order. null when userErrors is not empty.
userErrors​
Array of UserError​

Refusals of the checkout. Empty when the Order was placed.

Guest Checkout Result

Result of guestCheckout.
order​
The placed Order. null when userErrors is not empty.
userErrors​
Array of UserError​

Refusals of the checkout. Empty when the Order was placed.

Place Order Result

Result of placeOrder.
order​
The placed Order. null when userErrors is not empty.
approval​
Approval outcome of the placed Order. null when the Order needs no approval.
If the Approval Flow cannot be looked up, this field returns a GraphQL error with the code APPROVAL_STATE_UNKNOWN, and order is still returned.
userErrors​
Array of UserError​

Refusals of the order placement. Empty when the Order was placed.

Reorder Result

Result of reorder.
cart​
Cart​
Cart the lines were added to. null when userErrors is not empty.
unavailable​
Array of UnavailableLine​

Product lines that were not added. Empty when every Product line was added. Custom lines are neither added nor listed here.

userErrors​
Array of UserError​

Refusals of the reorder. Empty when the reorder ran.

Return Result

Result of requestReturn.
order​
The Order after the mutation, with the new return in returns. When the request is refused for the Order's state or a line, this is the unchanged Order. null when the Order isn't found, and when the platform refuses the write, which is returned as RETURN_NOT_ALLOWED.
userErrors​
Array of UserError​

Refusals of the return request. Empty when the return was created.

Order Result

Result of cancelOrder.
order​
The Order after the mutation. When the cancellation is refused for the Order's state or the viewer's permissions, this is the unchanged Order. null when the Order isn't found, and when the platform refuses the write after those checks, which is returned as FORBIDDEN_ACTION or ORDER_NOT_CANCELLABLE.
userErrors​
Array of UserError​

Refusals of the cancellation. Empty when the Order was canceled.

Input types

Order Filter

Filter for orders. All set fields must match.
query​
String​
Exact value to match against the Order's reference, orderNumber, purchaseOrderNumber, or the SKU of one of its lines. Partial values do not match.
orderState​
Array of OrderState​

Order states to match. An Order matches if it is in any of them.

Can be OPEN, CONFIRMED, COMPLETE, or CANCELLED​
placedAfter​

Matches Orders created after this date and time.

placedBefore​

Matches Orders created before this date and time.

Order Sort

Sort order for orders.
field​

Field to sort by.

Can be PLACED_AT, TOTAL, or ORDER_NUMBER​Default: PLACED_AT​
direction​

Direction to sort in.

Can be ASC, or DESC​Default: DESC​

Checkout Input

Checkout choices of a signed-in Customer. Every field is optional.

shippingAddressId​
ID​
id of a SavedAddress in the Customer's address book to ship to. If omitted or blank, the shipping address already on the Cart is used.
An id that matches no saved address is refused with ADDRESS_NOT_FOUND. So is an omitted id when the Cart has no shipping address.
billingAddressId​
ID​
id of a SavedAddress in the Customer's address book to bill to. If omitted, the billing address on the Cart is used, or the shipping address when the Cart has none. An id that matches no saved address is refused with ADDRESS_NOT_FOUND.
shippingMethodId​
ID​
id of the Shipping Method to set on the Cart before the Order is created. If omitted or blank, the Cart keeps the Shipping Method it already has, if any. An unusable Shipping Method is refused with UNKNOWN_SHIPPING_METHOD.
payment​

Payment for the Order. If omitted, the Order is placed with no payment attached.

Guest Checkout Input

Everything needed to place an Order without a Customer account.

email​
String​

Email address the Order is placed under.

shippingAddress​

Address to ship the Order to.

billingAddress​

Address to bill the Order to. If omitted, the shipping address is used.

shippingMethodId​
ID​
id of the Shipping Method to set on the Cart before the Order is created. If omitted or blank, the Cart keeps the Shipping Method it already has, if any.
payment​

Payment for the Order. If omitted, the Order is placed with no payment attached.

Place Order Input

Order details for a B2B checkout. Every field is optional.

purchaseOrderNumber​
String​

Purchase order number of the buyer, stored on the Order.

shippingAddressId​
ID​
id of a SavedAddress in the Business Unit's or the Associate's address book to ship to. If omitted or blank, the shipping address already on the Cart is used.
An id that matches no saved address is refused with ADDRESS_NOT_FOUND. So is an omitted id when the Cart has no shipping address.
billingAddressId​
ID​
id of a SavedAddress in the Business Unit's or the Associate's address book to bill to. If omitted, the billing address on the Cart is used, or the shipping address when the Cart has none. An id that matches no saved address is refused with ADDRESS_NOT_FOUND.
shippingMethodId​
ID​
id of the Shipping Method to set on the Cart before the Order is created. If omitted or blank, the Cart keeps the Shipping Method it already has, if any. An unusable Shipping Method is refused with UNKNOWN_SHIPPING_METHOD.
An Order placed without a Shipping Method has no totals.shipping and its total covers the lines only. A Shipping Method cannot be added to the Order afterward.
payment​

Payment for the Order. If omitted, the Order is placed with no payment attached.

Payment Input

Payment method to attach to the Order at checkout.

methodKey​
String​
key of the payment method, as returned by paymentMethods. An unknown key is refused with UNKNOWN_PAYMENT_METHOD.

Request Return Input

Return request for one Order.

orderId​
ID​
id of the Order to return items from.
lines​
Array of ReturnLineInput​

Order lines and quantities to return.

Return Line Input

Units of one Order line to return.

lineId​
ID​
id of the OrderLine to return. A custom line, or an id that isn't on the Order, is refused with LINE_NOT_FOUND.
quantity​
Int​
Number of units to return. Must be at least 1 and no more than the units still returnable on the line. Otherwise refused with INVALID_QUANTITY or RETURN_NOT_ALLOWED.
comment​
String​

Comment from the shopper about this item, stored on the return.