submitCart
submits an existing cart for checkout.
Normally the developers should not call this mutation directly because the cart submission is handled via the rye-pay script (available here). The mutation can be used only if developers are going to manage to receive the Spreedly payment method token by themselves.
Find more information about the rye-pay script here.
Requirements
To use this query, please ensure that the x-rye-shopper-ip
is set in your HTTP headers. For more information about the x-rye-shopper-ip
header, view this section.
Arguments
input
: CartSubmitInput!
The input
object contains the unique identifier (ID) for the cart, a tokenized credit card value, and the billing address information of the buyer.
Returns
SubmitCartResult.*
: SubmitCartResult
Any requested field from the SubmitCartResult
object.
Examples
{
"input": {
"id": "{{cartId}}",
"token": "{{paymentTokne}}",
"selectedShippingOptions": [
{
"store": "{{store}}",
"shippingId": "{{shippingId}}"
}
],
"billingAddress": {
"firstName": "{{firstName}}",
"lastName": "{{lastName}}",
"phone": "{{phone}}",
"address1": "{{address1}}",
"address2": "{{address2}}",
"city": "{{city}}",
"provinceCode": "{{provinceCode}}",
"countryCode": "US",
"postalCode": "{{postalCode}}"
}
}
}
mutation ($input: CartSubmitInput!) {
submitCart(input: $input) {
id,
stores {
status,
requestId
store {
... on AmazonStore {
store
cartLines {
quantity,
product {
id
}
}
}
... on ShopifyStore {
store
cartLines {
quantity,
variant {
id
}
}
}
}
}
}
}