extendCartExpiration
Pushes a cart's expiration time (Cart.expires) further into the future.
Carts are only held for a limited time. Once Cart.expires has passed, the cart can no longer be changed
or used to place an order. Call this mutation while the cart is still active to give the customer more
time. The new expiration is a fixed span measured from the moment of the call, not an increment added on
top of the current value, so calling it twice in quick succession does not stack.
An expired cart cannot be revived. Calling this mutation for one fails with an error and leaves the cart
untouched; the customer has to start a new cart. Since Query.cart resolves expired carts too, you can
detect this case up front by comparing Cart.expires against the current time. An unknown cart ID also
fails with an error.
Read ExtendCartExpirationResult.cart to get the cart with its new Cart.expires value.
mutation KeepCartAlive($cartId: ID!) { extendCartExpiration(cartId: $cartId) { cart { id expires } } }mutation KeepCartAlive($cartId: ID!) { extendCartExpiration(cartId: $cartId) { cart { id expires } } }
Arguments
| Argument | Description | Type |
|---|---|---|
| cartId | ID! |
Type
This field resolves to ExtendCartExpirationResult!.