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.).
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 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."
}
}custom_fields are provided?Thanks in advance!