Question about using custom_fields in Storefront Add-to-Cart API (error 2003 – required details)

Question about using custom_fields in Storefront Add-to-Cart API (error 2003 – required details)

Hi everyone,

I’m working with the Zoho Commerce Storefront API, specifically the Add to Cart endpoint:

POST /storefront/api/v1/cart

According to the documentation, this endpoint supports a custom_fields parameter for adding line-item custom data. I’m trying to use this for products that require additional information (for example: patient name, date of birth, notes, etc.).

What I’ve tried

  • I created custom fields in the Zoho Commerce Dashboard

  • I then sent them in the add-to-cart request like this:

{
"product_variant_id": "XXXXXXXXXXXX",
"quantity": "1",
"custom_fields": [
{
"customfield_id": "XXXXXXXXXXXX",
"label": "cf_patient_name",
"data_type": "string",
"value": "John Doe"
}
]
}

The issue

The API always returns this error:

{
"error": {
"code": 2003,
"message": "\"product_name\" cannot be added to the cart as it requires you to enter certain details. However, you can add it to the cart from the products page."
}
}

My questions

- Do I need professional plan to use customer_fields with API?

- Or is it simply not possible to add products with required custom fields via the Storefront API, even if custom_fields are provided?

Thanks in advance!