Store
update_store
destructive writeUpdate store
Change the Store details or the Customiser Links page, one section at a time.
Overview
Applies a JSON merge patch to one section of the connected Store. The store section holds the Store name, contact email, website, primary colour, branded emails setting and the zero-price product guard, and on a Universal Store also the currency and its two display formats. The customiser_links section holds the hosted Customiser Links page: whether it is on, its Back to Store address and its background colour. Only the fields present change, and a field the section does not accept is refused. Units are not patchable here: use review_store_unit_switch and switch_store_units. Logos are changed with attach_store_logo and delete_store_logo. It requires the store:write scope, takes an optional idempotency_key for replay, and supports dry_run.
Permission
Requires thestore:writepermission. A connection without it answersinsufficient_scopenaming the permission to approve.
Annotations
Prerequisites
- The current values: get_store for the store section, get_customiser_links for the customiser_links section.
- A merchant has connected this store and approved the store:write scope.
Side effects
- Changes the named section of the connected Store.
- A new name, contact email or primary colour shows in emails sent after the change.
Arguments
Which document to patch: store for the Store details, customiser_links for the hosted Customiser Links page.
One of: store, customiser_links
The RFC 7396 merge patch to apply. Only the members present change; a member set to null clears a nullable field. store accepts name, contact_email, website_url, primary_colour, use_branding_for_emails and prevent_zero_price_products, and on a Universal Store also currency, currency_format_with_code and currency_format_without_code. customiser_links accepts enabled, return_url and theme_colour.
An optional client-generated key unique to this logical write, such as a UUID. Repeating the call with the same key and the same arguments replays the original result; the route does not require one.
When true, the patch is checked against the section schema is checked and nothing is written: the result is the same verdict the apply would have reached, and a problem the apply would have raised comes back as the same tool error. Defaults to false. A dry run claims no key.
Result
The patched section as it now stands: the Store for store, the Customiser Links page for customiser_links. A dry run returns the update verdict instead and writes nothing.
The section the patch was applied to.
One of: store, customiser_links
The Store as get_store reads it, present only when section was store.
The Customiser Links page as get_customiser_links reads it, present only when section was customiser_links.
Present and true only when dry_run was requested.
Present only on a dry run, and always true: a failing dry run returns a tool error instead.
Present only on a dry run: the update verdict.
True when this call replayed a previously recorded response for the same idempotency_key instead of applying the write again.
Error cases
The connection was approved without store:write. Ask the merchant to reconnect and approve it, or to remove the connector and add it again if the approval screen does not offer it.
The patch names a field this section does not have. Remove the field named by pointer.
A value is out of range or the wrong type, a read-only field such as measurement_unit or logo_url was sent, or a currency field was sent for a Shopify Store, whose currency comes from Shopify.
Change the contact email
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "update_store",
"arguments": {
"section": "store",
"patch": {
"contact_email": "orders@demosigns.example"
}
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"structuredContent": {
"request_id": "req_01jz9x2k7c8f3m5n6p7q8r9s0t",
"store": {
"id": 12,
"name": "Demo Signs"
},
"idempotent_replay": false,
"section": "store",
"store_details": {
"id": 12,
"name": "Demo Signs",
"platform": "universal",
"currency": "GBP",
"contact_email": "orders@demosigns.example",
"website_url": "https://demosigns.example",
"primary_colour": "#1A73E8",
"use_branding_for_emails": true,
"logo_url": null,
"prevent_zero_price_products": true
}
}
}
}Units are not patchable (error)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "update_store",
"arguments": {
"section": "store",
"patch": {
"measurement_unit": "cm"
}
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"result": {
"isError": true,
"structuredContent": {
"error": {
"code": "validation_failed",
"title": "Validation failed",
"detail": "The request payload failed validation.",
"recovery": "Correct every field listed in errors, using its pointer to locate the value and allowed_values where one is given, then call the tool again.",
"pointer": "/measurement_unit"
}
}
}
}