Returns a Checkout
object by cart ID. This query can be used to retrieve information about the checkout status for an already submitted cart as well as order details for all orders associated with the checkout
When called for a not submitted cart, Checkout.status will always be
PENDING
. After cart submission Checkout.status will change according to the current checkout state.
Sometimes, when using the checkoutByCartID query, the returned status may be ACTION_REQUIRED
. In this case, you should check the "requiredActions" field for each order with this status and perform the necessary actions. Currently, there is only one required action: CompletePaymentChallenge
, also known as 3D-S Challenge.
3D-S (3D-Secure) is a security protocol designed to provide an additional layer of authentication for online credit and debit card transactions. When a customer attempts to make a payment, they are redirected to their bank's website, where they are asked to enter a unique password to confirm their identity. This helps prevent fraud and unauthorized purchases.
If 3D-S challenge completion is required, you should display the redirectURL
to the end buyer. Once the end buyer completes the challenge, Rye will continue with order processing.
Arguments
cartID
: ID!
The ID of the Cart
Returns
Any requested field from the Checkout
object.
Examples
{
"cartID": "{{cartId}}"
}
query Checkout($cartID: ID!){
checkoutByCartID(cartID: $cartID) {
status
orders {
id
status
events {
__typename
id
createdAt
... on OrderFailedOrderEvent { reason }
}
requiredActions {
... on CompletePaymentChallenge {
redirectURL
}
}
}
cart {
id
stores {
... on AmazonStore {
store
requestId
cartLines {
product {
id
}
quantity
}
offer {
shippingMethods {
id
total {
displayValue
}
}
}
errors {
message
}
isSubmitted
}
... on ShopifyStore {
store
requestId
cartLines {
variant {
id
}
quantity
}
offer {
shippingMethods {
id
total {
displayValue
}
}
}
errors {
message
}
isSubmitted
}
}
buyerIdentity {
firstName
lastName
}
}
}
}
{
"data": {
"checkoutByCartID": {
"status": "PENDING",
"orders": [
{
"id": "cf3edbe2-a4fb-48d8-a4bb-5a7f39929efa",
"status": "PENDING",
"events": [],
"requiredActions": []
},
{
"id": "e442d899-0812-48e7-b6d9-c659f3b034de",
"status": "PENDING",
"events": [],
"requiredActions": []
}
],
"cart": {
"id": "teWvPufPy8c2AcfkfBo9",
"stores": [
{
"store": "test.myshopify.com",
"requestId": "cf3edbe2-a4fb-48d8-a4bb-5a7f39929efa",
"cartLines": [
{
"variant": {
"id": "44454219743530"
},
"quantity": 1
}
],
"offer": {
"shippingMethods": [
{
"id": "79da7f8d68e18f7616e6841112693fce",
"total": {
"displayValue": "$12.39"
}
},
{
"id": "ee768830e386b87e4f230f4292c237a3",
"total": {
"displayValue": "$14.39"
}
}
]
},
"errors": [],
"isSubmitted": false
},
{
"store": "amazon",
"requestId": "e442d899-0812-48e7-b6d9-c659f3b034de",
"cartLines": [
{
"product": {
"id": "B00A2KD8NY"
},
"quantity": 1
}
],
"offer": {
"shippingMethods": [
{
"id": "3.99-Default shipping method",
"total": {
"displayValue": "$11.94"
}
}
]
},
"errors": [],
"isSubmitted": false
}
],
"buyerIdentity": {
"firstName": "John",
"lastName": "Doe"
}
}
}
}
}
Errors
If the cart is not found then a corresponding error is returned
{
"errors": [
{
"message": "Cart not found: someInvalidCartId",
"path": [
"getCart"
]
}
],
"data": null
}