Skip to main content

Create Branding Theme

Create a branding theme for the selected store. name is required. The server mints id. Omit is_default to store false. Setting is_default: true clears the previous default — see Default.

Request

POST /branding-themes

Request Body

ParameterTypeRequiredDescription
namestringYesLabel, 1–255 characters.
is_defaultbooleanNoDefaults to false.
fontstringNoFont name, max 255. null clears.
logo_urlstringNoHTTP logo URL, max 2048.
logo_square_urlstringNoHTTP square logo URL, max 2048.
brand_colorstringNoHex colour. See Colours.
background_colorstringNoHex colour.
text_colorstringNoHex colour.
card_background_colorstringNoHex colour.
card_text_colorstringNoHex colour.
border_colorstringNoHex colour.

Unknown keys return 422.

Example Request

curl -X POST "https://cart.easy.tools/api/v1/branding-themes" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Studio",
"brand_color": "#101828",
"background_color": "#f9fafb",
"text_color": "#101828",
"card_background_color": "#ffffff",
"card_text_color": "#101828",
"border_color": "#d0d5dd"
}'

Response

Success Response (201)

Returns the Branding Theme Object.

{
"id": "f670a72a-7a46-4853-9ebb-91ddf691358e",
"name": "Studio",
"is_default": false,
"font": null,
"logo_url": null,
"logo_square_url": null,
"brand_color": "#101828",
"background_color": "#f9fafb",
"text_color": "#101828",
"card_background_color": "#ffffff",
"card_text_color": "#101828",
"border_color": "#d0d5dd"
}

Error Responses

Validation Error (422 Unprocessable Entity)

Missing name:

{
"message": "The given data was invalid.",
"errors": {
"name": [
"This field is required."
]
}
}

A 3-digit colour:

{
"message": "The given data was invalid.",
"errors": {
"brand_color": [
"The brand color format is invalid."
]
}
}

Unknown keys also return 422 on that path.

Unauthorized Error (401)

{
"message": "Unauthenticated."
}

Forbidden Error (403)

{
"message": "You do not have API access to the requested store."
}