{ "opencollection": "1.0.0", "info": { "name": "Admin Account / Address Pricing API", "version": "v3" }, "items": [ { "info": { "name": "Pricing", "type": "folder" }, "items": [ { "info": { "name": "List price lists", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/price_lists", "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": "q[status_eq]", "value": "", "type": "query" }, { "name": "sort", "value": "", "type": "query" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to embed. Supported: `price_rules`." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication)." }, { "info": { "name": "Create a price list", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/price_lists", "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 draft price list.\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Get a price list", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/price_lists/: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_products` (for API-key authentication)." }, { "info": { "name": "Update a price list", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/price_lists/: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 a price list. The optional `rules:` array reconciles nested\nSTI-typed price rules in a single round-trip — existing rules update\nby `id`, new rules build, missing rules destroy. Mirrors the\npromotion editor's \"save the whole thing on Save\" pattern.\n\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Delete a price list", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/price_lists/: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 price list. Associated prices are removed asynchronously.\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Activate a price list", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/price_lists/:id/activate", "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": "Transitions a draft / inactive list to `active`. If `starts_at` is\nin the future the list is marked `scheduled` instead, matching the\nlegacy admin behaviour.\n\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Deactivate a price list", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/price_lists/:id/deactivate", "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": "**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "List prices", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/prices", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "page", "value": "", "type": "query" }, { "name": "limit", "value": "", "type": "query" }, { "name": "q[price_list_id_eq]", "value": "", "type": "query" }, { "name": "q[price_list_id_null]", "value": "", "type": "query" }, { "name": "q[currency_eq]", "value": "", "type": "query" }, { "name": "q[variant_id_eq]", "value": "", "type": "query" }, { "name": "sort", "value": "", "type": "query", "description": "Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`." }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to embed. Supported: `variant`." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Generic prices endpoint covering both base prices and price-list\noverrides. Filter with Ransack: `q[price_list_id_eq]=…`,\n`q[currency_eq]=USD`, `q[price_list_id_null]=true` (base prices only).\n\nThe admin spreadsheet uses this with server-side pagination so it\nscales past the metadata-PATCH path on `/price_lists/:id`.\n\n\n**Required scope:** `read_products` (for API-key authentication)." }, { "info": { "name": "Create a price", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/prices", "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 single price. Omit `price_list_id` to create a base price.\nFor more than a handful of rows, prefer `POST /admin/prices/bulk_upsert`.\n\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Get a price", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/prices/: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": "**Required scope:** `read_products` (for API-key authentication)." }, { "info": { "name": "Update a price", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/prices/: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": "**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Delete a price", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/prices/: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 price (acts_as_paranoid).\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Bulk-upsert prices", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/prices/bulk_upsert", "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": "Upserts a batch of prices in a single SQL round trip.\n\nEach row either:\n* targets an existing price by `id`, OR\n* matches on the unique key `(variant_id, currency, price_list_id)` —\n updating the existing row if one exists, creating one otherwise.\n\nModel callbacks (e.g. PriceHistory) are bypassed; this is a\nbulk-write fast path for the admin spreadsheet. The response\ncarries `price_count` — the number of rows touched.\n\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Bulk-delete prices", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/prices/bulk_destroy", "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": "Soft-deletes each price in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication)." } ] } ], "bundled": true }