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

ArgumentTypeDescription
cartIdID!The id of the cart you are checking out
emailStringSet the email associated with the order
notesStringLet customer save notes for the order
shippingAddressInput!The customer shipping address
billingAddressInputThe customer billing address

AddressInput

FieldTypeDescription
companyStringA company name, if applicable
nameString!The recipient name
line1String!The address line 1
line2StringThe address line 2
cityString!The address city
stateStringThe address state
postalCodeString!The address post or zip code
countryString!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
    }
  }
}