Update Product Styles
Sparse-update checkout appearance tokens. Only the keys you send are changed.
Unknown keys return 422.
Live writes return 409 when the product has has_draft: true — see
Live writes while a draft exists.
Updating a published product requires an active Easytools plan — see
Active plan required. Drafts can always be
updated. Overlay writes require draft_version and return it plus preview_url.
Colour, border_radius, and shadow writes detach any currently attached theme.
Sending only darkmode_enabled leaves the theme attached. See
Checkout appearance.
Request
Live:
PATCH /products/{id}/styles
Draft:
PATCH /products/{id}/draft/styles
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Product UUID |
Request Body
All fields optional except draft_version on the overlay path. Omit a key to
leave it unchanged. Send null on a colour to clear it.
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_color | string | No | Hex colour. See Colours. |
main_background_color | string | No | Page background colour. |
background_color | string | No | Description-panel colour. Distinct from main_background_color. |
text_color | string | No | Body text colour. |
card_background_color | string | No | Card background colour. |
card_text_color | string | No | Card text colour. |
border_color | string | No | Border colour. |
main_border_color | string | No | Main border colour. transparent turns it off. |
price_text_color | string | No | Price text colour. |
shadow_color | string | No | Shadow colour. transparent turns it off. |
border_radius | integer | No | Corner radius, 0–100. 0 turns it off. |
shadow_opacity | integer | No | Shadow opacity, 0–100. Required in this request when this patch sets shadow_color to a hex value. |
darkmode_enabled | boolean | No | Whether dark mode is on. |
draft_version | integer | Draft only | Current overlay version from Get Product Draft. Minimum 1. A mismatch returns 409. |
Example Request
curl -X PATCH "https://cart.easy.tools/api/v1/products/0632bef5-c308-42cd-9cba-89a7a4f722bb/styles" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"brand_color": "#111827",
"main_border_color": "transparent",
"darkmode_enabled": true
}'
Turn on a hex shadow — send shadow_opacity in the same request:
curl -X PATCH "https://cart.easy.tools/api/v1/products/0632bef5-c308-42cd-9cba-89a7a4f722bb/styles" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"shadow_color": "#111827",
"shadow_opacity": 3
}'
Draft update adds "draft_version": 10 to the body and uses /draft/styles.
Response
Success Response (200)
Live returns the Styles Object. Draft returns that
object plus draft_version and preview_url.
{
"brand_color": "#111827",
"main_background_color": null,
"background_color": null,
"text_color": null,
"card_background_color": null,
"card_text_color": null,
"border_color": null,
"main_border_color": "transparent",
"price_text_color": null,
"shadow_color": null,
"border_radius": null,
"shadow_opacity": null,
"darkmode_enabled": true
}
Error Responses
Bad Request (400)
{
"message": "Invalid product ID"
}
Product Not Found (404)
{
"message": "Product with ID 0632bef5-c308-42cd-9cba-89a7a4f722bb not found"
}
Conflict Error (409 — Unpublished Draft)
Live write while has_draft is true:
{
"message": "This product has an unpublished draft. Publish, unpublish, or delete the draft before making live changes."
}
Conflict Error (409 — Stale Draft Version)
Draft write when draft_version does not match:
{
"message": "The draft was edited elsewhere. GET the draft and retry with the current draft_version."
}
Validation Error (422 Unprocessable Entity)
{
"message": "The given data was invalid.",
"errors": {
"brand_color": [
"The brand_color must be transparent or a # hex colour with 3 to 6 digits."
]
}
}
Unknown keys, shadow_opacity out of 0–100, and a hex shadow_color without
shadow_opacity in the same patch also return 422. See
Checkout appearance.
Publishing Not Allowed (422 — No Active Plan)
Live write against a published product when the store has no active Easytools plan. Overlay writes are not gated this way.
{
"message": "Product cannot be published without an active Easytools plan"
}