createBrand
Requires permission products:brand:create.
Creates a brand. The brand code must be unique within your organization, otherwise the request is refused. Needs the brands create permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreateBrand($createBrandInput: CreateBrandInput!) {
createBrand(createBrandInput: $createBrandInput) {
id
code
name
createdAt
deletedAt
deletedBy
products {
id
name
status
createdAt
basePrice
baseUOMId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateBrand($createBrandInput: CreateBrandInput!) {\n createBrand(createBrandInput: $createBrandInput) {\n id\n code\n name\n createdAt\n deletedAt\n deletedBy\n products {\n id\n name\n status\n createdAt\n basePrice\n baseUOMId\n }\n }\n}",
"variables": {
"createBrandInput": {
"code": "string",
"name": "string"
}
}
}
EOF
Variables:
{
"createBrandInput": {
"code": "string",
"name": "string"
}
}
Response:
{
"data": {
"createBrand": {
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string",
"products": [
{
"id": "id",
"name": "string",
"status": "ACTIVE",
"createdAt": "2025-01-15T00:00:00Z",
"basePrice": 0,
"baseUOMId": "id"
}
]
}
}
}
createBrand(
createBrandInput: CreateBrandInput!
): Brand!
Arguments
createBrand.createBrandInput ● CreateBrandInput! non-null input
The details of the brand to create.
Type
Brand object
A brand products are made or sold under.