Custom Line Items and custom Tax Rates cannot be set via this API.
Representations
MyCartDraft
customerId is determined by a password flow token and
automatically set on the resulting Cart.
The anonymousId is determined by a token for an anonymous session and
automatically set on the resulting Cart.currency​CurrencyCode​ | Currency the Cart uses. Pattern:Â^[A-Z]{3}$​ |
customerEmail​String​ | Email address of the Customer the Cart belongs to. |
businessUnit​ | ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit. Only available for B2B-enabled Projects. |
store​ | ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated. |
lineItems​Array of MyLineItemDraft​ | Line Items to add to the Cart. |
taxMode​TaxMode​ | Determines how Tax Rates are set. The Default: Disabled TaxMode cannot be set.Platform​ |
inventoryMode​ | Determines how stock quantities are tracked for Line Items in the Cart. Default:ÂNone​ |
billingAddress​BaseAddress​ | Billing address associated with the Cart. |
shippingAddress​BaseAddress​ | Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items. |
shippingMethod​ | Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart. |
itemShippingAddresses​Array of BaseAddress​ | Multiple shipping addresses of the Cart. Each address must contain a
key that is unique in this Cart.
The keys are used by LineItems to reference these addresses under their shippingDetails.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses. |
shippingMode​ShippingMode​ |
Single​ |
discountCodes​Array of String​ | code of the existing DiscountCodes to add to the Cart. |
country​CountryCode​ | Used for Line Item price selection.
If used for Create Cart in Store, the provided country must be one of the Store's Pattern: countries.^[A-Z]{2}$​ |
locale​Locale​ | Language of the Cart. Must be one of the languages supported by the Project. |
deleteDaysAfterLastModification​Int​ | Number of days after the last modification before a Cart is deleted.
If not provided, the default value for this field configured in Project settings is assigned.
Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart. Minimum: 1​Maximum: 365250​ |
custom​ | Custom Fields for the Cart. |
MyLineItemDraft
productId and variantId, or sku must be provided.key​String​ | User-defined unique identifier of the LineItem. MinLength:Â2​MaxLength: 256​Pattern: ^[a-zA-Z0-9_-]​ |
productId​String​ | id of the Product. |
variantId​Int​ | id of the ProductVariant in the Product.
If not provided, the Master Variant is used. |
sku​String​ | sku of the ProductVariant. |
quantity​Int​ | Number of Product Variants to add to the Cart. Default:Â1​ |
addedAt​DateTime​ | Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time. Optional for backwards compatibility reasons. |
supplyChannel​ | Used to identify Inventory entries that must be reserved.
The Channel must have the InventorySupply ChannelRoleEnum. |
distributionChannel​ | If the Cart is bound to a Store with distributionChannels set,
the Channel must match one of the Store's distribution channels. |
shippingDetails​ | Container for Line Item-specific addresses. |
recurrenceInfo​ | Recurring Order and frequency data. |
custom​ | Custom Fields for the Cart. |
ReplicaMyCartDraft
reference​Can be CartReference, or OrderReference​ |
Get My Cart
Get My Cart by ID
id. Returns a 200 status if successful.- If no Cart exists with the provided
id. - If the Cart exists but does not have a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
idString ​ | id of the Cart. |
expand | The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/me/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Get My active Cart
200 status if successful.- If no active Cart exists.
- If an active Cart exists but does not have a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
expand | The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/me/active-cart -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Get My Cart in Store
Get My Cart in Store by ID
id in a Store. Returns a 200 status if the Cart exists.- If no Cart exists in the Store for the given
id. - If the Cart exists but does not belong to a Store, or the Cart's
storefield references a different Store. - If the Cart exists but does not have either a
customerIdthat matches the customer:{id} scope, or ananonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
idString ​ | id of the Cart. |
expand | The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Get My active Cart in Store
200 status if successful.- If no active Cart exists.
- If an active Cart exists but does not have a
storespecified, or thestorefield references a different Store. - If an active Cart exists but does not have a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
expand | The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/active-cart -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Query My Carts
Retrieves Carts for the authenticated Customer or anonymous user.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limitInt ​ | Number of results requested. Default: 20​Minimum: 0​Maximum: 500​ |
offsetInt ​ | Number of elements skipped. Default: 0​Maximum: 10000​ |
withTotalBoolean ​ | Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.Default: true​ |
var.<varName>String ​ | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/me/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"limit": 20,
"offset": 0,
"count": 2,
"total": 2,
"results": [
{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"lineItems": [
{
"id": "b925a817-d5ad-48bb-a407-29ad8e0649b5",
"productId": "9f10dcfb-5cc9-4a18-843a-c07f7e22d01f",
"name": {
"en": "SAPPHIRE"
},
"productType": {
"typeId": "product-type",
"id": "2543e1d8-4915-4f72-a3c9-1df9b1b0082d",
"version": 8
},
"productSlug": {
"en": "sapphire1421832124423"
},
"variant": {
"id": 1,
"sku": "sku_SAPPHIRE_variant1_1421832124423",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
}
],
"images": [
{
"url": "https://www.commercetools.com/cli/data/252542005_1.jpg",
"dimensions": {
"w": 1400,
"h": 1400
}
}
],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
},
"quantity": 2,
"discountedPricePerQuantity": [],
"state": [
{
"quantity": 2,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": [],
"shipping": [],
"shippingMode": "Single"
},
{
"type": "Cart",
"id": "668e5783-73c8-4f2d-91f4-3c90b872c700",
"version": 3,
"createdAt": "2015-10-07T07:33:05.894Z",
"lastModifiedAt": "2015-10-07T07:33:06.070Z",
"lineItems": [
{
"id": "90dff06c-272e-47fa-b8de-923dce092474",
"productId": "7b1203f4-66c0-438c-9a30-f4fb6be79bdf",
"name": {
"de": "WB ATHLETIC PANZER",
"en": "WB ATHLETIC TANK"
},
"productType": {
"typeId": "product-type",
"id": "2543e1d8-4915-4f72-a3c9-1df9b1b0082d",
"version": 8
},
"productSlug": {
"en": "wb-athletic-tank1421832124574"
},
"variant": {
"id": 1,
"sku": "sku_WB_ATHLETIC_TANK_variant1_1421832124574",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"id": "37696f7c-8260-4941-a921-68e6aa76b4a3"
}
],
"images": [
{
"url": "https://www.commercetools.com/cli/data/253265444_1.jpg",
"dimensions": {
"w": 1400,
"h": 1400
}
}
],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"id": "37696f7c-8260-4941-a921-68e6aa76b4a3"
},
"quantity": 1,
"discountedPricePerQuantity": [],
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"custom": {
"type": {
"typeId": "type",
"id": "3ae9bcca-df23-443e-bd22-0c592f9694fa"
},
"fields": {
"offer_name": "SuperMax"
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"country": "DE",
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": [],
"shipping": [],
"shippingMode": "Single"
}
]
}Query My Carts in Store
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limitInt ​ | Number of results requested. Default: 20​Minimum: 0​Maximum: 500​ |
offsetInt ​ | Number of elements skipped. Default: 0​Maximum: 10000​ |
withTotalBoolean ​ | Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.Default: true​ |
var.<varName>String ​ | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"limit": 20,
"offset": 0,
"count": 2,
"total": 2,
"results": [
{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"lineItems": [
{
"id": "b925a817-d5ad-48bb-a407-29ad8e0649b5",
"productId": "9f10dcfb-5cc9-4a18-843a-c07f7e22d01f",
"name": {
"en": "SAPPHIRE"
},
"productType": {
"typeId": "product-type",
"id": "2543e1d8-4915-4f72-a3c9-1df9b1b0082d",
"version": 8
},
"productSlug": {
"en": "sapphire1421832124423"
},
"variant": {
"id": 1,
"sku": "sku_SAPPHIRE_variant1_1421832124423",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
}
],
"images": [
{
"url": "https://www.commercetools.com/cli/data/252542005_1.jpg",
"dimensions": {
"w": 1400,
"h": 1400
}
}
],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
},
"quantity": 2,
"discountedPricePerQuantity": [],
"state": [
{
"quantity": 2,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": [],
"shipping": [],
"shippingMode": "Single"
},
{
"type": "Cart",
"id": "668e5783-73c8-4f2d-91f4-3c90b872c700",
"version": 3,
"createdAt": "2015-10-07T07:33:05.894Z",
"lastModifiedAt": "2015-10-07T07:33:06.070Z",
"lineItems": [
{
"id": "90dff06c-272e-47fa-b8de-923dce092474",
"productId": "7b1203f4-66c0-438c-9a30-f4fb6be79bdf",
"name": {
"de": "WB ATHLETIC PANZER",
"en": "WB ATHLETIC TANK"
},
"productType": {
"typeId": "product-type",
"id": "2543e1d8-4915-4f72-a3c9-1df9b1b0082d",
"version": 8
},
"productSlug": {
"en": "wb-athletic-tank1421832124574"
},
"variant": {
"id": 1,
"sku": "sku_WB_ATHLETIC_TANK_variant1_1421832124574",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"id": "37696f7c-8260-4941-a921-68e6aa76b4a3"
}
],
"images": [
{
"url": "https://www.commercetools.com/cli/data/253265444_1.jpg",
"dimensions": {
"w": 1400,
"h": 1400
}
}
],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"id": "37696f7c-8260-4941-a921-68e6aa76b4a3"
},
"quantity": 1,
"discountedPricePerQuantity": [],
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"custom": {
"type": {
"typeId": "type",
"id": "3ae9bcca-df23-443e-bd22-0c592f9694fa"
},
"fields": {
"offer_name": "SuperMax"
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 8400
},
"country": "DE",
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": [],
"shipping": [],
"shippingMode": "Single"
}
]
}Check if My Cart exists
Check if My Cart exists by ID
id. Returns a 200 status if the Cart exists.- If no Cart exists with the provided
id. - If the Cart exists but does not have a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
idString ​ | id of the Cart. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if My active Cart exists
200 status if successful.- If no active Cart exists.
- If an active Cart exists but does not have a
customerIdthat matches the customer:{id} scope, or ananonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/active-cart -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"Check if My Cart exists by Query Predicate
customerId or anonymousId. Returns a 200 status if the Cart exists, or a ResourceNotFound error otherwise.manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/me/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if My Cart exists in Store
Check if My Cart exists in Store by ID
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
idString ​ | id of the Cart. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if My active Cart exists in Store
200 OK status if successful.- If no active Cart exists in a Store.
- If an active Cart exists but does not have a
storespecified, or thestorefield references a different Store. - If an active Cart exists but does not contain a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/active-cart -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"Check if My Cart exists in Store by Query Predicate
customerId or anonymousId. Returns a 200 status if any Carts match these conditions, or a 404 status otherwise.manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Create My Cart
CreateMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.customerId or anonymousId field on the Cart is automatically set based on the customer:{id} or anonymous_id:{id} scope.Specific Error Codes:
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
expand | The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl https://api.{region}.commercetools.com/{projectKey}/me/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"currency" : "EUR"
}
DATA{
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Create My Cart in Store
CreateMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.customerId or anonymousId field on the Cart is automatically set based on the customer:{id} or anonymous_id:{id} scope.Specific Error Codes:
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
expand | The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"currency" : "EUR"
}
DATA{
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Replicate My Cart
CreateMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.Creates a new Cart by replicating an existing Cart or Order of the authenticated Customer. This can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
Active CartState.initial.Specific Error Codes:
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
application/jsonapplication/jsonUpdate My Cart
UpdateMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.id. Returns a 200 status if successful.- If no Cart exists with the provided
id. - If the Cart exists but does not have a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
idString ​ | id of the Cart. |
expand | The parameter can be passed multiple times. |
application/jsonversion​Int​ | Expected version of the Cart on which the changes apply.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions​Array of MyCartUpdateAction​ | Update actions to be performed on the Cart. |
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/me/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "addLineItem",
"productId" : "9f10dcfb-5cc9-4a18-843a-c07f7e22d01f",
"variantId" : 1,
"quantity" : 1
} ]
}
DATA{
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Update My Cart in Store
UpdateMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.id in a Store. Returns a 200 status if successful.- If no Cart exists in the Store for the given
id. - If the Cart exists but does not belong to a Store, or the Cart's
storefield references a different Store. - If the Cart exists but does not have either a
customerIdthat matches the customer:{id} scope, or ananonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
idString ​ | id of the Cart. |
expand | The parameter can be passed multiple times. |
application/jsonversion​Int​ | Expected version of the Cart on which the changes apply.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions​Array of MyCartUpdateAction​ | Update actions to be performed on the Cart. |
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "addLineItem",
"productId" : "9f10dcfb-5cc9-4a18-843a-c07f7e22d01f",
"variantId" : 1,
"quantity" : 1
} ]
}
DATA{
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Update actions
on Cart
Set Customer Email
action​String​ | "setCustomerEmail" |
email​String​ | Value to set. If empty, any existing value is removed. |
Set Business Unit B2B
Updates the Business Unit on the Cart. The Cart must have an existing Business Unit assigned already.
action​String​ | "setBusinessUnit" |
businessUnit​ | New Business Unit to assign to the Cart, which must have access to the Store that is set on the Cart.
Additionally, the authenticated user must be an Associate in the Business Unit. |
Add LineItem
shippingDetails is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up.
The LineItem price is set as described in Line Item price selection.priceMode value for a selected currency and/or country, Customer Group, or Channel, a MatchingPriceNotFound error is returned.action​String​ | "addLineItem" |
key​String​ | User-defined unique identifier of the LineItem. MinLength:Â2​MaxLength: 256​Pattern: ^[a-zA-Z0-9_-]​ |
productId​String​ | id of the Product.Either the productId and variantId, or sku must be provided. |
variantId​Int​ | id of the ProductVariant in the Product.If not given, the Master Variant is used. Either the productId and variantId, or sku must be provided. |
sku​String​ | sku of the ProductVariant.Either the productId and variantId, or sku must be provided. |
quantity​Int​ | Number of Line Items to add to the Cart. Default:Â1​ |
addedAt​DateTime​ | Date and time (UTC) the Line Item was added to the Cart. If not set, it defaults to the current date and time. Optional for backwards compatibility reasons. |
distributionChannel​ | Used to select a Product Price.
The Channel must have the ProductDistribution ChannelRoleEnum.
If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels. |
supplyChannel​ | Used to identify Inventory entries that must be reserved.
The Channel must have the InventorySupply ChannelRoleEnum. |
shippingDetails​ | Container for Line Item-specific addresses. |
recurrenceInfo​ | Recurring Order and frequency data. |
custom​ | Custom Fields for the Line Item. |
{
"action": "addLineItem",
"productId": "{{product-id}}",
"variantId": 2,
"quantity": 1,
"supplyChannel": {
"typeId": "channel",
"id": "{{channel-id}}"
},
"distributionChannel": {
"typeId": "channel",
"id": "{{channel-id}}"
},
"shippingDetails": {
"targets": [
{
"addressKey": "AddressKeyStringFromAddress",
"quantity": 2
}
]
}
}Remove LineItem
action​String​ | "removeLineItem" |
lineItemId​String​ | |
lineItemKey​String​ | |
quantity​Int​ | Amount to subtract from the LineItem quantity. If omitted, the LineItem is removed from the Cart. Minimum:Â1​ |
externalPrice​Money​ | Sets the LineItem
price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.To set the money value in high precision, use HighPrecisionMoneyDraft. |
externalTotalPrice​ | Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode. |
shippingDetailsToRemove​ | Container for Line Item-specific addresses to remove. |
{
"action": "removeLineItem",
"lineItemId": "{{lineItemId}}",
"quantity": 1,
"externalPrice": {
"currencyCode": "EUR",
"centAmount": 4000
},
"shippingDetailsToRemove": {
"targets": [
{
"addressKey": "AddressKeyStringFromAddress",
"quantity": 2
}
]
}
}Add DiscountCode
DoesNotMatchCart when adding a Discount Code.action​String​ | "addDiscountCode" |
code​String​ | code of a DiscountCode. |
{
"action": "addDiscountCode",
"code": "mydiscountcode"
}Remove DiscountCode
action​String​ | "removeDiscountCode" |
discountCode​ | Discount Code to remove from the Cart. |
{
"action": "removeDiscountCode",
"discountCode": {
"typeId": "discount-code",
"id": "{{discount-code-id}}"
}
}Add Payment
action​String​ | "addPayment" |
payment​ | Payment to add to the Cart. Must not be assigned to another Order or active Cart already. |
{
"action": "addPayment",
"payment": {
"id": "{{payment-id}}",
"typeId": "payment"
}
}Remove Payment
action​String​ | "removePayment" |
payment​ | Payment to remove from the Cart. |
{
"action": "removePayment",
"payment": {
"id": "{{payment-id}}",
"typeId": "payment"
}
}Change TaxMode
- When
ExternalTaxMode is changed toPlatformorDisabled, all previously set external Tax Rates are removed. - When set to
Platform, Line Items, Custom Line Items, and Shipping Method require a Tax Category with a Tax Rate for the Cart'sshippingAddress.
action​String​ | "changeTaxMode" |
taxMode​TaxMode​ | The new TaxMode. |
{
"action": "changeTaxMode",
"taxMode": "Platform"
}Set Billing Address
action​String​ | "setBillingAddress" |
address​BaseAddress​ | Value to set. If empty, any existing value is removed. |
{
"action": "setBillingAddress",
"address": {
"key": "exampleKey",
"title": "My Address",
"salutation": "Mr.",
"firstName": "Example",
"lastName": "Person",
"streetName": "Example Street",
"streetNumber": "4711",
"additionalStreetInfo": "Backhouse",
"postalCode": "80933",
"city": "Exemplary City",
"region": "Exemplary Region",
"state": "Exemplary State",
"country": "DE",
"company": "My Company Name",
"department": "Sales",
"building": "Hightower 1",
"apartment": "247",
"pOBox": "2471",
"phone": "+49 89 12345678",
"mobile": "+49 171 2345678",
"email": "email@example.com",
"fax": "+49 89 12345679",
"additionalAddressInfo": "no additional Info",
"externalId": "Information not needed"
}
}Set Shipping Address
countryTaxRateFallbackEnabled field to true in the CartsConfiguration by using
the Change CountryTaxRateFallbackEnabled update action.action​String​ | "setShippingAddress" |
address​BaseAddress​ | Value to set.
If not set, the shipping address is unset, and the taxedPrice and taxRate are unset in all Line Items. |
{
"action": "setShippingAddress",
"address": {
"key": "exampleKey",
"title": "My Address",
"salutation": "Mr.",
"firstName": "Example",
"lastName": "Person",
"streetName": "Example Street",
"streetNumber": "4711",
"additionalStreetInfo": "Backhouse",
"postalCode": "80933",
"city": "Exemplary City",
"region": "Exemplary Region",
"state": "Exemplary State",
"country": "DE",
"company": "My Company Name",
"department": "Sales",
"building": "Hightower 1",
"apartment": "247",
"pOBox": "2471",
"phone": "+49 89 12345678",
"mobile": "+49 171 2345678",
"email": "email@example.com",
"fax": "+49 89 12345679",
"additionalAddressInfo": "no additional Info",
"externalId": "Information not needed"
}
}Add ItemShippingAddress
Adds an address to a Cart when shipping to multiple addresses is desired.
action​String​ | "addItemShippingAddress" |
address​BaseAddress​ | Address to append to
itemShippingAddresses.The new address must have a key that is unique across this Cart. |
{
"action": "addItemShippingAddress",
"address": {
"key": "exampleKey",
"title": "My Address",
"salutation": "Mr.",
"firstName": "Example",
"lastName": "Person",
"streetName": "Example Street",
"streetNumber": "4711",
"additionalStreetInfo": "Backhouse",
"postalCode": "80933",
"city": "Exemplary City",
"region": "Exemplary Region",
"state": "Exemplary State",
"country": "DE",
"company": "My Company Name",
"department": "Sales",
"building": "Hightower 1",
"apartment": "247",
"pOBox": "2471",
"phone": "+49 89 12345678",
"mobile": "+49 171 2345678",
"email": "email@example.com",
"fax": "+49 89 12345679",
"additionalAddressInfo": "no additional Info",
"externalId": "Information not needed"
}
}Remove ItemShippingAddress
action​String​ | "removeItemShippingAddress" |
addressKey​String​ | key of the Address to remove from itemShippingAddresses. |
{
"action": "removeItemShippingAddress",
"addressKey": "{{addressKey}}"
}Update ItemShippingAddress
itemShippingAddresses by keeping the Address key.action​String​ | "updateItemShippingAddress" |
address​BaseAddress​ | The new Address with the same key as the Address it will replace. |
{
"action": "updateItemShippingAddress",
"address": {
"key": "exampleKey",
"title": "My Address",
"salutation": "Mr.",
"firstName": "Example",
"lastName": "Person",
"streetName": "Example Street",
"streetNumber": "4711",
"additionalStreetInfo": "Backhouse",
"postalCode": "80933",
"city": "Exemplary City",
"region": "Exemplary Region",
"state": "Exemplary State",
"country": "DE",
"company": "My Company Name",
"department": "Sales",
"building": "Hightower 1",
"apartment": "247",
"pOBox": "2471",
"phone": "+49 89 12345678",
"mobile": "+49 171 2345678",
"email": "email@example.com",
"fax": "+49 89 12345679",
"additionalAddressInfo": "no additional Info",
"externalId": "Information not needed"
}
}Set ShippingMethod
action​String​ | "setShippingMethod" |
shippingMethod​ | Value to set. If empty, any existing value is removed. If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned. |
externalTaxRate​ | An external Tax Rate can be set if the Cart has the External TaxMode. |
{
"action": "setShippingMethod",
"shippingMethod": {
"id": "{{shipping-method-id}}",
"typeId": "shipping-method"
}
}Set Locale
Set Country
action​String​ | "setCountry" |
country​CountryCode​ | Value to set. If empty, any existing value is removed. If the Cart is bound to a Pattern: store, the provided value must be included in the Store's countries.
Otherwise a CountryNotConfiguredInStore error is returned.^[A-Z]{2}$​ |
{
"action": "setCountry",
"country": "DE"
}Set DeleteDaysAfterLastModification
Number of days after the last modification before a Cart is deleted.
action​String​ | "setDeleteDaysAfterLastModification" |
deleteDaysAfterLastModification​Int​ | Value to set.
If not provided, the default value for this field configured in Project settings is assigned. Minimum: 1​Maximum: 365250​ |
{
"action": "setDeleteDaysAfterLastModification",
"deleteDaysAfterLastModification": 90
}Set Custom Type
action​String​ | "setCustomType" |
type​ | Defines the Type that extends the Cart with Custom Fields.
If absent, any existing Type and Custom Fields are removed from the Cart. |
fields​ | Sets the Custom Fields fields for the Cart. |
{
"action": "setCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}Set CustomField
action​String​ | "setCustomField" |
name​String​ | Name of the Custom Field. |
value​ | If value is absent or null, this field will be removed if it exists.
Removing a field that does not exist returns an InvalidOperation error.
If value is provided, it is set for the field defined by name. |
{
"action": "setCustomField",
"name": "exampleStringField",
"value": "TextString"
}Recalculate
priceMode of the Product related to a Line Item is of Embedded ProductPriceMode,
the updated price of that LineItem may not correspond to a Price in the variant.prices anymore.action​String​ | "recalculate" |
updateProductData​Boolean​ |
false​ |
{
"action": "recalculate",
"updateProductData": true
}on LineItem
Change LineItem Quantity
shippingDetails field is kept in its current state to avoid data loss.ExternalTotal LineItemPriceMode,
it will be changed to ExternalPrice and the existing externalPrice value, i.e. LineItem.price, will be retained.
The LineItem total will be calculated by the system instead, so that the externalTotalPrice will be dropped.action​String​ | "changeLineItemQuantity" |
lineItemId​String​ | |
lineItemKey​String​ | |
quantity​Int​ | New value to set. If Minimum: 0, the Line Item is removed from the Cart.0​ |
{
"action": "changeLineItemQuantity",
"lineItemId": "{{lineItemId}}",
"quantity": 1
}Change LineItems Order
Set LineItem DistributionChannel
price as described in Line Item price selection.action​String​ | "setLineItemDistributionChannel" |
lineItemId​String​ | |
lineItemKey​String​ | |
distributionChannel​ |
|
{
"action": "setLineItemDistributionChannel",
"lineItemId": "{{lineItemId}}",
"distributionChannel": {
"typeId": "channel",
"id": "{{channel-id}}"
}
}Set LineItem SupplyChannel
TrackOnly or ReserveOnOrder.action​String​ | "setLineItemSupplyChannel" |
lineItemId​String​ | |
lineItemKey​String​ | |
supplyChannel​ |
|
{
"action": "setLineItemSupplyChannel",
"lineItemId": "{{lineItemId}}",
"supplyChannel": {
"typeId": "channel",
"id": "{{channel-id}}"
}
}Set LineItem ShippingDetails
action​String​ | "setLineItemShippingDetails" |
lineItemId​String​ | |
lineItemKey​String​ | |
shippingDetails​ | Value to set. If empty, the existing value is removed. |
{
"action": "setLineItemShippingDetails",
"lineItemId": "{{lineItemId}}",
"shippingDetails": {
"targets": [
{
"addressKey": "{{addressKey}}",
"quantity": 1
}
]
}
}Apply DeltaToLineItemShippingDetailsTargets
action​String​ | "applyDeltaToLineItemShippingDetailsTargets" |
lineItemId​String​ | |
lineItemKey​String​ | |
targetsDelta​Array of ItemShippingTarget​ | Using positive or negative quantities increases or decreases the number of items shipped to an address. |
{
"action": "applyDeltaToLineItemShippingDetailsTargets",
"lineItemId": "{{lineItemId}}",
"targetsDelta": [
{
"addressKey": "addressKeyString",
"quantity": 1
}
]
}Set LineItem Custom Type
action​String​ | "setLineItemCustomType" |
lineItemId​String​ | |
lineItemKey​String​ | |
type​ | Defines the Type that extends the LineItem with Custom Fields.
If absent, any existing Type and Custom Fields are removed from the Line Item. |
fields​ | Sets the Custom Fields fields for the Line Item. |
{
"action": "setLineItemCustomType",
"lineItemId": "{{lineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}Set LineItem CustomField
action​String​ | "setLineItemCustomField" |
lineItemId​String​ | |
lineItemKey​String​ | |
name​String​ | Name of the Custom Field. |
value​ | If value is absent or null, this field will be removed if it exists.
Removing a field that does not exist returns an InvalidOperation error.
If value is provided, it is set for the field defined by name. |
{
"action": "setLineItemCustomField",
"lineItemId": "{{lineItemId}}",
"name": "exampleStringField",
"value": "TextString"
}Set LineItemRecurrenceInfo
action​String​ | "setLineItemRecurrenceInfo" |
lineItemId​String​ | |
lineItemKey​String​ | |
recurrenceInfo​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setLineItemRecurrenceInfo",
"lineItemId": "{{lineItemId}}",
"recurrenceInfo": {
"recurrencePolicy": {
"id": "{{recurrence-policy-id}}",
"typeId": "recurrence-policy"
},
"priceSelectionMode": "Fixed"
}
}Set CustomLineItemRecurrenceInfo
action​String​ | "setCustomLineItemRecurrenceInfo" |
customLineItemId​String​ | |
customLineItemKey​String​ | |
recurrenceInfo​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setCustomLineItemRecurrenceInfo",
"customLineItemId": "{{customLineItemId}}",
"recurrenceInfo": {
"recurrencePolicy": {
"id": "{{recurrence-policy-id}}",
"typeId": "recurrence-policy"
}
}
}Delete My Cart
DeleteMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.id. Returns a 200 status if successful.- If no Cart exists with the provided
id. - If the Cart exists but does not have a
customerIdthat matches the customer:{id} scope, oranonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
idString ​ | id of the Cart. |
versionInt ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -X DELETE https://api.{region}.commercetools.com/{projectKey}/me/carts/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"{
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}Delete My Cart in Store
DeleteMyCarts Permission. If the required Permission is missing, an AssociateMissingPermission error is returned.id in a Store. Returns a 200 status if successful.- If no Cart exists in the Store for the given
id. - If the Cart exists in the Project but does not belong to a Store, or the Cart's
storefield references a different Store. - If the Cart exists in the Project but does not have either a
customerIdthat matches the customer:{id} scope, or ananonymousIdthat matches the anonymous_id:{id} scope.
manage_my_orders:{projectKey}manage_my_orders:{projectKey}:{storeKey}customer_id:{id}anonymous_id:{id}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
storeKeyString ​ | key of the Store. |
idString ​ | id of the Cart. |
versionInt ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/carts/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"{
"type": "Cart",
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2023-01-23T13:06:28.569Z",
"lastModifiedAt": "2023-01-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"lineItems": [],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 0,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": []
}