> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Create Product Custom Field

POST https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/custom-fields
Content-Type: application/json

Creates a *Custom Field*.

**Required Fields:**
- name
- value

**Name-Value Pair Uniqueness**
- Every name-value pair must be unique inside a product.

**Read-Only:**
- id

**Limits**
- 200 custom fields per product limit.
- 250 characters per custom field limit.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/catalog/products/custom-fields/create-product-custom-field

## Authentication

- `X-Auth-Token` header (required) — ### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Products | modify | `store_v2_products` | | Products | read-only | `store_v2_products_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

## Request

### Path parameters

- `product_id` (integer, required) — The ID of the `Product` to which the resource belongs.
- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

### Body (application/json)

This endpoint expects a customFieldPost.

- `name` (string, required) — The name of the field, shown on the storefront, orders, etc. This field is a requirement for /POST requests.
- `value` (string, required) — The value of the field, shown on the storefront, orders, etc. This field is a requirement for /POST requests.

## Response

### 200

Gets Custom field.

- `data` (customFieldData, optional) — Gets custom fields associated with a product. These allow you to specify additional information that will appear on the product’s page, such as a book’s ISBN or a DVD’s release date.
- `meta` (metaEmptyFull, optional) — Response metadata.

## Errors

### 403 Forbidden Error

General Error

- `status` (integer, required) — The HTTP status code.
- `title` (string, required) — The error title describes the particular error.
- `type` (string, required)
- `errors` (GeneralErrorWithErrorsErrors, required)

### 404 Not Found Error

General Error.

- `status` (integer, required) — The HTTP status code.
- `title` (string, required) — The error title describes the particular error.
- `type` (string, required)
- `code` (integer, optional) — The custom code of the error.

### 405 Method Not Allowed Error

405 Method Not Allowed

- `status` (integer, required) — The HTTP status code.
- `title` (string, required) — The error title describes the particular error.
- `type` (string, required)
- `detail` (string, required) — The detailed title describes the particular error.

### 422 Unprocessable Entity Error

General Error.

- `status` (integer, required) — The HTTP status code.
- `title` (string, required) — The error title describes the particular error.
- `type` (string, required)
- `code` (integer, optional) — The custom code of the error.

## Types

### customFieldData

Gets custom fields associated with a product. These allow you to specify additional information that will appear on the product’s page, such as a book’s ISBN or a DVD’s release date.

- `id` (integer, optional) — The unique numeric ID of the custom field increments sequentially. Read-Only.
- `name` (string, optional) — The name of the field, shown on the storefront, orders, etc. This field is a requirement for /POST requests.
- `value` (string, optional) — The value of the field, shown on the storefront, orders, etc. This field is a requirement for /POST requests.

### metaEmptyFull

Response metadata.

### GeneralErrorWithErrorsErrors

## Examples

**Request**

```json
{
  "name": "ISBN",
  "value": "1234567890123"
}
```

**Response**

```json
{
  "data": {
    "id": 6,
    "name": "ISBN",
    "value": "1234567890123"
  },
  "meta": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields"

payload = {
    "name": "ISBN",
    "value": "1234567890123"
}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields';
const options = {
  method: 'POST',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"ISBN","value":"1234567890123"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields"

	payload := strings.NewReader("{\n  \"name\": \"ISBN\",\n  \"value\": \"1234567890123\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"ISBN\",\n  \"value\": \"1234567890123\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"ISBN\",\n  \"value\": \"1234567890123\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields', [
  'body' => '{
  "name": "ISBN",
  "value": "1234567890123"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"ISBN\",\n  \"value\": \"1234567890123\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "ISBN",
  "value": "1234567890123"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/custom-fields")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```