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!




      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方