{ "opencollection": "1.0.0", "info": { "name": "Admin Account / Address Products API", "version": "v3" }, "items": [ { "info": { "name": "Products", "type": "folder" }, "items": [ { "info": { "name": "List product custom fields", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/products/:product_id/custom_fields", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "product_id", "value": "", "type": "path" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels)." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., key,value,namespace). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns the product's custom field values.\n\n**Required scope:** `read_products` (for API-key authentication)." }, { "info": { "name": "Create a product custom field", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/products/:product_id/custom_fields", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "product_id", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Sets a custom field value on the product. Requires an existing CustomFieldDefinition; pass its prefixed `cfdef_…` id.\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Show a product custom field", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/products/:product_id/custom_fields/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "product_id", "value": "", "type": "path" }, { "name": "id", "value": "", "type": "path" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels)." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., key,value,namespace). id is always included." } ], "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 product custom field", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/products/:product_id/custom_fields/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "product_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": "Updates the custom field's `value`. The linked definition cannot be changed — delete and recreate to switch.\n\n**Required scope:** `write_products` (for API-key authentication)." }, { "info": { "name": "Delete a product custom field", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/products/:product_id/custom_fields/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "product_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_products` (for API-key authentication)." }, { "info": { "name": "Return a list of Products", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/platform/products", "params": [ { "name": "page", "value": "1", "type": "query" }, { "name": "per_page", "value": "50", "type": "query" }, { "name": "include", "value": "prices", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" }, { "name": "filter[name_eq]", "value": "Green Toy Boat", "type": "query" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Returns a list of Products" }, { "info": { "name": "Create a Product", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v2/platform/products", "params": [ { "name": "include", "value": "prices", "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 Product" }, { "info": { "name": "Return a Product", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/platform/products/:id", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "prices", "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 Product" }, { "info": { "name": "Update a Product", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/products/:id", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "prices", "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 Product" }, { "info": { "name": "Delete a Product", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v2/platform/products/:id", "params": [ { "name": "id", "value": "", "type": "path" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Deletes a Product" }, { "info": { "name": "List all Products", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/storefront/products", "params": [ { "name": "filter[ids]", "value": "1,2,3", "type": "query", "description": "Fetch only resources with corresponding IDs" }, { "name": "filter[skus]", "value": "SKU-123,SKU-345", "type": "query", "description": "Fetch only resources with corresponding SKUs" }, { "name": "filter[price]", "value": "10,100", "type": "query", "description": "Filter Products based on price (minimum, maximum range)" }, { "name": "filter[taxons]", "value": "1,2,3,4,5,6,7,8,9,10,11", "type": "query", "description": "Filter Products based on taxons (IDs of categories, brands, etc)" }, { "name": "filter[vendor_ids]", "value": "bb492c7d-c174-4e6b-ba0b-fe98d5c17307,51c35adb-7ab3-4880-8887-35bdc4f6c29f", "type": "query", "description": "Fetch products from specified Vendors (Sellers) - only available in [Enterprise Edition](https://spreecommerce.org/pricing)" }, { "name": "filter[name]", "value": "rails", "type": "query", "description": "Find Products with matching name (supports wild-card, partial-word match search)" }, { "name": "filter[options][tshirt-color]", "value": "Red", "type": "query", "description": "Find Products with Variants that have the specified option (eg. color, size) and value (eg. red, XS)" }, { "name": "filter[properties][brand-name]", "value": "alpha", "type": "query", "description": "Find Products with Property Brand Name with value Alpha" }, { "name": "filter[show_deleted]", "value": "true", "type": "query", "description": "Returns also deleted products" }, { "name": "filter[show_discontinued]", "value": "true", "type": "query", "description": "Returns also discontinued products" }, { "name": "filter[in_stock]", "value": "true", "type": "query", "description": "Returns only in stock products" }, { "name": "filter[backorderable]", "value": "true", "type": "query", "description": "Returns only backorderable products" }, { "name": "filter[purchasable]", "value": "true", "type": "query", "description": "Returns only in stock or backorderable products" }, { "name": "sort", "value": "-updated_at,price,-name,created_at,-available_on,sku", "type": "query", "description": "Sort products based on: Use - sign to set descending sort, eg. -updated_at" }, { "name": "page", "value": "1", "type": "query", "description": "Number of requested page when paginating collection" }, { "name": "per_page", "value": "25", "type": "query", "description": "Number of requested records per page when paginating collection" }, { "name": "include", "value": "default_variant,variants,option_types,product_properties,taxons,images,primary_variant", "type": "query", "description": "Specify what related resources (relationships) you would like to receive in the response body. Eg.\n\n```\ndefault_variant,variants,option_types,product_properties,taxons,images,primary_variant\n```\n\n[More information](https://jsonapi.org/format/#fetching-includes)" }, { "name": "fields[product]", "value": "price,description,name", "type": "query", "description": "Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets)." }, { "name": "image_transformation[size]", "value": "100x50", "type": "query", "description": "Specifies dimensions for included images at transformed_url attribute." }, { "name": "image_transformation[quality]", "value": "70", "type": "query", "description": "Specifies quality for included images at transformed_url attribute" } ] }, "docs": "Returns a list of products for the current Store." }, { "info": { "name": "Retrieve a Product", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/storefront/products/:product_slug", "params": [ { "name": "product_slug", "value": "knitted-high-neck-sweater", "type": "path", "description": "Product Slug" }, { "name": "include", "value": "default_variant,variants,option_types,product_properties,taxons,images,primary_variant", "type": "query", "description": "Specify what related resources (relationships) you would like to receive in the response body. Eg.\n\n```\ndefault_variant,variants,option_types,product_properties,taxons,images,primary_variant\n```\n\n[More information](https://jsonapi.org/format/#fetching-includes)" }, { "name": "fields[product]", "value": "price,description,name", "type": "query", "description": "Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets)." }, { "name": "image_transformation[size]", "value": "100x50", "type": "query", "description": "Specifies dimensions for included images at transformed_url attribute." }, { "name": "image_transformation[quality]", "value": "70", "type": "query", "description": "Specifies quality for included images at transformed_url attribute" } ] }, "docs": "Returns Product details. You can use product permalink:\n\n```\nGET /api/v2/storefront/products/knitted-high-neck-sweater\n```\n\nOr Product ID:\n\n```\nGET /api/v2/storefront/products/21\n```\n\n**Note** API will attempt a permalink lookup before an ID lookup." } ] } ], "bundled": true }