Checkout
Use the checkout mutation to convert carts to an unpaid order. You can also capture billing and shipping addresses, as well as customer email and notes.
Mutation
checkout(input: CheckoutInput!): Order!
CheckoutInput
| Argument | Type | Description |
|---|
cartId | ID! | The id of the cart you are checking out |
email | String | Set the email associated with the order |
notes | String | Let customer save notes for the order |
shipping | AddressInput! | The customer shipping address |
billing | AddressInput | The customer billing address |
AddressInput
| Field | Type | Description |
|---|
company | String | A company name, if applicable |
name | String! | The recipient name |
line1 | String! | The address line 1 |
line2 | String | The address line 2 |
city | String! | The address city |
state | String | The address state |
postalCode | String! | The address post or zip code |
country | String! | The address country |
Example
mutation {
checkout(
input: {
cartId: "ck5r8d5b500003f5o2aif0v2b"
email: "[email protected]"
shipping: {
name: "Jamie Barton"
line1: "123 Cart Lane"
city: "Newcastle upon Tyne"
postalCode: "NE14 CQL"
country: "England"
}
}
) {
id
email
grandTotal {
formatted
}
}
}