BigCommerce: "The value of the column Categories has incorrect JSON format" error

BigCommerce: "The value of the column Categories has incorrect JSON format" error

When working with the Categories field in the Product object within the BigCommerce API, it's important to understand how to format and import data correctly to ensure a successful import. In the BigCommerce API, the Categories field in the Product object is an array. For more information, on Products, please refer to the following link.

We have implemented the Categories field as a string in JSON format. Therefore, when importing data into the Products.Categories field, please specify the value in this format. The value should start with an opening bracket [ and end with a closing bracket ], with each category ID separated by commas. Here are examples:

  • [21, 23] – representing two category IDs.
  • [22] –  representing one category ID.

Make sure to pass values to the Categories field in this format for successful data import.

You can pass data in array format in the following ways:

- Format the value in brackets in your CSV file as described above;

- Use Constant mapping to pass fixed values to a target column. To do this, select "Constant" as the mapping type and specify the constant value directly:

 

For more details, refer to the Constant Mapping documentation.

- Use Expression Mapping as shown below. 

For example, if you have two Category IDs in separate columns, you can concatenate them into a JSON array format like this: 

'[' + Category1 + ',' + Category2 + ']'


For more details on expression syntax, visit Expression Syntax page.