Replace checkout block
Replaces a checkout block's content.
The block keeps its id, variation, template, and position. Everything else comes from the request: name, variables, and styles are required, and every field you leave out, at any depth, resets to the template's value rather than keeping its saved value. A list you send, such as a trust badge's items or an FAQ block's questions, replaces the template's list whole.
To change a few settings, GET the block and copy its name, variables, and styles into the request with your changes. Don't send the whole block back: the body is strict, so the read-only fields GET returns (id, variationId, locationId, blockTemplate) are rejected. GET also returns displayConditions and upsellProductRules in their stored, compiled form, which this endpoint doesn't accept. Leave both out to keep them as they are, or send the condition-list form that POST takes to replace them. Also remove an upsell's variables.discount when you copy it: discounts can't be sent with an API key.
A postPurchaseUpsell block is the exception: its PUT merges the fields you send onto the saved block, and returns adjustments listing anything the API changed on its own to keep the offer valid.
Required Fields
- blockType (string) — Must match the saved block's type. A block's type can't be changed.
- name (string) — Display name in the dashboard
- variables (object) — The block's content settings. Fields you leave out reset to the template's values.
- styles (object) — The block's style settings. Fields you leave out reset to the template's values.
Optional Fields
- displayConditions (object or null) — Omit it to keep the current conditions, send null to remove them, or send a condition list (the same form as POST) to replace them. Not accepted for postPurchaseUpsell.
- upsellProductRules (array or null) — Omit it to keep the current rules, send null to remove them, or send a list of rules (the same form as POST) to replace them. upsell and postPurchaseUpsell only.
Response
{ "block": { ... } }, with the saved block, plus adjustments for a postPurchaseUpsell block.
Important Notes
- The block must belong to the experience in the path, or the request returns a 404.
- A PUT never changes a block's discount. The block keeps the discount saved in Intelligems, and a request that sends one (an upsell's variables.discount, a rule's discount, or a post-purchase upsell's discountType or discountValue) returns a 400.
- If a block has a discount, whether on the block or on its saved rules, a PUT can't change who gets it. Sending upsellProductRules or displayConditions (a list or null) returns a 400, and so does changing maxProductLimit, excludeItemsInCart, or a post-purchase upsell's maxQuantityType or maxQuantity. Leave the rules and conditions out to keep them, and send the other fields as GET returns them. To change any of them, edit the block in Intelligems.
- A timer's resetTimezone is optional. The API sets it to the store's timezone, replacing any value you send. If the store has no timezone, the API keeps the one you send, and a recurring timer sent without one returns a 400. A zone you send has to be an IANA name, such as America/New_York: one that isn't returns a 400.
- Updating a postPurchaseUpsell block doesn't re-check that the store is ready for post-purchase upsells. Only adding one does.
- Changes to a running experience take effect for shoppers immediately.
Rate Limit: 50 requests per 30s window, refilling 25 tokens every 30s.
Request
- Base URLhttps://api.intelligems.io
- AuthAPI key in header intelligems-access-token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The experience the checkout block belongs to.
The checkout block to act on. Copy it from the GET response.
Request body
Response
OK
Changes
No recorded changes to this operation across all 1 revision of this API.