{ "opencollection": "1.0.0", "info": { "name": "Admin Account / Address Markets API", "version": "v3" }, "items": [ { "info": { "name": "Markets", "type": "folder" }, "items": [ { "info": { "name": "List markets", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/markets", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "page", "value": "", "type": "query" }, { "name": "limit", "value": "", "type": "query" }, { "name": "q[name_cont]", "value": "", "type": "query" }, { "name": "sort", "value": "", "type": "query" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to embed. Supported: `countries`." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the markets configured for the current store. Markets are\nstore-scoped and ordered by `position` (an `acts_as_list` column —\nupdate the order via `PATCH /markets/{id}` with `position`).\n\n\n**Required scope:** `read_settings` (for API-key authentication)." }, { "info": { "name": "Create a market", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/markets", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Creates a new market for the current store.\n\n- `country_isos` accepts 2-letter ISO country codes (e.g. `[\"DE\", \"FR\"]`);\n the market must contain at least one country. Unknown codes are\n silently dropped.\n- `supported_locales` accepts an array of locale codes; the\n `default_locale` is always implicitly included.\n- Setting `default: true` automatically demotes the previous default\n market in the store.\n\n\n**Required scope:** `write_settings` (for API-key authentication)." }, { "info": { "name": "Get a market", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/markets/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "expand", "value": "", "type": "query" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "**Required scope:** `read_settings` (for API-key authentication)." }, { "info": { "name": "Update a market", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/markets/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Updates an existing market. Pass `country_isos` to replace the\nmarket's country list (full-set update), `supported_locales` to\nreplace the supported locales, or `position` to reorder the market\nwithin the store.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_settings` (for API-key authentication)." }, { "info": { "name": "Delete a market", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/markets/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Soft-deletes the market (sets `deleted_at`). The default market and\nthe last remaining market in a store cannot be deleted — both return\n422 with a `validation_error`.\n\n\n**Required scope:** `write_settings` (for API-key authentication)." }, { "info": { "name": "List countries", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/countries", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns countries available in the store. Use ?expand=market to include market details (currency, locale, tax_inclusive)." }, { "info": { "name": "Get a country", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/countries/:iso", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "iso", "value": "", "type": "path", "description": "Country ISO 3166-1 alpha-2 code (e.g., \"US\", \"DE\")" }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns a single country by ISO code. Supports ?expand=states for address forms and ?expand=market for market details." }, { "info": { "name": "List supported currencies", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/currencies", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns currencies supported by the store (derived from markets)" }, { "info": { "name": "List supported locales", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/locales", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns locales supported by the store (derived from markets)" }, { "info": { "name": "List markets", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/markets", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns all markets for the current store with their countries, currency, locales, and tax configuration." }, { "info": { "name": "Get a market", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/markets/:id", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Market prefixed ID (e.g., \"mkt_k5nR8xLq\")" }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns a single market by prefixed ID with its countries, currency, locales, and tax configuration." }, { "info": { "name": "Resolve market by country", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/markets/resolve", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "country", "value": "", "type": "query", "description": "Country ISO 3166-1 alpha-2 code (e.g., \"DE\", \"US\")" }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Determine which market applies for a given country ISO code. Useful for auto-selecting the correct currency and locale when a customer's location is known." }, { "info": { "name": "List countries in a market", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/markets/:market_id/countries", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "market_id", "value": "", "type": "path", "description": "Market prefixed ID" }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns countries belonging to a specific market. Use this for address form country dropdowns during checkout." }, { "info": { "name": "Get a country in a market", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/markets/:market_id/countries/:id", "headers": [ { "name": "x-spree-api-key", "value": "" } ], "params": [ { "name": "market_id", "value": "", "type": "path", "description": "Market prefixed ID" }, { "name": "id", "value": "", "type": "path", "description": "Country ISO 3166-1 alpha-2 code (e.g., \"DE\")" }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., name,slug,price). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns a single country by ISO code within a market. Supports ?expand=states for address forms." } ] } ], "bundled": true }