Classify and persist products synchronously

Learn how to classify one product synchronously and persist the result so you can retrieve and modify it later.

Endpoint

POST /public-api/categorize/sync/persist

Classifies exactly one product through the AI Classifier, persists the result and related product data, and returns the classification result.

Authentication

All requests require a valid bearer token in the Authorization header.

Authorization: Bearer {ACCESS_TOKEN}

Request

{
  "uniqueIdentifierType": "GTIN",
  "enableQC": false,
  "products": [
    {
      "productUniqueId": "1234567890123",
      "productTitle": "Wireless Mouse",
      "productDescription": "Ergonomic wireless mouse for laptop use.",
      "identifiers": {
        "SKU": "WM-101"
      }
    }
  ]
}
PropertyTypeRequiredDescription
uniqueIdentifierTypestringYesThe client's configured unique record identifier type.
enableQCBooleanNoWhether the AI Classifier should evaluate qualifying conditions. Default is false.
productsarrayYesMust contain exactly one product.

Exactly one product is required. If you submit more than one product, the request returns 400 Bad Request.

Example

curl --request POST \
  --url https://smartcategorization.vertexcloud.com/public-api/categorize/sync/persist \
  --header "Authorization: Bearer {ACCESS_TOKEN}" \
  --header "Content-Type: application/json" \
  --data '{
    "uniqueIdentifierType": "GTIN",
    "enableQC": false,
    "products": [
      {
        "productUniqueId": "1234567890123",
        "productTitle": "Wireless Mouse",
        "productDescription": "Ergonomic wireless mouse for laptop use."
      }
    ]
  }'

Response

[
  {
    "product_unique_id": "1234567890123",
    "product_title": "Wireless Mouse",
    "product_description": "Ergonomic wireless mouse for laptop use.",
    "category_id": "12345",
    "Category": "Computer Accessories",
    "confidence": "High",
    "status": "approved",
    "used_existing_mapping": false
  }
]

Errors

StatusDescription
400 Bad RequestThe request is invalid. Common reasons include missing uniqueIdentifierType, missing products, or more than one product.
401 UnauthorizedThe bearer token is missing, expired, or invalid.
500 Internal Server ErrorThe classifier or service encountered an unexpected error during processing or persistence.
504 Gateway TimeoutThe classifier did not respond within the configured timeout.

Did this page help you?