You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过BigCommerce API更新账户注册客户自定义字段?

Updating BigCommerce Customer Custom Fields via API

Hey Deepak, I’ve dealt with this exact frustration before—BigCommerce’s customer custom field update logic is a bit different from product custom fields, so the solution you found for products doesn’t translate directly. Let me break down what you need to do:

The Key Issue

When you pull customer data, the form_fields array includes the field name, but you can’t use the name property to update the field via PUT. Instead, you need to reference the custom field’s unique id value, which is also included in the GET response (you might have missed it!).

Step-by-Step Fix

  1. First, get the customer’s full data to retrieve the field ID
    Call the GET /v3/customers/{customer_id} endpoint. Look for the form_fields array in the response—each object will have an id, name, and value property. For your "Rep Id" field, grab that id number.

  2. Construct your PUT request with the field ID
    Replace the name property in your form_fields object with the id you just retrieved. Here’s what the corrected request body looks like:

    {
      "first_name": "Deepak",
      "last_name": "Bandi",
      "email": "bandideepakreddy@gmail.com",
      "company": "",
      "phone":"3123152269",
      "store_credit":"",
      "notes":"",
      "tax_exempt_category":"",
      "customer_group_id": 0,
      "form_fields": [
        {
          "id": 12345, // Replace with your actual "Rep Id" field ID
          "value": "10025"
        }
      ]
    }
    

Important Notes

  • Double-check that your API token has the customers_modify permission—without this, you’ll get a 403 error even with the correct payload.
  • If you’re updating multiple custom fields, include each one as an object in the form_fields array, each with its own id and value.
  • Unlike product custom fields, you don’t need to include all custom fields in the PUT request—only the ones you want to update.

内容的提问来源于stack exchange,提问作者Deepak Bandi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:30:35