Checkout

Checkout mutation

You can use the checkout mutation to create an order.

mutation {
checkout(
email: "hello@example.com",
token: "tok_visa",
currency: GBP,
items: [{
description: "T-Shirt",
amount: 1250,
quantity: 1,
metadata: {
size: "Large",
colour: "Red"
}
}],
metadata: {
shipping_address: {
line_1: "123 Commerce Road",
country: "United Kingdom"
}
}
) {
id
email
total
currency
payments {
id
status
}
items {
id
description
amount
}
metadata
createdAt
}
}

Input arguments

The objects below are all of the available input types for Order and Order Items.

Order object

The most important thing to note is that if you provide a token, the payment will be processed via Stripe and added to the order. If you don't provide a token, you can use the Pay mutation to apply a payment later.

Name

Type

Required

Description

email

String

Yes

The email for the order

token

String

No

The Stripe token

currency

Enum

Yes

GBP, USD or EUR

items

Array[Object]

Yes

An array of item objects

metadata

JSON

No

A JSON object of additional data

Order Item object

An order must contain items to successfully be converted to an order.

Name

Type

Required

Description

description

String

Yes

A description of the item

amount

Int

No

The item amount (E.g. 5000 cents). Default: 0

quantity

Int

No

The quantity of this item

metadata

JSON

No

A JSON object of additional data

Response object