Get Cart in BusinessUnit as Associate
ViewMyCarts or ViewOthersCarts Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.Get Cart in BusinessUnit by ID as Associate
view_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Cart. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Get Cart in BusinessUnit by Key as Associate
view_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Cart. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Query Carts in BusinessUnit as Associate
view_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
whereString ​ | Use to filter query responses. For more information, see Query Predicates. The parameter can be passed multiple times. |
sortString ​ | Use to sort query results. For more information, see Sorting. The parameter can be passed multiple times. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
limitInt32 ​ | Number of results requested. Default: 20​Minimum: 0​Maximum: 500​ |
offsetInt32 ​ | 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}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}
]
}Check if Cart exists in BusinessUnit as Associate
Check if Cart exists in BusinessUnit by ID as Associate
id. Returns a 200 status if the Cart exists, or a 404 status otherwise.view_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Cart. |
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if Cart exists in BusinessUnit by Key as Associate
key. Returns a 200 status if the Cart exists, or a 404 status otherwise.view_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Cart. |
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if Cart exists in BusinessUnit by Query Predicate as Associate
200 status if any Carts match the query predicate, or a 404 status otherwise.view_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
whereString ​ | Use to filter query responses. For more information, see Query Predicates. The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Create Cart in BusinessUnit as Associate
CreateMyCarts or CreateOthersCarts Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.businessUnitKey. As such, the businessUnit field on CartDraft is ignored for this request.Specific Error Codes:
- DiscountCodeNonApplicable
- InvalidItemShippingDetails
- MatchingPriceNotFound
- MissingTaxRateForCountry
- InvalidOperation is returned in several cases, including the following:
- The referenced Shipping Method has a predicate that does not match the Cart.
- The referenced Shipping Method is not active.
- The referenced Shipping Method is scoped to a Store that differs from the Cart's Store.
- The referenced Shipping Method is scoped to a Store, but the Cart does not belong to a Store.
manage_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"currency" : "EUR"
}
DATA{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Replicate Cart in BusinessUnit as Associate
CreateMyCarts or CreateOthersCarts Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.Creates a new Cart by replicating an existing Cart or Order. 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_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
application/jsonapplication/jsoncurl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/replicate -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"reference" : {
"id" : "74dcac8b-0c67-4f37-b693-3acd33e3c457",
"typeId" : "cart"
}
}
DATA{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Update Cart in BusinessUnit as Associate
UpdateMyCarts or UpdateOthersCarts Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.Update Cart in BusinessUnit by ID as Associate
manage_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Cart. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
application/jsonversion​Int64​ | 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 CartUpdateAction​ | Update actions to be performed on the Cart. |
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/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": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Update Cart in BusinessUnit by Key as Associate
manage_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Cart. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
application/jsonversion​Int64​ | 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 CartUpdateAction​ | Update actions to be performed on the Cart. |
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/key={key} -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": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Delete Cart in BusinessUnit as Associate
DeleteMyCarts or DeleteOthersCarts Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.Delete Cart in BusinessUnit by ID as Associate
manage_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Cart. |
versionInt64 ​ | Last seen version of the resource. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
dataErasureBoolean ​ | To erase all related personal data in compliance with GDPR, set to true.Default: false​ |
application/jsoncurl -X DELETE https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}Delete Cart in BusinessUnit by Key as Associate
manage_orders:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Cart. |
versionInt64 ​ | Last seen version of the resource. |
expandString ​ | Use to expand resources in a single request. For more information, see Reference Expansion. The parameter can be passed multiple times. |
dataErasureBoolean ​ | To erase all related personal data in compliance with GDPR, set to true.Default: false​ |
application/jsoncurl -X DELETE https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"{
"type": "Cart",
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"key": "test-key",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"customerId": "2a3baa00-44fa-4ab8-bec7-933c31e18dcf",
"businessUnit": {
"key": "bu-345-france",
"typeId": "business-unit"
},
"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": []
}
],
"store": {
"typeId": "store",
"key": "test-key"
},
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"discountCodes": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"totalLineItemQuantity": 2,
"origin": "Customer",
"shipping": [],
"shippingMode": "Single",
"itemShippingAddresses": [],
"directDiscounts": []
}