Menu
createMyCart
Create a new cart for the signed-in customer.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the createMyCart action (under Create).
- Fill in the fields below, then reference the result from later steps as
{{createmycart.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 CreateMyCart($draft: MyCartDraft!, $storeKey: KeyReferenceInput) {
createMyCart(draft: $draft, storeKey: $storeKey) {
customerId
customer {
id
customerNumber
email
addresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultShippingAddressId
defaultBillingAddressId
shippingAddressIds
billingAddressIds
isEmailVerified
customerGroupRef {
typeId
id
}
externalId
key
authenticationMode
firstName
lastName
middleName
title
locale
salutation
dateOfBirth
companyName
vatId
password
customerGroup {
id
version
name
key
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
defaultShippingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultBillingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
shippingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
billingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
storesRef {
typeId
key
}
stores {
id
version
key
nameAllLocales
languages
countries
productSelections
distributionChannelsRef
distributionChannels
supplyChannelsRef
supplyChannels
storefront
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
customerGroupAssignments {
customerGroupRef
customerGroup
}
custom {
typeRef
type
}
version
createdAt
lastModifiedAt
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
}
customerEmail
anonymousId
customLineItems {
id
key
nameAllLocales {
locale
value
}
money {
type
currencyCode
centAmount
fractionDigits
}
totalPrice {
type
currencyCode
centAmount
fractionDigits
}
slug
quantity
state {
quantity
stateRef
state
}
taxCategory {
name
description
rates
key
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
taxCategoryRef {
typeId
id
}
taxRate {
name
amount
includedInPrice
country
state
id
key
subRates
}
taxedPrice {
totalNet
totalGross
taxPortions
totalTax
}
taxedPricePortions {
shippingMethodKey
taxedPrice
}
perMethodTaxRate {
shippingMethodKey
taxRate
}
discountedPricePerQuantity {
quantity
discountedPrice
}
custom {
typeRef
type
}
shippingDetails {
targets
valid
}
priceMode
recurrenceInfo {
recurrencePolicy
recurrencePolicyRef
expiresAt
}
}
totalPrice {
type
currencyCode
centAmount
fractionDigits
}
taxedPrice {
totalNet {
type
currencyCode
centAmount
fractionDigits
}
totalGross {
type
currencyCode
centAmount
fractionDigits
}
taxPortions {
rate
amount
name
}
totalTax {
type
currencyCode
centAmount
fractionDigits
}
}
discountOnTotalPrice {
discountedAmount {
type
currencyCode
centAmount
fractionDigits
}
includedDiscounts {
discount
discountRef
discountedAmount
}
discountedNetAmount {
type
currencyCode
centAmount
fractionDigits
}
discountedGrossAmount {
type
currencyCode
centAmount
fractionDigits
}
}
shippingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom {
typeRef
type
}
}
billingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom {
typeRef
type
}
}
inventoryMode
taxMode
priceRoundingMode
taxRoundingMode
taxCalculationMode
customerGroup {
id
version
name
key
createdAt
lastModifiedAt
custom {
typeRef
type
}
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
}
customerGroupRef {
typeId
id
}
country
shippingKey
shippingInfo {
shippingMethodName
price {
type
currencyCode
centAmount
fractionDigits
}
shippingRate {
price
freeAbove
isMatching
tiers
}
taxRate {
name
amount
includedInPrice
country
state
id
key
subRates
}
deliveries {
id
key
createdAt
items
parcels
address
custom
}
discountedPrice {
value
includedDiscounts
}
shippingMethodState
estimatedDelivery {
from
until
}
shippingMethod {
name
zoneRates
active
isDefault
predicate
key
carrier
taxCategoryRef
localizedDescriptionAllLocales
localizedNameAllLocales
storesRef
stores
taxCategory
custom
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
shippingMethodRef {
typeId
id
}
taxCategory {
name
description
rates
key
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
taxCategoryRef {
typeId
id
}
taxedPrice {
totalNet
totalGross
taxPortions
totalTax
}
}
discountCodes {
discountCodeRef {
typeId
id
}
state
discountCode {
code
key
isActive
maxApplications
maxApplicationsPerCustomer
cartPredicate
applicationVersion
groups
cartDiscounts
validFrom
validUntil
referenceRefs
nameAllLocales
descriptionAllLocales
custom
applicationCount
storesRef
stores
cartDiscountRefs
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
}
directDiscounts {
id
value {
type
}
target {
type
}
}
refusedGifts {
cartPredicate
stackingMode
isActive
requiresDiscountCode
key
discountGroupRef {
typeId
id
}
nameAllLocales {
locale
value
}
descriptionAllLocales {
locale
value
}
referenceRefs {
typeId
id
}
custom {
typeRef
type
}
validFrom
validUntil
storesRef {
typeId
key
}
stores {
id
version
key
nameAllLocales
languages
countries
productSelections
distributionChannelsRef
distributionChannels
supplyChannelsRef
supplyChannels
storefront
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
discountGroup {
id
version
key
sortOrder
isActive
nameAllLocales
descriptionAllLocales
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
value {
type
}
target {
type
}
sortOrder
recurringOrderScope {
type
}
id
version
createdAt
lastModifiedAt
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
}
refusedGiftsRefs {
typeId
id
}
paymentInfo {
payments {
key
customerRef
customer
anonymousId
interfaceId
amountPlanned
paymentMethodInfo
paymentStatus
transactions
custom
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
paymentRefs {
typeId
id
}
}
locale
shippingRateInput {
type
}
origin
storeRef {
typeId
key
}
store {
id
version
key
nameAllLocales {
locale
value
}
languages
countries {
code
}
productSelections {
productSelectionRef
productSelection
active
}
distributionChannelsRef {
typeId
id
}
distributionChannels {
id
version
key
roles
nameAllLocales
descriptionAllLocales
address
geoLocation
createdAt
lastModifiedAt
reviewRatingStatistics
custom
createdBy
lastModifiedBy
}
supplyChannelsRef {
typeId
id
}
supplyChannels {
id
version
key
roles
nameAllLocales
descriptionAllLocales
address
geoLocation
createdAt
lastModifiedAt
reviewRatingStatistics
custom
createdBy
lastModifiedBy
}
storefront {
checkoutUrlTemplate
orderUrlTemplate
termsOfServiceUrl
privacyPolicyUrl
refundPolicyUrl
shippingPolicyUrl
cookiePolicyUrl
imprintUrl
faqUrl
contactUrl
}
createdAt
lastModifiedAt
custom {
typeRef
type
}
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
}
itemShippingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom {
typeRef
type
}
}
businessUnit {
id
key
name
contactEmail
addresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultShippingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultBillingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultShippingAddressId
defaultBillingAddressId
shippingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
billingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
shippingAddressIds
billingAddressIds
status
storesRef {
typeId
key
}
stores {
id
version
key
nameAllLocales
languages
countries
productSelections
distributionChannelsRef
distributionChannels
supplyChannelsRef
supplyChannels
storefront
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
storeMode
unitType
associates {
associateRoleAssignments
customerRef
customer
}
associateMode
inheritedAssociates {
associateRoleAssignments
customerRef
customer
}
custom {
typeRef
type
}
parentUnitRef {
typeId
key
}
parentUnit
ancestors
inheritedStores {
store
storeRef
}
topLevelUnitRef {
typeId
key
}
topLevelUnit
approvalRuleMode
customerGroupAssignments {
customerGroupRef
customerGroup
}
version
createdAt
lastModifiedAt
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
}
businessUnitRef {
typeId
key
}
shipping {
shippingKey
shippingInfo {
shippingMethodName
price
shippingRate
taxRate
deliveries
discountedPrice
shippingMethodState
estimatedDelivery
shippingMethod
shippingMethodRef
taxCategory
taxCategoryRef
taxedPrice
}
shippingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
shippingRateInput {
type
}
shippingCustomFields {
typeRef
type
}
}
taxedShippingPrice {
totalNet {
type
currencyCode
centAmount
fractionDigits
}
totalGross {
type
currencyCode
centAmount
fractionDigits
}
taxPortions {
rate
amount
name
}
totalTax {
type
currencyCode
centAmount
fractionDigits
}
}
shippingMode
shippingCustomFields {
typeRef {
typeId
id
}
type {
key
nameAllLocales
descriptionAllLocales
resourceTypeIds
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
}
placement
discountTypeCombination {
type
}
cartState
key
purchaseOrderNumber
lock {
createdAt
clientId
}
custom {
typeRef {
typeId
id
}
type {
key
nameAllLocales
descriptionAllLocales
resourceTypeIds
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
}
deleteDaysAfterLastModification
totalLineItemQuantity
recurringPaymentConfiguration {
paymentStrategy
paymentAllocations {
id
paymentMethodRef
paymentMethod
allocation
}
}
freezeStrategy
warnings {
code
message
}
id
version
createdAt
lastModifiedAt
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef {
typeId
id
}
userRef {
typeId
id
}
associateRef {
typeId
id
}
attributedTo {
clientId
source
userRef
}
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef {
typeId
id
}
userRef {
typeId
id
}
associateRef {
typeId
id
}
attributedTo {
clientId
source
userRef
}
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"draft": {
"currency": "string",
"country": "string",
"inventoryMode": "None",
"custom": {
"typeId": "string",
"typeKey": "string",
"type": {
"typeId": "string",
"id": "string",
"key": "string"
},
"fields": [
"string"
]
},
"customerEmail": "string",
"shippingAddress": {
"country": "string",
"id": "string",
"title": "string",
"salutation": "string",
"firstName": "string",
"lastName": "string",
"streetName": "string",
"streetNumber": "string",
"additionalStreetInfo": "string",
"postalCode": "string",
"city": "string",
"region": "string"
},
"billingAddress": {
"country": "string",
"id": "string",
"title": "string",
"salutation": "string",
"firstName": "string",
"lastName": "string",
"streetName": "string",
"streetNumber": "string",
"additionalStreetInfo": "string",
"postalCode": "string",
"city": "string",
"region": "string"
},
"shippingMethod": {
"typeId": "string",
"id": "string",
"key": "string"
},
"taxMode": "Disabled",
"locale": "string",
"deleteDaysAfterLastModification": 0,
"itemShippingAddresses": [
{
"country": "string",
"id": "string",
"title": "string",
"salutation": "string",
"firstName": "string",
"lastName": "string",
"streetName": "string",
"streetNumber": "string",
"additionalStreetInfo": "string",
"postalCode": "string",
"city": "string",
"region": "string"
}
]
},
"storeKey": "string"
}
Response
Read the result with {{createmycart.response.data.data.createMyCart}}. If the API returns errors, the step fails and they are at {{createmycart.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?