Create a Product Brand
The request body is a single product brand object, not an array. identifier and name are required; description is optional and is stored as an empty string when omitted.
curl -X POST "https://connect.wholechain.com/Integration/Brand" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-H "accept: */*" \
-d '{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/Brand"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "*/*"
}
data = {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://connect.wholechain.com/Integration/Brand", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "*/*"
},
body: JSON.stringify({
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}`)
req, err := http.NewRequest("POST", "https://connect.wholechain.com/Integration/Brand", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-KEY", "example_string")
req.Header.Set("accept", "*/*")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://connect.wholechain.com/Integration/Brand')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-KEY'] = 'example_string'
request['accept'] = '*/*'
request.body = '{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}'
response = http.request(request)
puts response.body
{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"X-API-KEY": [
"The apiKey field is required."
]
},
"traceId": "…"
}
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
"title": "Product brand external identifier already exists: BRAND-001",
"status": 409,
"traceId": "…"
}
{
"type": "https://tools.ietf.org/html/rfc4918#section-11.2",
"title": "Name is required.",
"status": 422,
"traceId": "…"
}
/Integration/Brand
Target server for requests. Edit to use your own host.
The media type of the request body
Your Wholechain API key.
Response content type.
Required. Your identifier for the product brand. Must not already be used by another product brand.
Required. Name of the product brand.
Optional. Description of the product brand. Stored as an empty string when omitted.
Request Preview
Response
Response will appear here after sending the request
Responses
Introduction
This API creates a product brand in Wholechain.
A product brand is a brand that can be assigned to your products.
A product references a brand through the productBrand object in the product Details. See Create a Product and Update a Product.
Endpoint
| Method | URL |
|---|---|
POST | https://connect.wholechain.com/Integration/Brand |
Request Headers
| Header | Description | Example Value |
|---|---|---|
X-API-KEY | Your Wholechain API key. | <YOUR_API_KEY> |
Content-Type | Content type of the request. application/json and application/xml are accepted. | application/json |
accept | Response content type. | */* |
Request Body
The request body is a single product brand object.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
identifier | STRING | Your identifier for the product brand. Must not already be used by another product brand. | Yes |
name | STRING | Name of the product brand. | Yes |
description | STRING | Description of the product brand. If omitted, it is stored as an empty string. | No |
Example Request
{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}
cURL
curl -X 'POST' \
'https://connect.wholechain.com/Integration/Brand' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-d '{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}'
Responses
201 — Created
The product brand is created. The response body is a product brand object with the same fields as the request: identifier, name, and description.
{
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
}
409 — Conflict
A product brand with the same identifier already exists.
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
"title": "Product brand external identifier already exists: BRAND-001",
"status": 409,
"traceId": "<trace-id>"
}
422 — Unprocessable Entity
identifier or name is missing. The title is Identifier is required. or Name is required.
{
"type": "https://tools.ietf.org/html/rfc4918#section-11.2",
"title": "Name is required.",
"status": 422,
"traceId": "<trace-id>"
}
400 — Bad Request
The X-API-KEY header is missing, or the request body is not valid JSON.
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"X-API-KEY": [
"The apiKey field is required."
]
},
"traceId": "<trace-id>"
}
Important Notes
- The request body is a single object, not an array. Create one product brand per request.
identifierandnameare required.descriptionis optional.- A product brand is also created automatically when a product references a new
identifierin itsproductBrandobject. See Create a Product. - To change an existing product brand, see Update a Product Brand. To remove one, see Delete a Product Brand.
- In the Update a Product response, the brand assigned to a product is returned as
productBrand(withid,name,description,externalIdentifier, andprofileImagePreSignedUrl).