Menu
checkout_createCheckout
Create a checkout from line items, optionally with shipping consignments, billing address and coupons; returns the checkout and its ID.
Use it in a workflow
- Add a step and choose the BigCommerce Storefront connector.
- Pick the checkout_createCheckout action (under Create).
- Fill in the fields below, then reference the result from later steps as
{{checkoutCreatecheckout.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation CheckoutCreateCheckout($input: CreateCheckoutInput!) {
checkout {
createCheckout(input: $input) {
checkout {
id
entityId
currencyCode
displayCurrencyCode
billingAddress {
entityId
firstName
lastName
email
company
address1
address2
city
stateOrProvince
stateOrProvinceCode
countryCode
postalCode
phone
}
cart {
id
entityId
currencyCode
displayCurrencyCode
isTaxIncluded
locale
version
externalSource
source
companyId
}
shippingConsignments {
entityId
lineItemIds
}
shippingCostTotal {
currencyCode
value
formatted
formattedV2
}
shippingCostTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
shippingCostBeforeDiscount {
currencyCode
value
formatted
formattedV2
}
shippingCostBeforeDiscountInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
comparisonShippingCost {
currencyCode
value
formatted
formattedV2
}
comparisonShippingCostInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
giftWrappingCostTotal {
currencyCode
value
formatted
formattedV2
}
giftWrappingCostTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
handlingCostTotal {
currencyCode
value
formatted
formattedV2
}
handlingCostTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
taxTotal {
currencyCode
value
formatted
formattedV2
}
taxTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
taxes {
name
}
subtotal {
currencyCode
value
formatted
formattedV2
}
subtotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
grandTotal {
currencyCode
value
formatted
formattedV2
}
grandTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
createdAt {
utc
}
updatedAt {
utc
}
customerMessage
outstandingBalance {
currencyCode
value
formatted
formattedV2
}
outstandingBalanceInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
coupons {
entityId
promotionEntityId
code
couponType
displayName
status
hasMaxLimitReached
}
giftCertificates {
entityId
code
}
promotions {
entityId
displayName
priority
}
fees {
id
feeType
name
displayName
source
taxClassId
}
version
totalDiscount {
currencyCode
value
formatted
formattedV2
}
totalDiscountInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
displayDiscountTotal {
currencyCode
value
formatted
formattedV2
}
displayDiscountTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
orderBasedAutoDiscountTotal {
currencyCode
value
formatted
formattedV2
}
orderBasedAutoDiscountTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
manualDiscountTotal {
currencyCode
value
formatted
formattedV2
}
manualDiscountTotalInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
order {
id
entityId
isTaxIncluded
customerMessage
totalProductQuantity
backorderShippingExpectationMessage
permalink
poNumber
reference
}
}
errors {
__typename
... on CartError {
message
}
... on CartLineItemError {
message
}
... on CheckoutShippingConsignmentError {
message
}
... on CheckoutCouponError {
message
}
... on CheckoutTaxError {
message
}
}
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"input": {
"lineItems": [
{
"quantity": "string",
"productEntityId": "string",
"variantEntityId": "string",
"sku": "string",
"selectedOptions": "string"
}
],
"giftCertificates": [
{
"name": "string",
"theme": "string",
"amount": "string",
"quantity": "string",
"sender": "string",
"recipient": "string",
"message": "string"
}
],
"currencyCode": "string",
"locale": "string",
"shippingConsignments": [
{
"address": "string",
"selectRecommendedOption": "string",
"shippingOptionSelectionStrategy": "string"
}
],
"billingAddress": {
"countryCode": "string",
"shouldSaveAddress": false,
"firstName": "string",
"lastName": "string",
"email": "string",
"company": "string",
"address1": "string",
"address2": "string",
"city": "string",
"stateOrProvince": "string",
"stateOrProvinceCode": "string",
"postalCode": "string"
},
"coupons": [
"string"
],
"externalSource": "string"
}
}
Response
Read the result with {{checkoutCreatecheckout.response.data.data.createCheckout}}. If the API returns errors, the step fails and they are at {{checkoutCreatecheckout.response.data.errors}}.
Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?