younifyd
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

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the checkout_createCheckout action (under Create).
  3. 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.

graphql
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.

inputobjectrequired

Create checkout input object

lineItemsarray<object>5 fields
giftCertificatesarray<object>7 fields
currencyCodestring
localestring
shippingConsignmentsarray<object>3 fields
billingAddressobject14 fields
couponsarray<string>
externalSourcestring
json
{
  "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}}.

checkoutobject
idstring
entityIdstring
currencyCodestring
displayCurrencyCodestring
billingAddressobject14 fields
cartobject20 fields
shippingConsignmentsarray<object>
shippingCostTotalobject4 fields
shippingCostTotalInDisplayCurrencyobject4 fields
shippingCostBeforeDiscountobject4 fields
shippingCostBeforeDiscountInDisplayCurrencyobject4 fields
comparisonShippingCostobject4 fields
comparisonShippingCostInDisplayCurrencyobject4 fields
giftWrappingCostTotalobject4 fields
giftWrappingCostTotalInDisplayCurrencyobject4 fields
handlingCostTotalobject4 fields
handlingCostTotalInDisplayCurrencyobject4 fields
taxTotalobject4 fields
taxTotalInDisplayCurrencyobject4 fields
taxesarray<object>
subtotalobject4 fields
subtotalInDisplayCurrencyobject4 fields
grandTotalobject4 fields
grandTotalInDisplayCurrencyobject4 fields
createdAtobject1 fields
updatedAtobject1 fields
customerMessagestring
outstandingBalanceobject4 fields
outstandingBalanceInDisplayCurrencyobject4 fields
couponsarray<object>
giftCertificatesarray<object>
promotionsarray<object>
feesarray<object>
versionnumber
totalDiscountobject4 fields
totalDiscountInDisplayCurrencyobject4 fields
displayDiscountTotalobject4 fields
displayDiscountTotalInDisplayCurrencyobject4 fields
orderBasedAutoDiscountTotalobject4 fields
orderBasedAutoDiscountTotalInDisplayCurrencyobject4 fields
errorsarray<object>
codeobject
contextobject
messageobject

Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.