# PATCH /stores/:store_id

**Resource:** [Stores](./stores.md)  
**MCP tool:** `update_store`  
**Scopes:** `ecommerce:write`  
**Write operation:** yes

Update an ecommerce store (name, branding, currency, tax, fulfillment pipeline, etc.).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `store_id` | path | string | yes |  |
| `name` | body | string | no |  |
| `slug` | body | string | no |  |
| `is_active` | body | boolean | no |  |
| `currency` | body | string | no |  |
| `tax_inclusive` | body | boolean | no |  |
| `tax_rate` | body | number | no |  |
| `branding` | body | object | no |  |
| `shipping_settings` | body | object | no | Delivery, postage and tax rules. Four optional keys, all set from the store's "Delivery and tax" card. allowed_countries: array of two-letter country codes the buyer may pick as a delivery destination (UI label "Countries you deliver to"); defaults to ["AU"]. domestic_country: two-letter code for where the store is based (UI label "Your home country"); defaults to the first allowed_countries entry, else "AU". export_tax_rate: percentage applied INSTEAD OF tax_rate when an order is delivered outside domestic_country (UI label "Overseas tax rate (%)"). Set export_tax_rate to 0 for a GST-free export, e.g. an Australian store posting goods overseas. Omit export_tax_rate entirely and every order keeps the store-wide tax_rate regardless of destination, which is the pre-existing behaviour. The destination is taken from the order's delivery address: from the `shipping` object your storefront posts on create-checkout when it collects the address itself, otherwise from the address the payment provider collects, in which case the tax is corrected when the payment reconciles. shipping_rates: postage charged as its own line, an object of two-letter country code to amount plus an optional "default" for anywhere without its own rate (UI label "Charge postage as a separate line"), e.g. {"AU": 12.50, "NZ": 24, "default": 30}. Omit shipping_rates and no postage is charged, shipping_total stays 0, and freight has to be built into the item prices, which is the pre-existing behaviour. Postage is taxed at the same destination-aware rate as the items, so a GST-free export pays no tax on its freight either, and it requires collect_shipping_address to be true. A per-country amount is only exact when your storefront posts the delivery address itself; on payment-provider-hosted checkout the destination is not known until after the amount is set, so "default" is charged, and unlike tax it cannot be corrected afterwards. |
| `checkout_settings` | body | object | no |  |
| `collect_shipping_address` | body | boolean | no | UI label "Collect delivery address at checkout". Ask the buyer for a delivery address at checkout. Turn this on for a store that posts physical goods, so a paid-order automation can print a packing slip; leave it off for a digital store so checkout does not demand an address nobody reads. |
| `fulfillment_pipeline_id` | body | string | no |  |
| `fulfillment_stage_id` | body | string | no |  |
| `auto_create_opportunity` | body | boolean | no |  |
| `email_config_id` | body | string | no |  |
| `website_id` | body | string | no |  |
| `opportunity_name_template` | body | string | no | UI label "Opportunity name". What to call the opportunity created for a paid order. Set on the "Order opportunities" card of the store settings page (/growth/ecommerce/:id, Manage > Settings). Leave it empty and every order card is named "Order ORD-...", which is the pre-existing behaviour and what every store does today. Set it to name the card after something the workspace actually uses, e.g. "{{deal.metadata.job_number}} - {{customer_name}}" for a lab that keys its reports and invoices on a job number. Tokens: {{order_number}}, {{customer_name}}, {{customer_email}}, {{customer_phone}}, {{store_name}}, {{amount}}, {{currency}}, {{item_count}}, {{items_line}} (what was ordered, on one line), {{items_text}} (one item per line, avoid in a name), {{shipping_name}}, {{shipping_text}}, {{shipping_address.city}} and the other address parts, plus {{deal.metadata.<custom_field_id>}} for any opportunity custom field. The same token names the store_order_paid trigger publishes, so a template reads like the paid-order email a workspace has already written. The opportunity custom fields resolve because the name is applied AFTER the opportunity exists, so an Auto Number field with "Generate automatically" on has already minted its number. Applied only to a NEWLY created opportunity: an order matched to an existing opportunity never gets renamed. A token that resolves to nothing renders as empty, and a template that renders to nothing at all falls back to "Order <order_number>" rather than leaving a card unnamed. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/stores/:store_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","slug":"...","is_active":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`