Skip to content

Checkout types

The types the checkout domain defines, with the fields other domains add to them.

Objects

OrderCancelResponse

Response for closing an unpaid order

FieldTypeDescription
orderOrderThe order, now cancelled
orderErrors[OrderCancelError!]Error details if the order could not be closed

OrderError

Implements Error

Error that occurred placing, reopening or closing an order

FieldTypeDescription
codeOrderErrorCodeType!Error code identifying the type of error
messageString!Human readable message describing the failure. Not intended for end users.

OrderPlaceResponse

Fields added by Order approval

Response for placing an order

FieldTypeDescription
orderOrderThe order that now exists
payableBoolean!Whether a payment may be started for this order right now. Answered by the same rule the payment itself applies, so a true here is not contradicted by the next call.
orderErrors[OrderPlaceError!]Error details if the order could not be placed
approvalOrderApprovalWhy an order that was just placed cannot be paid yet, when an approval flow is the reason. Read authoritatively rather than through the caller, so it is present even for someone who may not query the flow off the order itself. Absent where the order needed no approval, or where it did and has been decided.

OrderReviseResponse

Response for reopening an unpaid order

FieldTypeDescription
cartCartA new cart holding the same contents as the order that was closed
orderErrors[OrderReviseError!]Error details if the order could not be reopened

QuoteNotOrderableError

B2B onlyImplements Error

The quote cannot be turned into an order. Only a PENDING quote inside its validity window is orderable, so the blocking status is the whole story and a storefront can hide the affordance rather than offer an action that will fail.

FieldTypeDescription
messageB2BString!Developer/debug description of the failure. Not localized and never shown to end users.
statusB2BQuoteStatusType!The status the quote is in, which is what blocks the order

Enums

OrderErrorCodeType

Error codes for placing, reopening and closing an order

TARGET_NOT_FOUNDThe cart or order does not exist, or the caller may not reach it
ORDER_CREATION_FAILEDFailed to create the order
ORDER_ALREADY_PAIDThe order is already paid for, so there is nothing left to reopen or close
ORDER_NOT_REVISABLEThe order cannot be reopened. Reopening is for an order whose payment is still open or has failed; anything else is not the buyer's to edit.
ORDER_NOT_CANCELLABLEThe order cannot be closed. Closing waits for the provider's final word, so a payment still in flight is refused rather than abandoned.
BELOW_MINIMUM_ORDER_VALUEThe cart is below its business unit's minimum order value: see Cart.minimumOrder. A quote is not held to it.

OrderPlaceSubjectType

What is being turned into an order

QUOTEA quote the merchant issued, turned into an order
CARTThe buyer's cart, identified by its id

Unions

OrderCancelError

One of OrderError or ValidationError.

OrderPlaceError

One of OrderError, ValidationError or QuoteNotOrderableError.

OrderReviseError

One of OrderError or ValidationError.