Associates can view, accept, decline, and renegotiate Quotes on behalf of a Business Unit. The actions a given Associate is allowed to perform depends on the specific roles and permissions they hold within the Business Unit.
Get Quote in BusinessUnit as Associate
The Associate must have the
ViewMyQuotes or ViewOthersQuotes Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.Get Quote in BusinessUnit by ID as Associate
GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/{id}
Retrieves a Quote with the provided
id in a BusinessUnit.
If the Quote exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.OAuth 2.0 Scopes:
view_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Quote. |
Query parameters:
expand | The parameter can be passed multiple times. |
Response:
200as
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"quoteState": "Accepted",
"quoteRequest": {
"typeId": "quote-request",
"id": "8a3faa00-33fa-4ab8-bee7-833f31e18dcc"
},
"stagedQuote": {
"typeId": "staged-quote",
"id": "8a3baa00-44fa-4ab8-bec7-933c31e18dcc"
},
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"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": []
}
],
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel"
}Get Quote in BusinessUnit by Key as Associate
GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/key={key}
Retrieves a Quote with the provided
key in a BusinessUnit.
If the Quote exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.OAuth 2.0 Scopes:
view_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Quote. |
Query parameters:
expand | The parameter can be passed multiple times. |
Response:
200as
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"quoteState": "Accepted",
"quoteRequest": {
"typeId": "quote-request",
"id": "8a3faa00-33fa-4ab8-bee7-833f31e18dcc"
},
"stagedQuote": {
"typeId": "staged-quote",
"id": "8a3baa00-44fa-4ab8-bec7-933c31e18dcc"
},
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"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": []
}
],
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel"
}Query Quotes in BusinessUnit as Associate
GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes
Retrieves all Quotes in a BusinessUnit.
OAuth 2.0 Scopes:
view_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
Query parameters:
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. |
Response:
200as
application/jsoncurl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" {
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"quoteState": "Accepted",
"quoteRequest": {
"typeId": "quote-request",
"id": "8a3faa00-33fa-4ab8-bee7-833f31e18dcc"
},
"stagedQuote": {
"typeId": "staged-quote",
"id": "8a3baa00-44fa-4ab8-bec7-933c31e18dcc"
},
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"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": []
}
],
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel"
}
]
}Check if Quote exists in BusinessUnit as Associate
Check if Quote exists in BusinessUnit by ID as Associate
HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/{id}
Checks if a Quote exists with the provided
id in a BusinessUnit. Returns a 200 OK status if the Quote exists or a Not Found error otherwise.OAuth 2.0 Scopes:
view_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Quote. |
Response:
200
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if Quote exists in BusinessUnit by Key as Associate
HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/key={key}
Checks if a Quote exists with the provided
key in a BusinessUnit. Returns a 200 OK status if the Quote exists, or a Not Found error otherwise.OAuth 2.0 Scopes:
view_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Quote. |
Response:
200
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" Check if Quote exists in BusinessUnit by Query Predicate as Associate
HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes
Checks if one or more Quotes exist for the provided query predicate in a BusinessUnit. Returns a
200 OK status if any Quotes match the query predicate, or a Not Found error otherwise.OAuth 2.0 Scopes:
view_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
Query parameters:
where | The parameter can be passed multiple times. |
Response:
200
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"Update Quote in BusinessUnit as Associate
Depending on the Quote and the update action performed, the Associate requires the following Permissions:
AcceptMyQuotesorAcceptOthersQuotesPermission to accept a Quote.DeclineMyQuotesorDeclineOthersQuotesPermission to decline a Quote through the change Quote update action.RenegotiateMyQuotesorRenegotiateOthersQuotesPermission to request renegotiation for a Quote.ReassignMyQuotesorReassignOthersQuotesPermission to change the Customer for a Quote.
If a required Permission is missing, an AssociateMissingPermission error is returned.
Update Quote in BusinessUnit by ID as Associate
POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/{id}
Updates a Quote in a BusinessUnit using one or more update actions.
If the Quote exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
manage_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
idString ​ | id of the Quote. |
Query parameters:
expand | The parameter can be passed multiple times. |
Request Body:
application/jsonversion​Int​ | Expected version of the Quote to which the changes should be applied.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions​Array of QuoteUpdateAction​ | Update actions to be performed on the Quote. |
Response:
200as
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeQuoteState",
"quoteState" : "Accepted"
} ]
}
DATA{
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"quoteState": "Accepted",
"quoteRequest": {
"typeId": "quote-request",
"id": "8a3faa00-33fa-4ab8-bee7-833f31e18dcc"
},
"stagedQuote": {
"typeId": "staged-quote",
"id": "8a3baa00-44fa-4ab8-bec7-933c31e18dcc"
},
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"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": []
}
],
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel"
}Update Quote in BusinessUnit by Key as Associate
POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/key={key}
Updates a Quote in a BusinessUnit using one or more update actions.
If the Quote exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
OAuth 2.0 Scopes:
manage_quotes:{projectKey}Path parameters:
regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
associateIdString ​ | |
businessUnitKeyString ​ | key of the BusinessUnit. |
keyString ​ | key of the Quote. |
Query parameters:
expand | The parameter can be passed multiple times. |
Request Body:
application/jsonversion​Int​ | Expected version of the Quote to which the changes should be applied.
If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions​Array of QuoteUpdateAction​ | Update actions to be performed on the Quote. |
Response:
200as
application/jsoncurl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/quotes/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeQuoteState",
"quoteState" : "Accepted"
} ]
}
DATA{
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 5,
"createdAt": "2015-09-22T15:36:17.510Z",
"lastModifiedAt": "2015-09-22T15:41:55.816Z",
"quoteState": "Accepted",
"quoteRequest": {
"typeId": "quote-request",
"id": "8a3faa00-33fa-4ab8-bee7-833f31e18dcc"
},
"stagedQuote": {
"typeId": "staged-quote",
"id": "8a3baa00-44fa-4ab8-bec7-933c31e18dcc"
},
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"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": []
}
],
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"customLineItems": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel"
}