Convert unstructured customer input into a Cart, Quote Request, or Shopping List through the HTTP API.
When to use the Intake Agent
Use the Intake Agent to:
- Convert a list of SKUs, ISBNs, or product names from an email into a Cart without entering each line manually.
- Convert a customer request from a CSV, PDF, or free-text email into a Cart or Quote Request with catalog matches, pricing, and customer context.
- Convert a product list from an email, spreadsheet, or order form into a Shopping List that the Customer can turn into a Cart later.
- Convert inbound emails or support tickets into commerce objects without implementing document parsing, product matching, and customer resolution.
Required information
Every request must include:
outputType: whether to create a Cart, a Quote Request, or a Shopping List. The Intake Agent never infers the entity from the input.locale: a valid BCP-47 language tag, for exampleen-US.
application/json requests, provide a prompt. For multipart/form-data requests, provide a prompt, one or more files, or both.outputType:| Information | Cart | Quote Request | Shopping List |
|---|---|---|---|
| Customer email address | Required | Required | Required |
| Shipping country, used for pricing and tax | Required | Required | Not used |
| Name for the Shopping List | Not applicable | Not applicable | Required |
The Intake Agent must also resolve the Business Unit and Store for the request, either from the input or from an explicit reference.
400 error. The response names the missing information: RequiredField for a missing request field, and codes such as MissingCustomerEmail, MissingCountry, MissingShoppingListName, BusinessUnitUnresolved, or StoreUnresolved for information that couldn't be found in the input.Shopping List name
outputType is ShoppingList, the input must state the name to give the list, for example Create a shopping list called "Q3 restock" for jane.doe@example.com with 12 of SKU ABC-123.400 error with the code MissingShoppingListName.locale of the request. If the input also describes the list, that text is stored as the Shopping List description in the same way.Supported input
| Input type | Notes |
|---|---|
| Free text | A natural-language prompt, such as the body of an email, a message, or a note. |
| File upload | PDF, TXT, CSV, DOCX, XLSX, EML, Markdown, and HTML. Up to 3 files, 20 MB each. |
Handling unmatched input
warnings alongside the 201 response:- When every referenced Product is matched to your catalog,
warningsis omitted. - When one or more Products cannot be matched, a
ProductsNotFoundwarning lists the unmatched identifiers. The caller can then address them, for example by editing the entity or asking the customer for more information. - When an uploaded file cannot be parsed, a
FileNotProcessedwarning names the file.
NoLineItemsExtracted error instead.Unpublished Products in a Shopping List
ShoppingList requests each identifier that Product Search can't match is looked up a second time against staged Product data. That lookup is an exact match against the Product key, the Product Variant sku or key, or the Product name in the locale of the request or in a language configured for the Store or the Project. Partial names and misspellings don't match.published set to false.ProductsNotFound warning. If no requested Product remains, the request fails with a ShoppingListCreationFailed error.Endpoints
The Intake Agent exposes a single, stateless endpoint. Each call starts a fresh workflow run and returns its terminal outcome: either a created entity or an error. Multi-turn conversation is not supported by this endpoint.
manage_intake_agent:{projectKey} scope.Create a Cart, Quote Request, or Shopping List
outputType and is never inferred from the input.warnings alongside a successful 201 response rather than failing the request.application/json body or a multipart/form-data request. An application/json body requires prompt. A multipart/form-data request requires prompt, an uploaded file, or both. See Multipart form data for the file upload format.manage_intake_agent:{projectKey}regionString ​ | Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
application/json, multipart/form-dataapplication/jsoncurl https://api.{region}.commercetools.com/{projectKey}/agents/intake/v1/responses -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"outputType" : "Cart",
"locale" : "en-US",
"prompt" : "Please prepare a cart for jane.doe@example.com. We need 12 of SKU ABC-123 shipped to Germany.",
"businessUnit" : {
"typeId" : "business-unit",
"key" : "acme-west"
},
"store" : {
"typeId" : "store",
"key" : "west-coast"
}
}
DATA{
"entityType": "Cart",
"entity": {
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2026-06-23T13:06:28.569Z",
"lastModifiedAt": "2026-06-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"customerEmail": "jane.doe@example.com",
"businessUnit": {
"key": "acme-west",
"typeId": "business-unit"
},
"store": {
"typeId": "store",
"key": "west-coast"
},
"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": [],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
},
"quantity": 2,
"discountedPricePerQuantity": [],
"state": [],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 5600,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": [],
"totalLineItemQuantity": 2
},
"threadId": "run_01j2x8qz6qfz5b3v9c2d4e6f8g"
}curl -X POST https://api.{region}.commercetools.com/{projectKey}/agents/intake/v1/responses \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"outputType": "ShoppingList",
"locale": "en-US",
"prompt": "Create a shopping list called \"Q3 restock\" for jane.doe@example.com with 12 of SKU ABC-123 and 4 of SKU XYZ-789."
}'
Multipart form data
payload part and attach files under files parts. Uploading a file under any other field name is rejected with an InvalidField error.You can upload up to 3 files, 20 MB each. The allowed content types are:
- PDF (
application/pdf) - Plain text (
text/plain) - CSV (
text/csv) - DOCX (
application/vnd.openxmlformats-officedocument.wordprocessingml.document) - XLSX (
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) - EML (
message/rfc822) - Markdown (
text/markdown) - HTML (
text/html)
curl -X POST https://api.{region}.commercetools.com/{projectKey}/agents/intake/v1/responses \
-H "Authorization: Bearer {token}" \
-F 'payload={"outputType":"QuoteRequest","locale":"en-US","prompt":"Quote for the attached purchase order."};type=application/json' \
-F "files=@purchase-order.pdf"
Error codes
threadId, which is returned in the AgentResponsesErrorResponse body on any error raised once the workflow has started. Errors that fail during request parsing, before the workflow starts, don't include it.400 and 500 responses, see Intake Agent errors.ProductsNotFound code appears as either a 400 error, when none of the requested Products could be matched to the catalog, or as a warning on a successful 201 response, when only some Products couldn't be matched or are unavailable in the bound Store.MissingShoppingListName and ShoppingListCreationFailed only occur when outputType is ShoppingList, and MissingCountry and QuoteRequestCreationFailed never do.Next actions
- Review and refine a Cart through the standard Cart update actions.
- Create a Quote Request from a Cart that was created first.
- Refine a Shopping List through the standard Shopping List update actions, then add its Line Items to a Cart.
- Delete the entity and start over.
id, and the cartId for a Quote Request, to reference the entity in follow-up API calls.Representations
AgentResponsesRequest
application/json request. prompt is required.multipart/form-data request with an AgentResponsesPayload as the payload part.outputType​ | The entity to create. |
locale​String​ | A valid BCP 47 language tag, for example en-US. |
prompt​String​ | Natural-language description of the entity to create, such as the body of an email or a note. For a Shopping List, it must state the name of the list. |
businessUnit​ | BusinessUnit to use for the request. If omitted, the Intake Agent resolves it from prompt. |
store​ | Store to use for the request. If omitted, the Intake Agent resolves it from prompt. |
{
"outputType": "Cart",
"locale": "en-US",
"prompt": "Please prepare a cart for jane.doe@example.com. We need 12 of SKU ABC-123 shipped to Germany.",
"businessUnit": {
"typeId": "business-unit",
"key": "acme-west"
},
"store": {
"typeId": "store",
"key": "west-coast"
}
}AgentResponsesPayload
payload part of a multipart/form-data request. prompt is optional when files are attached.payload part of a multipart/form-data /responses request to the Intake Agent. prompt is optional when files are attached.application/json request, use AgentResponsesRequest instead.outputType​ | The entity to create. |
locale​String​ | A valid BCP 47 language tag, for example en-US. |
prompt​String​ | Natural-language description of the entity to create, such as the body of an email or a note. Required if no file is attached. For a Shopping List, the name of the list must be stated in either the prompt or an attached file. |
businessUnit​ | BusinessUnit to use for the request. If omitted, the Intake Agent resolves it from the input. |
store​ | Store to use for the request. If omitted, the Intake Agent resolves it from the input. |
{
"outputType": "QuoteRequest",
"locale": "en-US",
"prompt": "Quote for the attached purchase order.",
"businessUnit": {
"typeId": "business-unit",
"key": "acme-west"
},
"store": {
"typeId": "store",
"key": "west-coast"
}
}AgentResponsesMultipartRequest
multipart/form-data body when files are attached.multipart/form-data body for a /responses request when files are attached. The JSON fields go in the payload part; files go in files parts.payload​ | JSON document matching AgentResponsesPayload. Must include outputType and locale. At least one of prompt or files must be provided. |
files​Array of File​ | Supporting files. Repeat this part for each file. Maximum of 3 files, 20 MB each. Allowed content types: MinItems: application/pdf, text/plain, text/csv, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, message/rfc822, text/markdown, text/html.1​MaxItems: 3​ |
{
"payload": {
"outputType": "QuoteRequest",
"locale": "en-US",
"prompt": "Quote for the attached purchase order.",
"businessUnit": {
"typeId": "business-unit",
"key": "acme-west"
},
"store": {
"typeId": "store",
"key": "west-coast"
}
}
}AgentResponsesOutputType
Cart- Create a Cart.
QuoteRequest- Create a QuoteRequest. Requires a verified Customer, identified by email.
ShoppingList- Create a ShoppingList. Requires a verified Customer, identified by email, and a name for the ShoppingList stated in the input.
AgentResponsesSuccess
201 responses use a discriminated type based on entityType.201 response from a /responses request. Returns the created entity in commercetools REST representation, together with any non-fatal warnings.entityType:- AgentResponsesCartSuccess when a Cart was created
- AgentResponsesQuoteRequestSuccess when a QuoteRequest was created
- AgentResponsesShoppingListSuccess when a ShoppingList was created
entityType​ | The entity that was created. Determines the concrete response type. |
threadId​String​ | Identifier of the workflow run that produced this response. |
warnings​Array of WarningObject​ | Non-fatal issues encountered while processing the request. Present only when at least one warning is returned. MinItems:Â1​ |
AgentResponsesCartSuccess
outputType is Cart.entityType​ | CartThe entity that was created. Determines the concrete response type. |
threadId​String​ | Identifier of the workflow run that produced this response. |
entity​Cart​ | The created Cart in full commercetools REST representation. |
warnings​Array of WarningObject​ | Non-fatal issues encountered while processing the request. Present only when at least one warning is returned. MinItems:Â1​ |
{
"entityType": "Cart",
"entity": {
"id": "27b39077-aa57-48a5-b504-914f68fa44dc",
"version": 1,
"createdAt": "2026-06-23T13:06:28.569Z",
"lastModifiedAt": "2026-06-23T13:06:28.569Z",
"lastModifiedBy": {
"isPlatformClient": false
},
"createdBy": {
"isPlatformClient": false
},
"customerEmail": "jane.doe@example.com",
"businessUnit": {
"key": "acme-west",
"typeId": "business-unit"
},
"store": {
"typeId": "store",
"key": "west-coast"
},
"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": [],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
},
"quantity": 2,
"discountedPricePerQuantity": [],
"state": [],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 5600
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"cartState": "Active",
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 5600,
"fractionDigits": 2
},
"shippingMode": "Single",
"shipping": [],
"customLineItems": [],
"discountCodes": [],
"directDiscounts": [],
"inventoryMode": "None",
"taxMode": "Platform",
"priceRoundingMode": "HalfEven",
"taxRoundingMode": "HalfEven",
"taxCalculationMode": "LineItemLevel",
"refusedGifts": [],
"origin": "Customer",
"itemShippingAddresses": [],
"totalLineItemQuantity": 2
},
"threadId": "run_01j2x8qz6qfz5b3v9c2d4e6f8g"
}AgentResponsesQuoteRequestSuccess
outputType is QuoteRequest.entityType​ | QuoteRequestThe entity that was created. Determines the concrete response type. |
threadId​String​ | Identifier of the workflow run that produced this response. |
entity​QuoteRequest​ | The created QuoteRequest in full commercetools REST representation. |
cartId​String​ | id of the underlying Cart. |
warnings​Array of WarningObject​ | Non-fatal issues encountered while processing the request. Present only when at least one warning is returned. MinItems:Â1​ |
{
"entityType": "QuoteRequest",
"entity": {
"id": "2a3baa00-44fa-4ab8-bec7-933c31e18dcc",
"version": 1,
"createdAt": "2026-06-23T13:06:28.569Z",
"lastModifiedAt": "2026-06-23T13:06:28.569Z",
"quoteRequestState": "Submitted",
"comment": "Give me 10% discount",
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"businessUnit": {
"key": "acme-west",
"typeId": "business-unit"
},
"store": {
"typeId": "store",
"key": "west-coast"
},
"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": [],
"attributes": [],
"assets": []
},
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 2800
},
"id": "8da659ef-9e54-447d-9c36-84912db1848f"
},
"quantity": 2,
"discountedPricePerQuantity": [],
"state": [],
"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"
},
"cartId": "27b39077-aa57-48a5-b504-914f68fa44dc",
"warnings": [
{
"code": "ProductsNotFound",
"message": "The following requested products could not be matched to the catalog and were omitted: SKU-999.",
"products": [
"SKU-999"
]
}
],
"threadId": "run_01j2x8qz6qfz5b3v9c2d4e6f8h"
}AgentResponsesShoppingListSuccess
outputType is ShoppingList.entityType​ | ShoppingListThe entity that was created. Determines the concrete response type. |
threadId​String​ | Identifier of the workflow run that produced this response. |
entity​ShoppingList​ | The created ShoppingList in full commercetools REST representation. |
warnings​Array of WarningObject​ | Non-fatal issues encountered while processing the request. Present only when at least one warning is returned. MinItems:Â1​ |
{
"entityType": "ShoppingList",
"entity": {
"id": "8c1a9e34-6d0f-4b2e-9a71-1f5d7c3e0a42",
"version": 1,
"name": {
"en-US": "Q3 restock"
},
"description": {
"en-US": "Items to reorder before the end of the quarter."
},
"customer": {
"typeId": "customer",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921"
},
"businessUnit": {
"typeId": "business-unit",
"key": "acme-west"
},
"store": {
"typeId": "store",
"key": "west-coast"
},
"lineItems": [
{
"id": "b925a817-d5ad-48bb-a407-29ad8e0649b5",
"name": {
"en-US": "SAPPHIRE"
},
"productId": "9f10dcfb-5cc9-4a18-843a-c07f7e22d01f",
"productType": {
"typeId": "product-type",
"id": "2543e1d8-4915-4f72-a3c9-1df9b1b0082d"
},
"published": true,
"variantId": 1,
"quantity": 12,
"addedAt": "2026-06-23T13:06:28.569Z"
},
{
"id": "3e4c6f18-70a2-4d5b-8c93-2b8d1a7f6c04",
"name": {
"en-US": "OPAL"
},
"productId": "c0f2b8d4-1e37-4a6b-9d52-8f3a7c1e5b90",
"productType": {
"typeId": "product-type",
"id": "2543e1d8-4915-4f72-a3c9-1df9b1b0082d"
},
"published": false,
"variantId": 1,
"quantity": 4,
"addedAt": "2026-06-23T13:06:28.569Z"
}
],
"textLineItems": [],
"createdAt": "2026-06-23T13:06:28.569Z",
"lastModifiedAt": "2026-06-23T13:06:28.569Z"
},
"warnings": [
{
"code": "ProductsNotFound",
"message": "The following requested products could not be matched to the catalog and were omitted: SKU-999.",
"products": [
"SKU-999"
]
}
],
"threadId": "run_01j2x8qz6qfz5b3v9c2d4e6f8i"
}Warnings
code. See Warnings for the full list, including ProductsNotFound and FileNotProcessed, which are specific to the Intake Agent.AgentResponsesErrorResponse
401 and 403 responses, errors use this envelope: a statusCode, a human-readable message, and one or more errors.statusCode​Int​ | HTTP status code corresponding to the error. |
message​String​ | First error message in the errors array. |
errors​Array of ErrorObject​ | Errors returned for a request. A single error response can contain multiple errors if the errors are related to the same HTTP status code such as MinItems: 400.1​ |
threadId​String​ | Identifier of the workflow run that raised the error. Present on errors raised once the workflow has started. Absent on errors raised while parsing the request, before the workflow starts. |
{
"statusCode": 400,
"message": "No line items could be extracted from the provided input.",
"errors": [
{
"code": "NoLineItemsExtracted",
"message": "No line items could be extracted from the provided input."
}
],
"threadId": "run_01j2x8qz6qfz5b3v9c2d4e6f8g"
}AgentResponsesAuthError
401 or 403 response uses the standard AuthErrorResponse shape (statusCode, message, errors, plus OAuth error / error_description) rather than the AgentResponsesErrorResponse envelope. Typical OAuth codes are invalid_token (401) and insufficient_scope (403).statusCode, message, errors, plus OAuth error / error_description) rather than the AgentResponsesErrorResponse envelope used for other errors from this endpoint.statusCode​Int​ | HTTP status code corresponding to the error. |
message​String​ | First error message in the errors array. |
errors​Array of ErrorObject​ | Authentication and authorization-related errors returned for a request. |
error​String​ | Error code as per the OAuth 2.0 specification. For example: "access_denied". |
error_description​String​ | Plain text description of the first error. |
{
"statusCode": 401,
"message": "Authorization header is required.",
"errors": [
{
"code": "invalid_token",
"message": "Authorization header is required."
}
],
"error": "invalid_token",
"error_description": "Authorization header is required."
}