{ "opencollection": "1.0.0", "info": { "name": "Admin Account / Address Promotions API", "version": "v3" }, "items": [ { "info": { "name": "Promotions", "type": "folder" }, "items": [ { "info": { "name": "List coupon codes for a promotion", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/coupon_codes", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the auto-generated coupon codes for a multi-code promotion. Single-code promotions store the code on the promotion itself; this endpoint returns an empty list for them.\n\n**Required scope:** `read_promotions` (for API-key authentication)." }, { "info": { "name": "List actions for a promotion", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_actions", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "**Required scope:** `read_promotions` (for API-key authentication)." }, { "info": { "name": "Create an action on a promotion", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_actions", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "Delete an action from a promotion", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_actions/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" }, { "name": "id", "value": "", "type": "path" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "**Required scope:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "List rules for a promotion", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_rules", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "**Required scope:** `read_promotions` (for API-key authentication)." }, { "info": { "name": "Create a rule on a promotion", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_rules", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "Update a rule's preferences", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_rules/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" }, { "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_promotions` (for API-key authentication)." }, { "info": { "name": "Delete a rule from a promotion", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/promotions/:promotion_id/promotion_rules/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "promotion_id", "value": "", "type": "path" }, { "name": "id", "value": "", "type": "path" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "**Required scope:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "List promotions", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotions", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication)." }, { "info": { "name": "Create a promotion", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/promotions", "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 promotion. `code` is required for single-code coupon promotions;\npass `multi_codes: true` with `number_of_codes` to auto-generate a batch.\n\nRules and actions can be created in the same request by passing arrays of\n`{ type, preferences, ... }` rows. The server reconciles to the desired set:\nnew rows are built, existing rows (by `id`) are updated, omitted rows are removed.\n\n\n**Required scope:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "Show a promotion", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotions/: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_promotions` (for API-key authentication)." }, { "info": { "name": "Update a promotion", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/promotions/: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 promotion. The `rules` and `actions` arrays are treated as\na *desired set* — rows with `id` update in place, rows without `id` are\nbuilt fresh, and any existing row not present in the array is destroyed.\nPass `rules: []` or `actions: []` to clear them.\n\n\n**Required scope:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "Delete a promotion", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/promotions/: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:** `write_promotions` (for API-key authentication)." }, { "info": { "name": "List available promotion action types", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotion_actions/types", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the registered Spree::PromotionAction subclasses with their preference schemas. Used by admin UIs to populate the \"Add action\" picker and render generic preference forms.\n\n**Required scope:** `read_promotions` (for API-key authentication)." }, { "info": { "name": "List available promotion rule types", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/promotion_rules/types", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication)." }, { "info": { "name": "Return a list of Promotions", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/platform/promotions", "params": [ { "name": "page", "value": "1", "type": "query" }, { "name": "per_page", "value": "50", "type": "query" }, { "name": "include", "value": "promotion_category,promotion_rules,promotion_actions,stores", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" }, { "name": "filter[code_eq]", "value": "BLK-FRI", "type": "query" }, { "name": "filter[name_cont]", "value": "New Customer", "type": "query" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Returns a list of Promotions" }, { "info": { "name": "Create a Promotion", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v2/platform/promotions", "params": [ { "name": "include", "value": "promotion_category,promotion_rules,promotion_actions,stores", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Creates a Promotion" }, { "info": { "name": "Return a Promotion", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/platform/promotions/:id", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "promotion_category,promotion_rules,promotion_actions,stores", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Returns a Promotion" }, { "info": { "name": "Update a Promotion", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/promotions/:id", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "promotion_category,promotion_rules,promotion_actions,stores", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Updates a Promotion" }, { "info": { "name": "Delete a Promotion", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v2/platform/promotions/:id", "params": [ { "name": "id", "value": "", "type": "path" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Deletes a Promotion" } ] } ], "bundled": true }