Convert unstructured customer input into a Cart or Quote Request 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 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 or a Quote Request.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.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, such as RequiredField, BusinessUnitUnresolved, or StoreUnresolved.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.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 desired Cart or Quote Request, such as the body of an email or a note. |
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 desired Cart or Quote Request, such as the body of an email or a note. Required if no file is attached. |
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.
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
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"
}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."
}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 currently supported by this endpoint.
manage_intake_agent:{projectKey} scope.Create a Cart or Quote Request
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/jsonapplication/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"
}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.Next actions
- Review and refine a Cart through the standard Cart update actions.
- Create a Quote Request from a Cart that was created first.
- Delete the entity and start over.
id, and the cartId for a Quote Request, to reference the entity in follow-up API calls.