Skip to main content

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

ParameterTypeRequiredDescription
idstringYesProduct 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.

ParameterTypeRequiredDescription
brand_colorstringNoHex colour. See Colours.
main_background_colorstringNoPage background colour.
background_colorstringNoDescription-panel colour. Distinct from main_background_color.
text_colorstringNoBody text colour.
card_background_colorstringNoCard background colour.
card_text_colorstringNoCard text colour.
border_colorstringNoBorder colour.
main_border_colorstringNoMain border colour. transparent turns it off.
price_text_colorstringNoPrice text colour.
shadow_colorstringNoShadow colour. transparent turns it off.
border_radiusintegerNoCorner radius, 0–100. 0 turns it off.
shadow_opacityintegerNoShadow opacity, 0–100. Required in this request when this patch sets shadow_color to a hex value.
darkmode_enabledbooleanNoWhether dark mode is on.
draft_versionintegerDraft onlyCurrent 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"
}