Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Give marketplace owners a way to run their sellers
Damian Legawiec0562d8ef1b9f
diff --git a/docs/api-reference/admin.yaml b/docs/api-reference/admin.yamlindex c8ae23a955..750ef1b26e 100644--- a/docs/api-reference/admin.yaml+++ b/docs/api-reference/admin.yaml@@ -92,16 +92,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjA0Y2VhYTJlLWMxNjctNDM4NS04MWJmLWVjYTg3NjJiOTBlNiIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODAyNjg3fQ.lhtQDCTRiSW46KgjkpeMIWHWyWKS-7xpF6xoKo65MRo+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjNhYTQwNTFiLWM4MzgtNDE3NC04MWQ4LTk1ODZjY2RjZjRhOCIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODkxNDgyfQ.O-HRMQkVcR491cz5H8VfkHZPZlNphaXX5Tyn7tL-WVsuser:id: adm_UkLWZg9DAJemail: [email protected]- first_name: Loraine- last_name: Bergstrom- full_name: Loraine Bergstrom+ first_name: Tatyana+ last_name: Abshire+ full_name: Tatyana Abshireselected_locale:- created_at: '2026-08-15T13:59:47.391Z'- updated_at: '2026-08-15T13:59:47.391Z'+ created_at: '2026-08-16T14:39:42.140Z'+ updated_at: '2026-08-16T14:39:42.140Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -204,16 +204,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjNjNDg2Yjk5LTRjNmItNDQyNS1hN2UyLTQxMWVmZDU5ZWNjMSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODAyNjg3fQ.kq5uKDDmue61EC-W0MHvQzugQHu-t_9NqeP02CONOpQ+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjhjM2UxZTIwLWE0NDYtNDdjNC05NWM0LWUxYzYwZjg5MGNmNiIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODkxNDgyfQ.It4bFSO9lyzGwXDu9nDWZ2CwyyvQeFnJdHjTNs6PCjQuser:id: adm_UkLWZg9DAJemail: [email protected]- first_name: Valrie- last_name: Bosco- full_name: Valrie Bosco+ first_name: Neva+ last_name: Halvorson+ full_name: Neva Halvorsonselected_locale:- created_at: '2026-08-15T13:59:47.456Z'- updated_at: '2026-08-15T13:59:47.456Z'+ created_at: '2026-08-16T14:39:42.202Z'+ updated_at: '2026-08-16T14:39:42.202Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -315,13 +315,13 @@ paths:example:user:id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Mei- last_name: McClure- full_name: Mei McClure+ email: [email protected]+ first_name: Amber+ last_name: Miller+ full_name: Amber Millerselected_locale:- created_at: '2026-08-15T13:59:53.609Z'- updated_at: '2026-08-15T13:59:53.609Z'+ created_at: '2026-08-16T14:39:48.106Z'+ updated_at: '2026-08-16T14:39:48.106Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -372,6 +372,10 @@ paths:- write_api_keys- read_staff- write_staff+ - read_vendors+ - write_vendors+ - read_vendor_profile+ - write_vendor_profile- read_dashboardschema:"$ref": "#/components/schemas/MeResponse"@@ -432,13 +436,13 @@ paths:example:user:id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Kandy- last_name: Watsica- full_name: Kandy Watsica+ email: [email protected]+ first_name: Nancey+ last_name: Kunze+ full_name: Nancey Kunzeselected_locale: de- created_at: '2026-08-15T13:59:53.643Z'- updated_at: '2026-08-15T13:59:53.651Z'+ created_at: '2026-08-16T14:39:48.154Z'+ updated_at: '2026-08-16T14:39:48.165Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -489,6 +493,10 @@ paths:- write_api_keys- read_staff- write_staff+ - read_vendors+ - write_vendors+ - read_vendor_profile+ - write_vendor_profile- read_dashboardschema:"$ref": "#/components/schemas/MeResponse"@@ -626,16 +634,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImE2ZDk0M2ZjLTEzNzMtNGNmNS1hZWZmLTQyMmNmZjc3MDEyYyIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODA2MDAwfQ.VohhzjHQo0yygCOIgb8av9Lv9UUthTblbDYWAezL8Iw+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImVhZWUyNDRhLTM3NTYtNDFlYy1iNjIzLTQ2MWY1ODk2YzdlYSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODk0Nzk2fQ.CwVZHqe70tp_sj6DERauKFw9gB_VLZHTVy1PdLZOPWMuser:id: adm_UkLWZg9DAJemail: [email protected]- first_name: Kira- last_name: Kulas- full_name: Kira Kulas+ first_name: Dion+ last_name: Ward+ full_name: Dion Wardselected_locale:- created_at: '2026-08-15T14:00:00.893Z'- updated_at: '2026-08-15T14:00:00.907Z'+ created_at: '2026-08-16T14:39:56.008Z'+ updated_at: '2026-08-16T14:39:56.024Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -704,7 +712,7 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImRmZjU1NGE4LTgwNzktNDM5MS1hYmM1LTJjOTY5OGMxYjI2ZiIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODAyNzA1fQ.ig9oC3ysl2yHbbrafi2KEbTmZM295PHH9iTm1Jb40Lo+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjFkYTVlYjdkLWIwMTgtNDU4MS04MWQzLWQzNGJiYzNjY2NiOSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2ODkxNTAxfQ.O33kA1oUnQfAeLo8wAnn-0WvOe260A1gAGl9XEdSJ2wuser:id: adm_UkLWZg9DAJemail: [email protected]@@ -712,8 +720,8 @@ paths:last_name: Ownerfull_name: Olivia Ownerselected_locale:- created_at: '2026-08-15T14:00:05.735Z'- updated_at: '2026-08-15T14:00:05.735Z'+ created_at: '2026-08-16T14:40:01.221Z'+ updated_at: '2026-08-16T14:40:01.221Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -2190,8 +2198,8 @@ paths:data:- id: ao_UkLWZg9DAJorigin: https://shop.example.com- created_at: '2026-08-15T13:59:46.943Z'- updated_at: '2026-08-15T13:59:46.943Z'+ created_at: '2026-08-16T14:39:41.705Z'+ updated_at: '2026-08-16T14:39:41.705Z'meta:page: 1limit: 25@@ -2275,8 +2283,8 @@ paths:example:id: ao_gbHJdmfrXBorigin: https://admin.example.com- created_at: '2026-08-15T13:59:46.998Z'- updated_at: '2026-08-15T13:59:46.998Z'+ created_at: '2026-08-16T14:39:41.766Z'+ updated_at: '2026-08-16T14:39:41.766Z'schema:"$ref": "#/components/schemas/AllowedOrigin"'422':@@ -2363,8 +2371,8 @@ paths:example:id: ao_UkLWZg9DAJorigin: https://shop.example.com- created_at: '2026-08-15T13:59:47.072Z'- updated_at: '2026-08-15T13:59:47.072Z'+ created_at: '2026-08-16T14:39:41.799Z'+ updated_at: '2026-08-16T14:39:41.799Z'schema:"$ref": "#/components/schemas/AllowedOrigin"'404':@@ -2425,8 +2433,8 @@ paths:example:id: ao_UkLWZg9DAJorigin: https://www.example.com- created_at: '2026-08-15T13:59:47.129Z'- updated_at: '2026-08-15T13:59:47.143Z'+ created_at: '2026-08-16T14:39:41.851Z'+ updated_at: '2026-08-16T14:39:41.868Z'schema:"$ref": "#/components/schemas/AllowedOrigin"'422':@@ -2546,34 +2554,34 @@ paths:key_type: publishabletoken_prefix:scopes: []- created_at: '2026-08-15T13:59:47.203Z'- updated_at: '2026-08-15T13:59:47.203Z'+ created_at: '2026-08-16T14:39:41.954Z'+ updated_at: '2026-08-16T14:39:41.954Z'revoked_at:last_used_at:channel_id:- plaintext_token: pk_2CampmpZijWULeKxnNhf9KE2+ plaintext_token: pk_rwg6cArR94TEmcp3PyvzkkP4created_by_email:- id: key_gbHJdmfrXBname: Backend integrationkey_type: secret- token_prefix: sk_xn9kxh9br+ token_prefix: sk_SRufRXDQ3scopes:- write_all- created_at: '2026-08-15T13:59:47.204Z'- updated_at: '2026-08-15T13:59:47.204Z'+ created_at: '2026-08-16T14:39:41.955Z'+ updated_at: '2026-08-16T14:39:41.955Z'revoked_at:last_used_at:channel_id:plaintext_token:created_by_email:- id: key_EfhxLZ9ck8- name: facere+ name: cumkey_type: secret- token_prefix: sk_gMXVLKUoo+ token_prefix: sk_FFE4NZGEQscopes:- write_all- created_at: '2026-08-15T13:59:47.205Z'- updated_at: '2026-08-15T13:59:47.205Z'+ created_at: '2026-08-16T14:39:41.957Z'+ updated_at: '2026-08-16T14:39:41.957Z'revoked_at:last_used_at:channel_id:@@ -2640,16 +2648,16 @@ paths:id: key_VqXmZF31wYname: CI keykey_type: secret- token_prefix: sk_GLZKfbn5p+ token_prefix: sk_yGPUAh1Qbscopes:- read_orders- created_at: '2026-08-15T13:59:47.243Z'- updated_at: '2026-08-15T13:59:47.243Z'+ created_at: '2026-08-16T14:39:41.997Z'+ updated_at: '2026-08-16T14:39:41.997Z'revoked_at:last_used_at:channel_id:- plaintext_token: sk_GLZKfbn5p8kb22p7Tq5Xt71f- created_by_email: [email protected]+ plaintext_token: sk_yGPUAh1QbGHTEKUcCmBKqJ5R+ created_by_email: [email protected]'422':description: validation errorcontent:@@ -2738,12 +2746,12 @@ paths:key_type: publishabletoken_prefix:scopes: []- created_at: '2026-08-15T13:59:47.278Z'- updated_at: '2026-08-15T13:59:47.278Z'+ created_at: '2026-08-16T14:39:42.034Z'+ updated_at: '2026-08-16T14:39:42.034Z'revoked_at:last_used_at:channel_id:- plaintext_token: pk_Z2dh3W53jXJz9u6u8t6hHrZj+ plaintext_token: pk_KHgmoC5xiKaUzcUWUeaBBzZbcreated_by_email:patch:summary: Update an API key@@ -2797,11 +2805,11 @@ paths:id: key_gbHJdmfrXBname: Backend integration (renamed)key_type: secret- token_prefix: sk_YD3kTRvKu+ token_prefix: sk_EZrCFwASbscopes:- write_all- created_at: '2026-08-15T13:59:47.304Z'- updated_at: '2026-08-15T13:59:47.321Z'+ created_at: '2026-08-16T14:39:42.059Z'+ updated_at: '2026-08-16T14:39:42.075Z'revoked_at:last_used_at:channel_id:@@ -2898,13 +2906,13 @@ paths:application/json:example:id: key_EfhxLZ9ck8- name: sapiente+ name: remkey_type: secret- token_prefix: sk_Vt21Jrh4B+ token_prefix: sk_XpS7hXVGRscopes:- write_all- created_at: '2026-08-15T13:59:47.352Z'- updated_at: '2026-08-15T13:59:47.352Z'+ created_at: '2026-08-16T14:39:42.105Z'+ updated_at: '2026-08-16T14:39:42.105Z'revoked_at:last_used_at:channel_id:@@ -2962,12 +2970,12 @@ paths:id: key_gbHJdmfrXBname: Backend integrationkey_type: secret- token_prefix: sk_a3T51UWUT+ token_prefix: sk_Rk6GgcYHZscopes:- write_all- created_at: '2026-08-15T13:59:47.362Z'- updated_at: '2026-08-15T13:59:47.381Z'- revoked_at: '2026-08-15T13:59:47.381Z'+ created_at: '2026-08-16T14:39:42.114Z'+ updated_at: '2026-08-16T14:39:42.131Z'+ revoked_at: '2026-08-16T14:39:42.131Z'last_used_at:channel_id:plaintext_token:@@ -3044,8 +3052,8 @@ paths:lft: 1rgt: 2products_count: 0- created_at: '2026-08-15T13:59:47.554Z'- updated_at: '2026-08-15T13:59:47.554Z'+ created_at: '2026-08-16T14:39:42.270Z'+ updated_at: '2026-08-16T14:39:42.270Z'meta:page: 1limit: 25@@ -3119,8 +3127,8 @@ paths:lft: 2rgt: 3products_count: 0- created_at: '2026-08-15T13:59:47.635Z'- updated_at: '2026-08-15T13:59:47.645Z'+ created_at: '2026-08-16T14:39:42.327Z'+ updated_at: '2026-08-16T14:39:42.335Z'schema:"$ref": "#/components/schemas/Category"'422':@@ -3226,8 +3234,8 @@ paths:lft: 1rgt: 2products_count: 0- created_at: '2026-08-15T13:59:47.698Z'- updated_at: '2026-08-15T13:59:47.698Z'+ created_at: '2026-08-16T14:39:42.379Z'+ updated_at: '2026-08-16T14:39:42.379Z'schema:"$ref": "#/components/schemas/Category"'404':@@ -3297,8 +3305,8 @@ paths:lft: 1rgt: 2products_count: 0- created_at: '2026-08-15T13:59:47.757Z'- updated_at: '2026-08-15T13:59:47.781Z'+ created_at: '2026-08-16T14:39:42.466Z'+ updated_at: '2026-08-16T14:39:42.491Z'schema:"$ref": "#/components/schemas/Category"requestBody:@@ -3413,8 +3421,8 @@ paths:lft: 2rgt: 3products_count: 0- created_at: '2026-08-15T13:59:47.829Z'- updated_at: '2026-08-15T13:59:47.871Z'+ created_at: '2026-08-16T14:39:42.544Z'+ updated_at: '2026-08-16T14:39:42.571Z'schema:"$ref": "#/components/schemas/Category"requestBody:@@ -3526,8 +3534,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 18929- slug: product-18929+ name: Product 11344+ slug: product-11344meta_title:meta_description:meta_keywords:@@ -3539,21 +3547,21 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Harum rerum minima iste libero. Quas dignissimos temporibus- repudiandae cupiditate sit ipsa minus. Quae dolorum illo optio quia- nobis animi. Sapiente fuga sequi laboriosam aliquam repellendus- quos tempora. Magni est doloribus nostrum illo nisi ipsam suscipit- corporis. Voluptate deleniti veniam vitae sed eaque porro fugiat- officiis. Eaque ullam aspernatur exercitationem a id repudiandae- laboriosam. Laboriosam ipsum nulla facere asperiores. Quasi beatae- perspiciatis mollitia corrupti quam. Dolores ab eum exercitationem- unde earum eius. Maiores ducimus blanditiis necessitatibus quasi- fugiat ipsam est. Eligendi optio omnis dicta tempore error. Beatae- reiciendis quod optio enim fuga ut error aperiam.+ description: Assumenda et nostrum doloribus ipsum veniam eveniet optio+ perspiciatis. Excepturi dignissimos maxime mollitia deserunt explicabo.+ Aut eveniet excepturi eligendi quas nam ratione. Deleniti natus+ autem sed laudantium necessitatibus nihil nobis voluptas. Totam+ ea ab sunt rem labore dolor. Eligendi eveniet ea mollitia minus+ aspernatur. Recusandae accusamus deleniti sunt eius id possimus+ nostrum harum. Placeat quisquam nisi excepturi dolorum. Dolorem+ fuga excepturi beatae ab id sed doloribus aspernatur. Quod incidunt+ asperiores impedit mollitia. Quae tempora velit nam beatae nesciunt+ magni sequi voluptate. Enim harum voluptates labore sed iste incidunt+ corporis. Deleniti id doloremque dignissimos itaque consectetur.description_html: |-- Harum rerum minima iste libero. Quas dignissimos temporibus repudiandae cupiditate sit ipsa minus. Quae dolorum illo optio quia nobis animi. Sapiente fuga sequi laboriosam aliquam repellendus quos tempora. Magni est doloribus nostrum illo nisi ipsam suscipit corporis.- Voluptate deleniti veniam vitae sed eaque porro fugiat officiis. Eaque ullam aspernatur exercitationem a id repudiandae laboriosam. Laboriosam ipsum nulla facere asperiores.- Quasi beatae perspiciatis mollitia corrupti quam. Dolores ab eum exercitationem unde earum eius. Maiores ducimus blanditiis necessitatibus quasi fugiat ipsam est. Eligendi optio omnis dicta tempore error. Beatae reiciendis quod optio enim fuga ut error aperiam.+ Assumenda et nostrum doloribus ipsum veniam eveniet optio perspiciatis. Excepturi dignissimos maxime mollitia deserunt explicabo. Aut eveniet excepturi eligendi quas nam ratione.+ Deleniti natus autem sed laudantium necessitatibus nihil nobis voluptas. Totam ea ab sunt rem labore dolor. Eligendi eveniet ea mollitia minus aspernatur. Recusandae accusamus deleniti sunt eius id possimus nostrum harum. Placeat quisquam nisi excepturi dolorum.+ Dolorem fuga excepturi beatae ab id sed doloribus aspernatur. Quod incidunt asperiores impedit mollitia. Quae tempora velit nam beatae nesciunt magni sequi voluptate. Enim harum voluptates labore sed iste incidunt corporis. Deleniti id doloremque dignissimos itaque consectetur.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -3568,14 +3576,14 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-15T13:59:48.016Z'- updated_at: '2026-08-15T13:59:48.016Z'+ created_at: '2026-08-16T14:39:42.707Z'+ updated_at: '2026-08-16T14:39:42.707Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-15T13:59:47.968Z'- updated_at: '2026-08-15T13:59:48.033Z'+ created_at: '2026-08-16T14:39:42.685Z'+ updated_at: '2026-08-16T14:39:42.722Z'delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJ@@ -3746,8 +3754,8 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-15T13:59:46.640Z'- updated_at: '2026-08-15T13:59:46.640Z'+ created_at: '2026-08-16T14:39:41.382Z'+ updated_at: '2026-08-16T14:39:41.382Z'stock_location_ids: []- id: ch_gbHJdmfrXBname: Wholesale@@ -3759,8 +3767,8 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-15T13:59:48.252Z'- updated_at: '2026-08-15T13:59:48.252Z'+ created_at: '2026-08-16T14:39:42.931Z'+ updated_at: '2026-08-16T14:39:42.931Z'stock_location_ids: []meta:page: 1@@ -3846,8 +3854,8 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-15T13:59:48.364Z'- updated_at: '2026-08-15T13:59:48.364Z'+ created_at: '2026-08-16T14:39:42.996Z'+ updated_at: '2026-08-16T14:39:42.996Z'stock_location_ids: []requestBody:content:@@ -3946,8 +3954,8 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-15T13:59:48.382Z'- updated_at: '2026-08-15T13:59:48.382Z'+ created_at: '2026-08-16T14:39:43.011Z'+ updated_at: '2026-08-16T14:39:43.011Z'stock_location_ids: []patch:summary: Update a channel@@ -4002,8 +4010,8 @@ paths:preferred_order_routing_strategy:preferred_storefront_access: login_requiredpreferred_guest_checkout: false- created_at: '2026-08-15T13:59:48.453Z'- updated_at: '2026-08-15T13:59:48.475Z'+ created_at: '2026-08-16T14:39:43.042Z'+ updated_at: '2026-08-16T14:39:43.065Z'stock_location_ids: []requestBody:content:@@ -4286,8 +4294,8 @@ paths:- id: orule_UkLWZg9DAJposition: 1active: true- created_at: '2026-08-15T13:59:46.644Z'- updated_at: '2026-08-15T13:59:46.644Z'+ created_at: '2026-08-16T14:39:41.387Z'+ updated_at: '2026-08-16T14:39:41.387Z'type: preferred_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -4298,8 +4306,8 @@ paths:- id: orule_gbHJdmfrXBposition: 2active: true- created_at: '2026-08-15T13:59:46.648Z'- updated_at: '2026-08-15T13:59:46.648Z'+ created_at: '2026-08-16T14:39:41.390Z'+ updated_at: '2026-08-16T14:39:41.390Z'type: minimize_splitschannel_id: ch_UkLWZg9DAJpreferences: {}@@ -4310,8 +4318,8 @@ paths:- id: orule_EfhxLZ9ck8position: 3active: true- created_at: '2026-08-15T13:59:46.652Z'- updated_at: '2026-08-15T13:59:46.652Z'+ created_at: '2026-08-16T14:39:41.415Z'+ updated_at: '2026-08-16T14:39:41.415Z'type: default_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -4376,8 +4384,8 @@ paths:id: orule_VqXmZF31wYposition: 3active: true- created_at: '2026-08-15T13:59:54.660Z'- updated_at: '2026-08-15T13:59:54.660Z'+ created_at: '2026-08-16T14:39:49.429Z'+ updated_at: '2026-08-16T14:39:49.429Z'type: default_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -4472,8 +4480,8 @@ paths:id: orule_UkLWZg9DAJposition: 2active: false- created_at: '2026-08-15T13:59:46.644Z'- updated_at: '2026-08-15T13:59:54.716Z'+ created_at: '2026-08-16T14:39:41.387Z'+ updated_at: '2026-08-16T14:39:49.501Z'type: preferred_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -4661,8 +4669,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_fabric- created_at: '2026-08-15T13:59:50.508Z'- updated_at: '2026-08-15T13:59:50.508Z'+ created_at: '2026-08-16T14:39:44.575Z'+ updated_at: '2026-08-16T14:39:44.575Z'- id: cfdef_gbHJdmfrXBnamespace: customkey: order_notes@@ -4673,8 +4681,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_custom_order_notes- created_at: '2026-08-15T13:59:50.510Z'- updated_at: '2026-08-15T13:59:50.510Z'+ created_at: '2026-08-16T14:39:44.577Z'+ updated_at: '2026-08-16T14:39:44.577Z'meta:page: 1limit: 25@@ -4743,8 +4751,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_origin- created_at: '2026-08-15T13:59:50.547Z'- updated_at: '2026-08-15T13:59:50.547Z'+ created_at: '2026-08-16T14:39:44.625Z'+ updated_at: '2026-08-16T14:39:44.625Z'requestBody:content:application/json:@@ -4852,8 +4860,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_fabric- created_at: '2026-08-15T13:59:50.553Z'- updated_at: '2026-08-15T13:59:50.553Z'+ created_at: '2026-08-16T14:39:44.634Z'+ updated_at: '2026-08-16T14:39:44.634Z'patch:summary: Update a custom field definitiontags:@@ -4913,8 +4921,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_fabric- created_at: '2026-08-15T13:59:50.572Z'- updated_at: '2026-08-15T13:59:50.586Z'+ created_at: '2026-08-16T14:39:44.661Z'+ updated_at: '2026-08-16T14:39:44.680Z'requestBody:content:application/json:@@ -5060,14 +5068,14 @@ paths:name: VIPsdescription: Top spenderscustomers_count: 0- created_at: '2026-08-15T13:59:50.613Z'- updated_at: '2026-08-15T13:59:50.613Z'+ created_at: '2026-08-16T14:39:44.713Z'+ updated_at: '2026-08-16T14:39:44.713Z'- id: cg_gbHJdmfrXBname: Wholesaledescription:customers_count: 0- created_at: '2026-08-15T13:59:50.614Z'- updated_at: '2026-08-15T13:59:50.614Z'+ created_at: '2026-08-16T14:39:44.714Z'+ updated_at: '2026-08-16T14:39:44.714Z'meta:page: 1limit: 25@@ -5156,8 +5164,8 @@ paths:name: Wholesale 2description: B2B accountscustomers_count: 1- created_at: '2026-08-15T13:59:50.717Z'- updated_at: '2026-08-15T13:59:50.717Z'+ created_at: '2026-08-16T14:39:44.780Z'+ updated_at: '2026-08-16T14:39:44.780Z'schema:"$ref": "#/components/schemas/CustomerGroup"'422':@@ -5266,22 +5274,22 @@ paths:name: VIPsdescription: Top spenderscustomers_count: 1- created_at: '2026-08-15T13:59:50.769Z'- updated_at: '2026-08-15T13:59:50.769Z'+ created_at: '2026-08-16T14:39:44.845Z'+ updated_at: '2026-08-16T14:39:44.845Z'customers:- id: cust_UkLWZg9DAJ- email: [email protected]- first_name: Hye- last_name: Roberts+ email: [email protected]+ first_name: Alexandria+ last_name: Bernhardphone:accepts_email_marketing: false- full_name: Hye Roberts+ full_name: Alexandria Bernhardavailable_store_credit_total: '0'display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-15T13:59:50.773Z'- updated_at: '2026-08-15T13:59:50.773Z'+ created_at: '2026-08-16T14:39:44.848Z'+ updated_at: '2026-08-16T14:39:44.848Z'tags: []internal_note:internal_note_html:@@ -5361,8 +5369,8 @@ paths:name: VIP customers (Q1)description: Top spenderscustomers_count: 0- created_at: '2026-08-15T13:59:50.838Z'- updated_at: '2026-08-15T13:59:50.855Z'+ created_at: '2026-08-16T14:39:44.904Z'+ updated_at: '2026-08-16T14:39:44.921Z'schema:"$ref": "#/components/schemas/CustomerGroup"'422':@@ -5523,8 +5531,8 @@ paths:state_name: New Yorklabel:metadata: {}- created_at: '2026-08-15T13:59:50.921Z'- updated_at: '2026-08-15T13:59:50.921Z'+ created_at: '2026-08-16T14:39:45.008Z'+ updated_at: '2026-08-16T14:39:45.008Z'customer_id: cust_UkLWZg9DAJmeta:page: 1@@ -5619,8 +5627,8 @@ paths:state_name: New Yorklabel: Officemetadata: {}- created_at: '2026-08-15T13:59:50.970Z'- updated_at: '2026-08-15T13:59:50.970Z'+ created_at: '2026-08-16T14:39:45.068Z'+ updated_at: '2026-08-16T14:39:45.068Z'customer_id: cust_UkLWZg9DAJrequestBody:content:@@ -5736,8 +5744,8 @@ paths:state_name: New Yorklabel:metadata: {}- created_at: '2026-08-15T13:59:50.987Z'- updated_at: '2026-08-15T13:59:51.005Z'+ created_at: '2026-08-16T14:39:45.084Z'+ updated_at: '2026-08-16T14:39:45.105Z'customer_id: cust_UkLWZg9DAJrequestBody:content:@@ -5876,8 +5884,8 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJmetadata: {}- created_at: '2026-08-15T13:59:51.069Z'- updated_at: '2026-08-15T13:59:51.069Z'+ created_at: '2026-08-16T14:39:45.172Z'+ updated_at: '2026-08-16T14:39:45.172Z'meta:page: 1limit: 25@@ -5967,8 +5975,8 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJmetadata: {}- created_at: '2026-08-15T13:59:51.099Z'- updated_at: '2026-08-15T13:59:51.099Z'+ created_at: '2026-08-16T14:39:45.204Z'+ updated_at: '2026-08-16T14:39:45.204Z'delete:summary: Delete a customer credit cardtags:@@ -6093,8 +6101,8 @@ paths:currency: USDmemo:metadata: {}- created_at: '2026-08-15T13:59:51.180Z'- updated_at: '2026-08-15T13:59:51.180Z'+ created_at: '2026-08-16T14:39:45.278Z'+ updated_at: '2026-08-16T14:39:45.278Z'customer_id: cust_UkLWZg9DAJcreated_by_id: adm_UkLWZg9DAJcategory_id: sccat_UkLWZg9DAJ@@ -6173,8 +6181,8 @@ paths:currency: USDmemo: Goodwillmetadata: {}- created_at: '2026-08-15T13:59:51.245Z'- updated_at: '2026-08-15T13:59:51.245Z'+ created_at: '2026-08-16T14:39:45.363Z'+ updated_at: '2026-08-16T14:39:45.363Z'customer_id: cust_UkLWZg9DAJcreated_by_id: adm_gbHJdmfrXBcategory_id: sccat_UkLWZg9DAJ@@ -6269,8 +6277,8 @@ paths:currency: USDmemo: Updatedmetadata: {}- created_at: '2026-08-15T13:59:51.268Z'- updated_at: '2026-08-15T13:59:51.285Z'+ created_at: '2026-08-16T14:39:45.390Z'+ updated_at: '2026-08-16T14:39:45.410Z'customer_id: cust_UkLWZg9DAJcreated_by_id: adm_UkLWZg9DAJcategory_id: sccat_UkLWZg9DAJ@@ -6429,8 +6437,8 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-15T13:59:51.328Z'- updated_at: '2026-08-15T13:59:51.328Z'+ created_at: '2026-08-16T14:39:45.458Z'+ updated_at: '2026-08-16T14:39:45.458Z'tags: []internal_note:internal_note_html:@@ -6513,8 +6521,8 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-15T13:59:51.368Z'- updated_at: '2026-08-15T13:59:51.368Z'+ created_at: '2026-08-16T14:39:45.505Z'+ updated_at: '2026-08-16T14:39:45.505Z'tags: []internal_note:internal_note_html:@@ -6629,8 +6637,8 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-15T13:59:51.378Z'- updated_at: '2026-08-15T13:59:51.378Z'+ created_at: '2026-08-16T14:39:45.517Z'+ updated_at: '2026-08-16T14:39:45.517Z'tags: []internal_note:internal_note_html:@@ -6703,8 +6711,8 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-15T13:59:51.402Z'- updated_at: '2026-08-15T13:59:51.420Z'+ created_at: '2026-08-16T14:39:45.546Z'+ updated_at: '2026-08-16T14:39:45.576Z'tags: []internal_note:internal_note_html:@@ -7152,8 +7160,8 @@ paths:- id: exp_UkLWZg9DAJnumber: EF1001format: csv- created_at: '2026-08-15T13:59:51.946Z'- updated_at: '2026-08-15T13:59:51.946Z'+ created_at: '2026-08-16T14:39:46.288Z'+ updated_at: '2026-08-16T14:39:46.288Z'type: productsuser_id: adm_UkLWZg9DAJdone: false@@ -7226,8 +7234,8 @@ paths:id: exp_gbHJdmfrXBnumber: EF1002format: csv- created_at: '2026-08-15T13:59:51.979Z'- updated_at: '2026-08-15T13:59:51.979Z'+ created_at: '2026-08-16T14:39:46.324Z'+ updated_at: '2026-08-16T14:39:46.324Z'type: productsuser_id: adm_UkLWZg9DAJdone: false@@ -7326,8 +7334,8 @@ paths:id: exp_UkLWZg9DAJnumber: EF1001format: csv- created_at: '2026-08-15T13:59:51.994Z'- updated_at: '2026-08-15T13:59:51.994Z'+ created_at: '2026-08-16T14:39:46.343Z'+ updated_at: '2026-08-16T14:39:46.343Z'type: productsuser_id: adm_UkLWZg9DAJdone: false@@ -7543,8 +7551,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:54.829Z'- updated_at: '2026-08-15T13:59:54.839Z'+ created_at: '2026-08-16T14:39:49.622Z'+ updated_at: '2026-08-16T14:39:49.632Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -7637,7 +7645,7 @@ paths:display_tax_total: "$0.00"status: fulfilledfulfillment_type: shipping- fulfilled_at: '2026-08-15T13:59:55.136Z'+ fulfilled_at: '2026-08-16T14:39:49.855Z'tracking_status:estimated_delivery_at:delivered_at:@@ -7649,8 +7657,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '0.0'- created_at: '2026-08-15T13:59:55.052Z'- updated_at: '2026-08-15T13:59:55.136Z'+ created_at: '2026-08-16T14:39:49.836Z'+ updated_at: '2026-08-16T14:39:49.855Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -7825,8 +7833,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:55.405Z'- updated_at: '2026-08-15T13:59:55.415Z'+ created_at: '2026-08-16T14:39:50.181Z'+ updated_at: '2026-08-16T14:39:50.193Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -7923,8 +7931,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:55.563Z'- updated_at: '2026-08-15T13:59:55.648Z'+ created_at: '2026-08-16T14:39:50.324Z'+ updated_at: '2026-08-16T14:39:50.392Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -8023,7 +8031,7 @@ paths:display_tax_total: "$0.00"status: fulfilledfulfillment_type: shipping- fulfilled_at: '2026-08-15T13:59:55.796Z'+ fulfilled_at: '2026-08-16T14:39:50.562Z'tracking_status:estimated_delivery_at:delivered_at:@@ -8035,8 +8043,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:55.727Z'- updated_at: '2026-08-15T13:59:55.796Z'+ created_at: '2026-08-16T14:39:50.479Z'+ updated_at: '2026-08-16T14:39:50.563Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -8139,8 +8147,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:55.877Z'- updated_at: '2026-08-15T13:59:55.938Z'+ created_at: '2026-08-16T14:39:50.646Z'+ updated_at: '2026-08-16T14:39:50.715Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments:@@ -8239,10 +8247,10 @@ paths:display_tax_total: "$0.00"status: deliveredfulfillment_type: shipping- fulfilled_at: '2026-08-15T13:59:56.194Z'+ fulfilled_at: '2026-08-16T14:39:51.028Z'tracking_status:estimated_delivery_at:- delivered_at: '2026-08-15T13:59:56.211Z'+ delivered_at: '2026-08-16T14:39:51.053Z'items:- item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ@@ -8251,8 +8259,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:56.147Z'- updated_at: '2026-08-15T13:59:56.212Z'+ created_at: '2026-08-16T14:39:50.957Z'+ updated_at: '2026-08-16T14:39:51.054Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -8371,8 +8379,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:56.402Z'- updated_at: '2026-08-15T13:59:56.472Z'+ created_at: '2026-08-16T14:39:51.283Z'+ updated_at: '2026-08-16T14:39:51.391Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -8469,8 +8477,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-15T13:59:56.556Z'- updated_at: '2026-08-15T13:59:56.623Z'+ created_at: '2026-08-16T14:39:51.549Z'+ updated_at: '2026-08-16T14:39:51.650Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJdocuments: []@@ -8578,8 +8586,8 @@ paths:tracking_details:adjustment_total: '0.0'pre_tax_amount: '0.0'- created_at: '2026-08-15T13:59:56.774Z'- updated_at: '2026-08-15T13:59:56.838Z'+ created_at: '2026-08-16T14:39:51.822Z'+ updated_at: '2026-08-16T14:39:51.867Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_gbHJdmfrXBdocuments: []@@ -8680,8 +8688,8 @@ paths:codes_count: 2currency: USDprefix: WELCOME- created_at: '2026-08-15T13:59:52.059Z'- updated_at: '2026-08-15T13:59:52.059Z'+ created_at: '2026-08-16T14:39:46.421Z'+ updated_at: '2026-08-16T14:39:46.421Z'amount: '50.0'expires_at:created_by_id:@@ -8765,8 +8773,8 @@ paths:codes_count: 5currency: USDprefix: NEWCAMP- created_at: '2026-08-15T13:59:52.098Z'- updated_at: '2026-08-15T13:59:52.098Z'+ created_at: '2026-08-16T14:39:46.466Z'+ updated_at: '2026-08-16T14:39:46.466Z'amount: '25.0'expires_at: '2030-12-31'created_by_id: adm_UkLWZg9DAJ@@ -8870,8 +8878,8 @@ paths:codes_count: 2currency: USDprefix: WELCOME- created_at: '2026-08-15T13:59:52.129Z'- updated_at: '2026-08-15T13:59:52.129Z'+ created_at: '2026-08-16T14:39:46.500Z'+ updated_at: '2026-08-16T14:39:46.500Z'amount: '50.0'expires_at:created_by_id:@@ -8977,7 +8985,7 @@ paths:example:data:- id: gc_UkLWZg9DAJ- code: 4CB808D8832B628B+ code: 15643338638BA10Bstatus: activecurrency: USDamount: '50.0'@@ -8991,12 +8999,12 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-15T13:59:52.189Z'- updated_at: '2026-08-15T13:59:52.189Z'+ created_at: '2026-08-16T14:39:46.569Z'+ updated_at: '2026-08-16T14:39:46.569Z'customer_id:created_by_id:- id: gc_gbHJdmfrXB- code: 982EFA1E697BAED8+ code: 95C84FC289F6E481status: activecurrency: USDamount: '25.0'@@ -9010,8 +9018,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-15T13:59:52.190Z'- updated_at: '2026-08-15T13:59:52.190Z'+ created_at: '2026-08-16T14:39:46.570Z'+ updated_at: '2026-08-16T14:39:46.570Z'customer_id:created_by_id:meta:@@ -9099,7 +9107,7 @@ paths:application/json:example:id: gc_EfhxLZ9ck8- code: DB88389C37F89F96+ code: 45F9F1DB2787122Cstatus: activecurrency: USDamount: '25.0'@@ -9113,8 +9121,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-15T13:59:52.244Z'- updated_at: '2026-08-15T13:59:52.244Z'+ created_at: '2026-08-16T14:39:46.632Z'+ updated_at: '2026-08-16T14:39:46.632Z'customer_id:created_by_id: adm_UkLWZg9DAJschema:@@ -9223,7 +9231,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: 37331B8E26EA65FA+ code: 47151BC076057BF8status: activecurrency: USDamount: '50.0'@@ -9237,8 +9245,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-15T13:59:52.278Z'- updated_at: '2026-08-15T13:59:52.278Z'+ created_at: '2026-08-16T14:39:46.670Z'+ updated_at: '2026-08-16T14:39:46.670Z'customer_id:created_by_id:schema:@@ -9301,7 +9309,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: F8979249C2598C56+ code: 94A47F4458A76E5Fstatus: activecurrency: USDamount: '75.0'@@ -9315,8 +9323,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-15T13:59:52.320Z'- updated_at: '2026-08-15T13:59:52.335Z'+ created_at: '2026-08-16T14:39:46.720Z'+ updated_at: '2026-08-16T14:39:46.739Z'customer_id:created_by_id:schema:@@ -9421,8 +9429,8 @@ paths:- id: imp_UkLWZg9DAJnumber: IM1001rows_count: 0- created_at: '2026-08-15T13:59:52.416Z'- updated_at: '2026-08-15T13:59:52.424Z'+ created_at: '2026-08-16T14:39:46.831Z'+ updated_at: '2026-08-16T14:39:46.839Z'type: productsstatus: pendingowner_type: store@@ -9609,8 +9617,8 @@ paths:id: imp_gbHJdmfrXBnumber: IM1002rows_count: 0- created_at: '2026-08-15T13:59:52.467Z'- updated_at: '2026-08-15T13:59:52.520Z'+ created_at: '2026-08-16T14:39:46.893Z'+ updated_at: '2026-08-16T14:39:46.938Z'type: productsstatus: mappingowner_type: store@@ -10068,8 +10076,8 @@ paths:id: imp_UkLWZg9DAJnumber: IM1001rows_count: 0- created_at: '2026-08-15T13:59:52.724Z'- updated_at: '2026-08-15T13:59:52.734Z'+ created_at: '2026-08-16T14:39:47.077Z'+ updated_at: '2026-08-16T14:39:47.084Z'type: productsstatus: pendingowner_type: store@@ -10314,8 +10322,8 @@ paths:id: imp_gbHJdmfrXBnumber: IM1002rows_count: 0- created_at: '2026-08-15T13:59:52.835Z'- updated_at: '2026-08-15T13:59:52.904Z'+ created_at: '2026-08-16T14:39:47.194Z'+ updated_at: '2026-08-16T14:39:47.265Z'type: productsstatus: completed_mappingowner_type: store@@ -10671,8 +10679,8 @@ paths:id: imp_gbHJdmfrXBnumber: IM1002rows_count: 1- created_at: '2026-08-15T13:59:52.938Z'- updated_at: '2026-08-15T13:59:52.958Z'+ created_at: '2026-08-16T14:39:47.315Z'+ updated_at: '2026-08-16T14:39:47.338Z'type: productsstatus: processingowner_type: store@@ -10854,8 +10862,8 @@ paths:row_number: 2status: failedvalidation_errors: boom- created_at: '2026-08-15T13:59:52.982Z'- updated_at: '2026-08-15T13:59:52.982Z'+ created_at: '2026-08-16T14:39:47.369Z'+ updated_at: '2026-08-16T14:39:47.369Z'import_id: imp_UkLWZg9DAJitem_type:item_id:@@ -10958,8 +10966,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'- id: mkt_gbHJdmfrXBname: EUcurrency: USD@@ -10971,8 +10979,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:53.202Z'- updated_at: '2026-08-15T13:59:53.202Z'+ created_at: '2026-08-16T14:39:47.659Z'+ updated_at: '2026-08-16T14:39:47.659Z'meta:page: 1limit: 25@@ -11066,8 +11074,8 @@ paths:- en- frtax_provider:- created_at: '2026-08-15T13:59:53.265Z'- updated_at: '2026-08-15T13:59:53.265Z'+ created_at: '2026-08-16T14:39:47.815Z'+ updated_at: '2026-08-16T14:39:47.815Z'schema:"$ref": "#/components/schemas/Market"'422':@@ -11204,8 +11212,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:53.314Z'- updated_at: '2026-08-15T13:59:53.314Z'+ created_at: '2026-08-16T14:39:47.889Z'+ updated_at: '2026-08-16T14:39:47.889Z'schema:"$ref": "#/components/schemas/Market"'404':@@ -11285,8 +11293,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:53.378Z'- updated_at: '2026-08-15T13:59:53.393Z'+ created_at: '2026-08-16T14:39:47.959Z'+ updated_at: '2026-08-16T14:39:47.977Z'schema:"$ref": "#/components/schemas/Market"'422':@@ -11466,8 +11474,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-15T13:59:53.670Z'- updated_at: '2026-08-15T13:59:53.670Z'+ created_at: '2026-08-16T14:39:48.184Z'+ updated_at: '2026-08-16T14:39:48.184Z'meta:page: 1limit: 25@@ -11561,8 +11569,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-15T13:59:53.718Z'- updated_at: '2026-08-15T13:59:53.718Z'+ created_at: '2026-08-16T14:39:48.241Z'+ updated_at: '2026-08-16T14:39:48.241Z'schema:"$ref": "#/components/schemas/OptionType"'422':@@ -11686,8 +11694,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-15T13:59:53.746Z'- updated_at: '2026-08-15T13:59:53.746Z'+ created_at: '2026-08-16T14:39:48.276Z'+ updated_at: '2026-08-16T14:39:48.276Z'schema:"$ref": "#/components/schemas/OptionType"'404':@@ -11760,8 +11768,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-15T13:59:53.798Z'- updated_at: '2026-08-15T13:59:53.814Z'+ created_at: '2026-08-16T14:39:48.325Z'+ updated_at: '2026-08-16T14:39:48.342Z'schema:"$ref": "#/components/schemas/OptionType"'422':@@ -11925,8 +11933,8 @@ paths:country_code:state_code:data: {}- created_at: '2026-08-15T13:59:54.016Z'- updated_at: '2026-08-15T13:59:54.016Z'+ created_at: '2026-08-16T14:39:48.583Z'+ updated_at: '2026-08-16T14:39:48.583Z'meta:page: 1limit: 25@@ -12000,8 +12008,8 @@ paths:amount: "-2.0"display_amount: "-$2.00"metadata: {}- created_at: '2026-08-15T13:59:54.128Z'- updated_at: '2026-08-15T13:59:54.128Z'+ created_at: '2026-08-16T14:39:48.713Z'+ updated_at: '2026-08-16T14:39:48.713Z'meta:page: 1limit: 25@@ -12081,8 +12089,8 @@ paths:amount: "-3.0"display_amount: "-$3.00"metadata: {}- created_at: '2026-08-15T13:59:54.260Z'- updated_at: '2026-08-15T13:59:54.260Z'+ created_at: '2026-08-16T14:39:48.865Z'+ updated_at: '2026-08-16T14:39:48.865Z''422':description: invalid discountcontent:@@ -12179,8 +12187,8 @@ paths:amount: '4.0'display_amount: "$4.00"metadata: {}- created_at: '2026-08-15T13:59:54.494Z'- updated_at: '2026-08-15T13:59:54.494Z'+ created_at: '2026-08-16T14:39:49.147Z'+ updated_at: '2026-08-16T14:39:49.147Z''422':description: invalid feecontent:@@ -12278,7 +12286,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: 6E67CF2A235F8878+ code: 7AAEF1C1347BB998status: activecurrency: USDamount: '10.0'@@ -12292,8 +12300,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-15T13:59:57.027Z'- updated_at: '2026-08-15T13:59:57.062Z'+ created_at: '2026-08-16T14:39:51.974Z'+ updated_at: '2026-08-16T14:39:52.016Z'customer_id:created_by_id:requestBody:@@ -12434,8 +12442,8 @@ paths:preorder_ships_at:quantity: 2currency: USD- name: Product 314328- slug: product-314328+ name: Product 313683+ slug: product-313683options_text: 'Size: S'price: '10.0'display_price: "$10.00"@@ -12467,12 +12475,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T13:59:57.246Z'- updated_at: '2026-08-15T13:59:57.246Z'+ created_at: '2026-08-16T14:39:52.242Z'+ updated_at: '2026-08-16T14:39:52.242Z'digital_links: []metadata: {}- created_at: '2026-08-15T13:59:57.270Z'- updated_at: '2026-08-15T13:59:57.270Z'+ created_at: '2026-08-16T14:39:52.272Z'+ updated_at: '2026-08-16T14:39:52.272Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJmeta:@@ -12544,8 +12552,8 @@ paths:preorder_ships_at:quantity: 3currency: USD- name: Product 33943- slug: product-33943+ name: Product 331188+ slug: product-331188options_text: 'Size: S'price: '19.99'display_price: "$19.99"@@ -12577,12 +12585,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T13:59:57.404Z'- updated_at: '2026-08-15T13:59:57.404Z'+ created_at: '2026-08-16T14:39:52.451Z'+ updated_at: '2026-08-16T14:39:52.451Z'digital_links: []metadata: {}- created_at: '2026-08-15T13:59:57.424Z'- updated_at: '2026-08-15T13:59:57.424Z'+ created_at: '2026-08-16T14:39:52.473Z'+ updated_at: '2026-08-16T14:39:52.473Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJrequestBody:@@ -12676,8 +12684,8 @@ paths:preorder_ships_at:quantity: 2currency: USD- name: Product 342249- slug: product-342249+ name: Product 342837+ slug: product-342837options_text: 'Size: S'price: '10.0'display_price: "$10.00"@@ -12709,12 +12717,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T13:59:57.517Z'- updated_at: '2026-08-15T13:59:57.517Z'+ created_at: '2026-08-16T14:39:52.574Z'+ updated_at: '2026-08-16T14:39:52.574Z'digital_links: []metadata: {}- created_at: '2026-08-15T13:59:57.544Z'- updated_at: '2026-08-15T13:59:57.544Z'+ created_at: '2026-08-16T14:39:52.604Z'+ updated_at: '2026-08-16T14:39:52.604Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJpatch:@@ -12781,8 +12789,8 @@ paths:preorder_ships_at:quantity: 5currency: USD- name: Product 351827- slug: product-351827+ name: Product 353738+ slug: product-353738options_text: 'Size: S'price: '19.99'display_price: "$19.99"@@ -12814,12 +12822,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T13:59:57.610Z'- updated_at: '2026-08-15T13:59:57.610Z'+ created_at: '2026-08-16T14:39:52.692Z'+ updated_at: '2026-08-16T14:39:52.692Z'digital_links: []metadata: {}- created_at: '2026-08-15T13:59:57.635Z'- updated_at: '2026-08-15T13:59:57.660Z'+ created_at: '2026-08-16T14:39:52.725Z'+ updated_at: '2026-08-16T14:39:52.757Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJrequestBody:@@ -12941,7 +12949,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -12988,8 +12996,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: draftlast_ip_address:considered_risky: false@@ -13000,8 +13008,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T13:59:59.028Z'- updated_at: '2026-08-15T13:59:59.082Z'+ created_at: '2026-08-16T14:39:54.338Z'+ updated_at: '2026-08-16T14:39:54.404Z'preferred_stock_location_id:company_location_id:company_id:@@ -13183,7 +13191,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -13230,8 +13238,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: draftlast_ip_address:considered_risky: false@@ -13242,8 +13250,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T13:59:59.285Z'- updated_at: '2026-08-15T13:59:59.285Z'+ created_at: '2026-08-16T14:39:54.616Z'+ updated_at: '2026-08-16T14:39:54.616Z'preferred_stock_location_id:company_location_id:company_id:@@ -13449,8 +13457,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: draftlast_ip_address:considered_risky: false@@ -13461,8 +13469,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T13:59:59.417Z'- updated_at: '2026-08-15T13:59:59.421Z'+ created_at: '2026-08-16T14:39:54.778Z'+ updated_at: '2026-08-16T14:39:54.783Z'preferred_stock_location_id: sloc_UkLWZg9DAJcompany_location_id:company_id:@@ -13654,7 +13662,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -13701,8 +13709,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: draftlast_ip_address:considered_risky: false@@ -13713,8 +13721,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T13:59:59.452Z'- updated_at: '2026-08-15T13:59:59.452Z'+ created_at: '2026-08-16T14:39:54.809Z'+ updated_at: '2026-08-16T14:39:54.809Z'preferred_stock_location_id:company_location_id:company_id:@@ -13841,8 +13849,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: draftlast_ip_address:considered_risky: false@@ -13853,8 +13861,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T13:59:59.528Z'- updated_at: '2026-08-15T13:59:59.556Z'+ created_at: '2026-08-16T14:39:54.898Z'+ updated_at: '2026-08-16T14:39:54.929Z'preferred_stock_location_id:company_location_id:company_id:@@ -14046,7 +14054,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -14054,7 +14062,7 @@ paths:coupon_code:fulfillment_status: unfulfilledpayment_status: paid- completed_at: '2026-08-15T13:59:59.769Z'+ completed_at: '2026-08-16T14:39:55.079Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -14093,8 +14101,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: placedlast_ip_address:considered_risky: false@@ -14105,8 +14113,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T13:59:59.693Z'- updated_at: '2026-08-15T13:59:59.801Z'+ created_at: '2026-08-16T14:39:55.020Z'+ updated_at: '2026-08-16T14:39:55.102Z'preferred_stock_location_id:company_location_id:company_id:@@ -14198,7 +14206,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -14206,7 +14214,7 @@ paths:coupon_code:fulfillment_status: canceledpayment_status: none- completed_at: '2026-08-15T14:00:00.138Z'+ completed_at: '2026-08-16T14:39:55.343Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -14245,8 +14253,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: canceledlast_ip_address:considered_risky: false@@ -14255,10 +14263,10 @@ paths:payment_total: '0.0'display_payment_total: "$0.00"metadata: {}- canceled_at: '2026-08-15T14:00:00.170Z'+ canceled_at: '2026-08-16T14:39:55.376Z'approved_at:- created_at: '2026-08-15T14:00:00.039Z'- updated_at: '2026-08-15T14:00:00.194Z'+ created_at: '2026-08-16T14:39:55.280Z'+ updated_at: '2026-08-16T14:39:55.398Z'preferred_stock_location_id:company_location_id:company_id:@@ -14334,7 +14342,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -14342,7 +14350,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-15T14:00:00.321Z'+ completed_at: '2026-08-16T14:39:55.632Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -14381,8 +14389,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: placedlast_ip_address:considered_risky: false@@ -14392,9 +14400,9 @@ paths:display_payment_total: "$0.00"metadata: {}canceled_at:- approved_at: '2026-08-15T14:00:00.357Z'- created_at: '2026-08-15T14:00:00.247Z'- updated_at: '2026-08-15T14:00:00.320Z'+ approved_at: '2026-08-16T14:39:55.668Z'+ created_at: '2026-08-16T14:39:55.504Z'+ updated_at: '2026-08-16T14:39:55.632Z'preferred_stock_location_id:company_location_id:company_id:@@ -14461,7 +14469,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -14469,7 +14477,7 @@ paths:coupon_code:fulfillment_status: unfulfilledpayment_status: none- completed_at: '2026-08-15T14:00:00.537Z'+ completed_at: '2026-08-16T14:39:55.773Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -14508,8 +14516,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: placedlast_ip_address:considered_risky: false@@ -14518,10 +14526,10 @@ paths:payment_total: '0.0'display_payment_total: "$0.00"metadata: {}- canceled_at: '2026-08-15T14:00:00.572Z'+ canceled_at: '2026-08-16T14:39:55.799Z'approved_at:- created_at: '2026-08-15T14:00:00.402Z'- updated_at: '2026-08-15T14:00:00.680Z'+ created_at: '2026-08-16T14:39:55.708Z'+ updated_at: '2026-08-16T14:39:55.847Z'preferred_stock_location_id:company_location_id:company_id:@@ -14588,7 +14596,7 @@ paths:cart_id:channel_id: ch_UkLWZg9DAJnumber: R1001- email: [email protected]+ email: [email protected]customer_note:currency: USDlocale: en@@ -14596,7 +14604,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-15T14:00:00.820Z'+ completed_at: '2026-08-16T14:39:55.942Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -14635,8 +14643,8 @@ paths:supported_locales:- entax_provider:- created_at: '2026-08-15T13:59:46.635Z'- updated_at: '2026-08-15T13:59:46.635Z'+ created_at: '2026-08-16T14:39:41.375Z'+ updated_at: '2026-08-16T14:39:41.375Z'status: placedlast_ip_address:considered_risky: false@@ -14647,8 +14655,8 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-15T14:00:00.735Z'- updated_at: '2026-08-15T14:00:00.819Z'+ created_at: '2026-08-16T14:39:55.880Z'+ updated_at: '2026-08-16T14:39:55.942Z'preferred_stock_location_id:company_location_id:company_id:@@ -14731,8 +14739,8 @@ paths:resolved_capture_method: checkoutstorefront_visible: trueposition: 1- created_at: '2026-08-15T14:00:00.945Z'- updated_at: '2026-08-15T14:00:00.945Z'+ created_at: '2026-08-16T14:39:56.072Z'+ updated_at: '2026-08-16T14:39:56.072Z'preferences: {}preference_schema: []meta:@@ -14794,12 +14802,12 @@ paths:label: Bogusdescription:preference_schema:- - key: dummy_key- type: string- default: PUBLICKEY123- key: dummy_secret_keytype: passworddefault:+ - key: dummy_key+ type: string+ default: PUBLICKEY123- type: custom_payment_source_methodlabel: Custom Payment Source Methoddescription:@@ -14880,8 +14888,8 @@ paths:resolved_capture_method: checkoutstorefront_visible: trueposition: 1- created_at: '2026-08-15T14:00:01.024Z'- updated_at: '2026-08-15T14:00:01.024Z'+ created_at: '2026-08-16T14:39:56.142Z'+ updated_at: '2026-08-16T14:39:56.142Z'preferences: {}preference_schema: []"/api/v3/admin/orders/{order_id}/payments":@@ -14952,7 +14960,7 @@ paths:data:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-65a9cba21c0e+ response_code: BGS-85ab1c2038e1number: R1001-P1amount: '110.0'display_amount: "$110.00"@@ -14971,14 +14979,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-15T13:59:57.866Z'- updated_at: '2026-08-15T13:59:57.868Z'+ created_at: '2026-08-16T14:39:53.000Z'+ updated_at: '2026-08-16T14:39:53.002Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-15T13:59:57.867Z'- updated_at: '2026-08-15T13:59:57.867Z'+ created_at: '2026-08-16T14:39:53.002Z'+ updated_at: '2026-08-16T14:39:53.002Z'captured_amount: '0.0'order_id: or_UkLWZg9DAJmeta:@@ -15059,8 +15067,8 @@ paths:avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-15T13:59:58.136Z'- updated_at: '2026-08-15T13:59:58.136Z'+ created_at: '2026-08-16T14:39:53.282Z'+ updated_at: '2026-08-16T14:39:53.282Z'captured_amount: '0.0'order_id: or_gbHJdmfrXBrequestBody:@@ -15153,7 +15161,7 @@ paths:example:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-603fb4a59f0d+ response_code: BGS-1b0fd642e484number: R1001-P1amount: '110.0'display_amount: "$110.00"@@ -15172,14 +15180,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-15T13:59:58.250Z'- updated_at: '2026-08-15T13:59:58.253Z'+ created_at: '2026-08-16T14:39:53.402Z'+ updated_at: '2026-08-16T14:39:53.405Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-15T13:59:58.252Z'- updated_at: '2026-08-15T13:59:58.252Z'+ created_at: '2026-08-16T14:39:53.404Z'+ updated_at: '2026-08-16T14:39:53.404Z'captured_amount: '0.0'order_id: or_UkLWZg9DAJ"/api/v3/admin/orders/{order_id}/payments/{id}/capture":@@ -15242,7 +15250,7 @@ paths:example:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-4c13dbf2eca8+ response_code: BGS-e8ff69edc84cnumber: R1001-P1amount: '110.0'display_amount: "$110.00"@@ -15261,14 +15269,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-15T13:59:58.386Z'- updated_at: '2026-08-15T13:59:58.389Z'+ created_at: '2026-08-16T14:39:53.587Z'+ updated_at: '2026-08-16T14:39:53.592Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-15T13:59:58.388Z'- updated_at: '2026-08-15T13:59:58.422Z'+ created_at: '2026-08-16T14:39:53.590Z'+ updated_at: '2026-08-16T14:39:53.659Z'captured_amount: '110.0'order_id: or_UkLWZg9DAJ'422':@@ -15340,7 +15348,7 @@ paths:example:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: void-BGS-461878100f11+ response_code: void-BGS-0a88f64bea8anumber: R1001-P1amount: '110.0'display_amount: "$110.00"@@ -15359,14 +15367,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-15T13:59:58.677Z'- updated_at: '2026-08-15T13:59:58.680Z'+ created_at: '2026-08-16T14:39:53.969Z'+ updated_at: '2026-08-16T14:39:53.973Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-15T13:59:58.678Z'- updated_at: '2026-08-15T13:59:58.700Z'+ created_at: '2026-08-16T14:39:53.971Z'+ updated_at: '2026-08-16T14:39:53.997Z'captured_amount: '0.0'order_id: or_UkLWZg9DAJ"/api/v3/admin/price_lists":@@ -15454,8 +15462,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.068Z'- updated_at: '2026-08-15T14:00:01.068Z'+ created_at: '2026-08-16T14:39:56.198Z'+ updated_at: '2026-08-16T14:39:56.198Z'currently_active: falseproducts_count: 0prices_count: 0@@ -15469,8 +15477,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.070Z'- updated_at: '2026-08-15T14:00:01.070Z'+ created_at: '2026-08-16T14:39:56.199Z'+ updated_at: '2026-08-16T14:39:56.199Z'currently_active: falseproducts_count: 0prices_count: 0@@ -15584,8 +15592,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.327Z'- updated_at: '2026-08-15T14:00:01.329Z'+ created_at: '2026-08-16T14:39:56.405Z'+ updated_at: '2026-08-16T14:39:56.409Z'currently_active: falseproducts_count: 1prices_count: 2@@ -15748,8 +15756,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.368Z'- updated_at: '2026-08-15T14:00:01.368Z'+ created_at: '2026-08-16T14:39:56.453Z'+ updated_at: '2026-08-16T14:39:56.453Z'currently_active: falseproducts_count: 0prices_count: 0@@ -15824,8 +15832,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.671Z'- updated_at: '2026-08-15T14:00:01.691Z'+ created_at: '2026-08-16T14:39:56.768Z'+ updated_at: '2026-08-16T14:39:56.786Z'currently_active: falseproducts_count: 0prices_count: 0@@ -16013,8 +16021,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.733Z'- updated_at: '2026-08-15T14:00:01.751Z'+ created_at: '2026-08-16T14:39:56.822Z'+ updated_at: '2026-08-16T14:39:56.848Z'currently_active: trueproducts_count: 0prices_count: 0@@ -16077,8 +16085,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-15T14:00:01.761Z'- updated_at: '2026-08-15T14:00:01.782Z'+ created_at: '2026-08-16T14:39:56.864Z'+ updated_at: '2026-08-16T14:39:56.884Z'currently_active: falseproducts_count: 0prices_count: 0@@ -16192,8 +16200,8 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-15T14:00:01.823Z'- updated_at: '2026-08-15T14:00:01.823Z'+ created_at: '2026-08-16T14:39:56.923Z'+ updated_at: '2026-08-16T14:39:56.923Z'- id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999@@ -16204,8 +16212,8 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_gbHJdmfrXB- created_at: '2026-08-15T14:00:01.846Z'- updated_at: '2026-08-15T14:00:01.846Z'+ created_at: '2026-08-16T14:39:56.948Z'+ updated_at: '2026-08-16T14:39:56.948Z'- id: price_EfhxLZ9ck8amount: '5.0'amount_in_cents: 500@@ -16216,8 +16224,8 @@ paths:display_compare_at_amount:price_list_id: pl_UkLWZg9DAJvariant_id: variant_gbHJdmfrXB- created_at: '2026-08-15T14:00:01.850Z'- updated_at: '2026-08-15T14:00:01.850Z'+ created_at: '2026-08-16T14:39:56.951Z'+ updated_at: '2026-08-16T14:39:56.951Z'meta:page: 1limit: 25@@ -16299,8 +16307,8 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_EfhxLZ9ck8- created_at: '2026-08-15T14:00:01.990Z'- updated_at: '2026-08-15T14:00:01.990Z'+ created_at: '2026-08-16T14:39:57.081Z'+ updated_at: '2026-08-16T14:39:57.081Z'schema:"$ref": "#/components/schemas/Price"requestBody:@@ -16387,8 +16395,8 @@ paths:display_compare_at_amount:price_list_id: pl_UkLWZg9DAJvariant_id: variant_gbHJdmfrXB- created_at: '2026-08-15T14:00:02.071Z'- updated_at: '2026-08-15T14:00:02.071Z'+ created_at: '2026-08-16T14:39:57.150Z'+ updated_at: '2026-08-16T14:39:57.150Z'schema:"$ref": "#/components/schemas/Price"'404':@@ -16453,8 +16461,8 @@ paths:display_compare_at_amount:price_list_id: pl_UkLWZg9DAJvariant_id: variant_gbHJdmfrXB- created_at: '2026-08-15T14:00:02.223Z'- updated_at: '2026-08-15T14:00:02.238Z'+ created_at: '2026-08-16T14:39:57.328Z'+ updated_at: '2026-08-16T14:39:57.345Z'schema:"$ref": "#/components/schemas/Price"requestBody:@@ -16766,8 +16774,8 @@ paths:field_type: short_textkey: custom.titlevalue: wool- created_at: '2026-08-15T14:00:02.882Z'- updated_at: '2026-08-15T14:00:02.882Z'+ created_at: '2026-08-16T14:39:58.046Z'+ updated_at: '2026-08-16T14:39:58.046Z'storefront_visible: truecustom_field_definition_id: cfdef_UkLWZg9DAJmeta:@@ -16837,8 +16845,8 @@ paths:field_type: long_textkey: custom.descriptionvalue: A longer description- created_at: '2026-08-15T14:00:02.962Z'- updated_at: '2026-08-15T14:00:02.962Z'+ created_at: '2026-08-16T14:39:58.132Z'+ updated_at: '2026-08-16T14:39:58.132Z'storefront_visible: truecustom_field_definition_id: cfdef_gbHJdmfrXB'422':@@ -16937,8 +16945,8 @@ paths:field_type: short_textkey: custom.titlevalue: wool- created_at: '2026-08-15T14:00:03.066Z'- updated_at: '2026-08-15T14:00:03.066Z'+ created_at: '2026-08-16T14:39:58.351Z'+ updated_at: '2026-08-16T14:39:58.351Z'storefront_visible: truecustom_field_definition_id: cfdef_UkLWZg9DAJpatch:@@ -17002,8 +17010,8 @@ paths:field_type: short_textkey: custom.titlevalue: cotton- created_at: '2026-08-15T14:00:03.187Z'- updated_at: '2026-08-15T14:00:03.227Z'+ created_at: '2026-08-16T14:39:58.425Z'+ updated_at: '2026-08-16T14:39:58.444Z'storefront_visible: truecustom_field_definition_id: cfdef_UkLWZg9DAJrequestBody:@@ -17121,10 +17129,10 @@ paths:source: Espresso Machine- key: descriptiontype: html- source: Eaque quaerat quasi voluptatum veniam quae maiores. Temporibus- occaecati modi porro quas atque ipsam unde. Aspernatur recusandae- at quibusdam neque veniam vero. Inventore voluptas cumque ea- nam modi ex laborum.+ source: |-+ Eum tempore modi minima iste optio corrupti inventore. Eveniet nulla doloremque ut distinctio suscipit fugiat. Perferendis omnis maxime repellendus at unde tenetur. Alias ab possimus asperiores porro. Dignissimos accusantium nam vel qui atque molestias corrupti.+ Nobis saepe nesciunt deleniti delectus commodi porro. Et reiciendis aliquid aperiam exercitationem debitis quia dolores similique. Rem rerum ipsa nostrum alias. Iure inventore occaecati hic expedita ad perspiciatis. Illo fugit cupiditate odio illum sit rerum ut corporis.+ Veniam blanditiis deserunt harum fugit est dolorum. Error dicta adipisci et libero amet sit magnam. Amet dolore aliquid at laborum officiis occaecati dolorem esse. Nesciunt iusto cumque provident aperiam. Adipisci alias distinctio exercitationem corrupti sint laboriosam enim.- key: slugtype: stringsource: espresso-machine@@ -17235,8 +17243,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 769475- slug: product-769475+ name: Product 7627+ slug: product-7627meta_title:meta_description:meta_keywords:@@ -17248,23 +17256,25 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Fuga expedita exercitationem eius laboriosam cumque- reiciendis eligendi sed. Excepturi iste dolorem rerum magnam.- Amet quod perferendis esse reprehenderit quam voluptate odio.- Odio nemo iure iste commodi quod optio ipsum natus. Dicta blanditiis- dolore quo atque quasi. Magnam quod dignissimos totam neque ducimus- non. Fugit hic quos voluptas occaecati. Debitis minima corporis- dolorum sed quam autem. Repellendus cupiditate ea suscipit dicta- aut adipisci aperiam. Provident maiores dolores repellat doloremque- libero accusamus velit. Porro deleniti alias aliquam molestias- quas. Voluptatum delectus voluptate aperiam quos. Ratione odit- sit nisi culpa quia. Iusto ipsum vero consequatur ea mollitia- distinctio placeat.+ description: Temporibus officiis laudantium ut modi quos natus cum+ aliquam. Ipsam rerum vero eius dolorum fuga. Perferendis ut ad+ architecto vel. Debitis numquam quae dicta ex ab consequuntur+ ullam. Deleniti cumque repellat aliquid quidem rem. Nesciunt id+ corrupti ipsum nulla. Natus quaerat vero accusamus excepturi corporis.+ Dolorum voluptas iure eaque quos rem. Assumenda sapiente numquam+ in quaerat dolorum pariatur. Soluta eum impedit officia distinctio+ molestias saepe recusandae. Nobis reprehenderit consectetur cum+ vero quaerat. Quas sit adipisci facilis eius necessitatibus dolore+ totam. Blanditiis aliquid ipsam quisquam sit quos. Perferendis+ voluptatum architecto rerum error in cum. Maiores natus animi+ cumque vel labore. Excepturi nulla sequi fugiat consequatur iure.+ Maxime soluta vel hic consectetur asperiores sit. Quia et dicta+ hic facere commodi.description_html: |-- Fuga expedita exercitationem eius laboriosam cumque reiciendis eligendi sed. Excepturi iste dolorem rerum magnam. Amet quod perferendis esse reprehenderit quam voluptate odio. Odio nemo iure iste commodi quod optio ipsum natus.- Dicta blanditiis dolore quo atque quasi. Magnam quod dignissimos totam neque ducimus non. Fugit hic quos voluptas occaecati. Debitis minima corporis dolorum sed quam autem.- Repellendus cupiditate ea suscipit dicta aut adipisci aperiam. Provident maiores dolores repellat doloremque libero accusamus velit. Porro deleniti alias aliquam molestias quas.- Voluptatum delectus voluptate aperiam quos. Ratione odit sit nisi culpa quia. Iusto ipsum vero consequatur ea mollitia distinctio placeat.+ Temporibus officiis laudantium ut modi quos natus cum aliquam. Ipsam rerum vero eius dolorum fuga. Perferendis ut ad architecto vel. Debitis numquam quae dicta ex ab consequuntur ullam. Deleniti cumque repellat aliquid quidem rem.+ Nesciunt id corrupti ipsum nulla. Natus quaerat vero accusamus excepturi corporis. Dolorum voluptas iure eaque quos rem. Assumenda sapiente numquam in quaerat dolorum pariatur. Soluta eum impedit officia distinctio molestias saepe recusandae.+ Nobis reprehenderit consectetur cum vero quaerat. Quas sit adipisci facilis eius necessitatibus dolore totam. Blanditiis aliquid ipsam quisquam sit quos.+ Perferendis voluptatum architecto rerum error in cum. Maiores natus animi cumque vel labore. Excepturi nulla sequi fugiat consequatur iure. Maxime soluta vel hic consectetur asperiores sit. Quia et dicta hic facere commodi.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -17279,14 +17289,14 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-15T14:00:03.416Z'- updated_at: '2026-08-15T14:00:03.416Z'+ created_at: '2026-08-16T14:39:58.618Z'+ updated_at: '2026-08-16T14:39:58.618Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-15T14:00:03.405Z'- updated_at: '2026-08-15T14:00:03.424Z'+ created_at: '2026-08-16T14:39:58.608Z'+ updated_at: '2026-08-16T14:39:58.628Z'delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJ@@ -17424,8 +17434,8 @@ paths:status: draftmetadata: {}deleted_at:- created_at: '2026-08-15T14:00:03.553Z'- updated_at: '2026-08-15T14:00:03.558Z'+ created_at: '2026-08-16T14:39:58.774Z'+ updated_at: '2026-08-16T14:39:58.779Z'delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id:@@ -17632,8 +17642,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 805301- slug: product-805301+ name: Product 808167+ slug: product-808167meta_title:meta_description:meta_keywords:@@ -17645,21 +17655,16 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Adipisci repellat mollitia iure aut corporis minus illum.- Expedita facere molestiae reprehenderit tempora ipsam earum. Tempore- recusandae quidem vel beatae harum dicta sit. Inventore consectetur- et debitis reiciendis illum. Totam harum dolorem provident illum.- Nulla occaecati ab necessitatibus perspiciatis nisi. Ab deleniti- quo autem molestias facere quibusdam labore. Blanditiis fugit perferendis- soluta alias sint ipsam occaecati ut. Ab facilis eligendi placeat- cumque dolores nemo amet iusto. Perspiciatis officia nam porro dolorem- repellendus fuga tempore voluptatum. Aperiam necessitatibus temporibus- dolore deleniti minima eveniet amet. Repellendus dolor a sit libero- eos molestias eveniet inventore. Odio nostrum earum qui vero vitae.+ description: Velit hic corrupti adipisci repudiandae non. Esse non+ ipsam laborum molestiae adipisci architecto quod. Aperiam alias+ corrupti laudantium distinctio doloribus. Excepturi laborum quis+ voluptate magni maxime tenetur. Consequatur officia quod exercitationem+ repudiandae animi quas. Magnam quis doloribus aspernatur quasi delectus+ repellendus architecto. Excepturi tempora facere earum in ipsa.+ Natus nihil dolore quidem nesciunt.description_html: |-- Adipisci repellat mollitia iure aut corporis minus illum. Expedita facere molestiae reprehenderit tempora ipsam earum. Tempore recusandae quidem vel beatae harum dicta sit. Inventore consectetur et debitis reiciendis illum. Totam harum dolorem provident illum.- Nulla occaecati ab necessitatibus perspiciatis nisi. Ab deleniti quo autem molestias facere quibusdam labore. Blanditiis fugit perferendis soluta alias sint ipsam occaecati ut.- Ab facilis eligendi placeat cumque dolores nemo amet iusto. Perspiciatis officia nam porro dolorem repellendus fuga tempore voluptatum. Aperiam necessitatibus temporibus dolore deleniti minima eveniet amet. Repellendus dolor a sit libero eos molestias eveniet inventore. Odio nostrum earum qui vero vitae.+ Velit hic corrupti adipisci repudiandae non. Esse non ipsam laborum molestiae adipisci architecto quod. Aperiam alias corrupti laudantium distinctio doloribus. Excepturi laborum quis voluptate magni maxime tenetur. Consequatur officia quod exercitationem repudiandae animi quas.+ Magnam quis doloribus aspernatur quasi delectus repellendus architecto. Excepturi tempora facere earum in ipsa. Natus nihil dolore quidem nesciunt.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -17674,14 +17679,14 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-15T14:00:03.656Z'- updated_at: '2026-08-15T14:00:03.656Z'+ created_at: '2026-08-16T14:39:58.903Z'+ updated_at: '2026-08-16T14:39:58.903Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-15T14:00:03.646Z'- updated_at: '2026-08-15T14:00:03.662Z'+ created_at: '2026-08-16T14:39:58.892Z'+ updated_at: '2026-08-16T14:39:58.911Z'delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJ@@ -17753,7 +17758,7 @@ paths:example:id: prod_UkLWZg9DAJname: Updated Name- slug: product-824998+ slug: product-822619meta_title:meta_description:meta_keywords:@@ -17765,26 +17770,14 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Vitae commodi aliquam quis porro. Repellat error neque- assumenda nisi aliquid maxime veritatis. Quas ipsam aperiam quasi- perferendis nisi vitae sint explicabo. Fugit a incidunt accusamus- nisi quaerat reprehenderit quia. Excepturi nemo odit repellat quam- ab saepe. Sint totam aspernatur asperiores occaecati provident possimus- soluta. Odit accusamus quisquam dolores sequi ipsa. Eum cumque praesentium- commodi expedita cupiditate nulla vel. Aliquam odio doloremque distinctio- quo sequi. Laboriosam aliquam in officiis repellendus. Ut numquam- illum eaque ipsam. Rerum mollitia fuga nihil est hic non magni praesentium.- Veritatis reprehenderit id magnam nemo minima natus unde. Placeat- excepturi atque cum voluptas. Dignissimos quaerat consequatur exercitationem- architecto. Vitae minima voluptatem ducimus sequi. Debitis quidem- non autem accusamus possimus. Facilis tempora officia atque est- facere blanditiis possimus.+ description: Voluptate aperiam optio dolor consequuntur eligendi molestias.+ Suscipit fugit recusandae velit quos neque. Cumque quia quod deserunt+ ad nesciunt. Non neque ea commodi voluptate. Occaecati ad maiores+ quis temporibus quam fugit neque animi. Ipsam odio facilis voluptatibus+ animi voluptatum provident saepe rem.description_html: |-- Vitae commodi aliquam quis porro. Repellat error neque assumenda nisi aliquid maxime veritatis. Quas ipsam aperiam quasi perferendis nisi vitae sint explicabo.- Fugit a incidunt accusamus nisi quaerat reprehenderit quia. Excepturi nemo odit repellat quam ab saepe. Sint totam aspernatur asperiores occaecati provident possimus soluta.- Odit accusamus quisquam dolores sequi ipsa. Eum cumque praesentium commodi expedita cupiditate nulla vel. Aliquam odio doloremque distinctio quo sequi. Laboriosam aliquam in officiis repellendus.- Ut numquam illum eaque ipsam. Rerum mollitia fuga nihil est hic non magni praesentium. Veritatis reprehenderit id magnam nemo minima natus unde.- Placeat excepturi atque cum voluptas. Dignissimos quaerat consequatur exercitationem architecto. Vitae minima voluptatem ducimus sequi. Debitis quidem non autem accusamus possimus. Facilis tempora officia atque est facere blanditiis possimus.+ Voluptate aperiam optio dolor consequuntur eligendi molestias. Suscipit fugit recusandae velit quos neque. Cumque quia quod deserunt ad nesciunt.+ Non neque ea commodi voluptate. Occaecati ad maiores quis temporibus quam fugit neque animi. Ipsam odio facilis voluptatibus animi voluptatum provident saepe rem.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -17799,14 +17792,14 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-15T14:00:03.792Z'- updated_at: '2026-08-15T14:00:03.792Z'+ created_at: '2026-08-16T14:39:59.042Z'+ updated_at: '2026-08-16T14:39:59.042Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-15T14:00:03.780Z'- updated_at: '2026-08-15T14:00:03.823Z'+ created_at: '2026-08-16T14:39:59.030Z'+ updated_at: '2026-08-16T14:39:59.077Z'delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJ@@ -18751,15 +18744,15 @@ paths:- id: coupon_UkLWZg9DAJcode: AAA111state: unused- created_at: '2026-08-15T13:59:50.463Z'- updated_at: '2026-08-15T13:59:50.463Z'+ created_at: '2026-08-16T14:39:44.541Z'+ updated_at: '2026-08-16T14:39:44.541Z'promotion_id: promo_UkLWZg9DAJorder_id:- id: coupon_gbHJdmfrXBcode: BBB222state: unused- created_at: '2026-08-15T13:59:50.473Z'- updated_at: '2026-08-15T13:59:50.473Z'+ created_at: '2026-08-16T14:39:44.543Z'+ updated_at: '2026-08-16T14:39:44.543Z'promotion_id: promo_UkLWZg9DAJorder_id:meta:@@ -18821,8 +18814,8 @@ paths:example:data:- id: pact_UkLWZg9DAJ- created_at: '2026-08-15T14:00:05.033Z'- updated_at: '2026-08-15T14:00:05.033Z'+ created_at: '2026-08-16T14:40:00.390Z'+ updated_at: '2026-08-16T14:40:00.390Z'type: free_shippingpromotion_id: promo_UkLWZg9DAJpreferences: {}@@ -18886,8 +18879,8 @@ paths:application/json:example:id: pact_UkLWZg9DAJ- created_at: '2026-08-15T14:00:05.073Z'- updated_at: '2026-08-15T14:00:05.073Z'+ created_at: '2026-08-16T14:40:00.433Z'+ updated_at: '2026-08-16T14:40:00.433Z'type: free_shippingpromotion_id: promo_UkLWZg9DAJpreferences: {}@@ -19015,8 +19008,8 @@ paths:example:data:- id: prorule_UkLWZg9DAJ- created_at: '2026-08-15T14:00:05.126Z'- updated_at: '2026-08-15T14:00:05.126Z'+ created_at: '2026-08-16T14:40:00.496Z'+ updated_at: '2026-08-16T14:40:00.496Z'type: currencypromotion_id: promo_UkLWZg9DAJpreferences:@@ -19086,8 +19079,8 @@ paths:application/json:example:id: prorule_UkLWZg9DAJ- created_at: '2026-08-15T14:00:05.162Z'- updated_at: '2026-08-15T14:00:05.162Z'+ created_at: '2026-08-16T14:40:00.539Z'+ updated_at: '2026-08-16T14:40:00.539Z'type: currencypromotion_id: promo_UkLWZg9DAJpreferences:@@ -19178,8 +19171,8 @@ paths:application/json:example:id: prorule_UkLWZg9DAJ- created_at: '2026-08-15T14:00:05.192Z'- updated_at: '2026-08-15T14:00:05.210Z'+ created_at: '2026-08-16T14:40:00.573Z'+ updated_at: '2026-08-16T14:40:00.589Z'type: currencypromotion_id: promo_UkLWZg9DAJpreferences:@@ -19287,7 +19280,7 @@ paths:name: Summer Saledescription:code: summer- starts_at: '2026-08-15T14:00:05.241Z'+ starts_at: '2026-08-16T14:40:00.623Z'expires_at:usage_limit:match_policy: all@@ -19298,8 +19291,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-15T14:00:05.241Z'- updated_at: '2026-08-15T14:00:05.241Z'+ created_at: '2026-08-16T14:40:00.624Z'+ updated_at: '2026-08-16T14:40:00.624Z'action_ids: []rule_ids: []meta:@@ -19406,7 +19399,7 @@ paths:name: Black Fridaydescription:code: blackfriday-os- starts_at: '2026-08-15T14:00:05.355Z'+ starts_at: '2026-08-16T14:40:00.748Z'expires_at:usage_limit:match_policy: all@@ -19417,8 +19410,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-15T14:00:05.355Z'- updated_at: '2026-08-15T14:00:05.373Z'+ created_at: '2026-08-16T14:40:00.748Z'+ updated_at: '2026-08-16T14:40:00.777Z'action_ids:- pact_UkLWZg9DAJ- pact_gbHJdmfrXB@@ -19584,7 +19577,7 @@ paths:name: Summer Saledescription:code: summer- starts_at: '2026-08-15T14:00:05.411Z'+ starts_at: '2026-08-16T14:40:00.820Z'expires_at:usage_limit:match_policy: all@@ -19595,8 +19588,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-15T14:00:05.411Z'- updated_at: '2026-08-15T14:00:05.411Z'+ created_at: '2026-08-16T14:40:00.821Z'+ updated_at: '2026-08-16T14:40:00.821Z'action_ids: []rule_ids: []patch:@@ -19693,7 +19686,7 @@ paths:name: Summer Saledescription:code: summer- starts_at: '2026-08-15T14:00:05.507Z'+ starts_at: '2026-08-16T14:40:00.925Z'expires_at:usage_limit:match_policy: all@@ -19704,8 +19697,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-15T14:00:05.507Z'- updated_at: '2026-08-15T14:00:05.526Z'+ created_at: '2026-08-16T14:40:00.925Z'+ updated_at: '2026-08-16T14:40:00.943Z'action_ids: []rule_ids: []requestBody:@@ -20033,12 +20026,12 @@ paths:label: Option Value(s)description:preference_schema:- - key: eligible_values- type: array- default: []- key: match_policytype: stringdefault: any+ - key: eligible_values+ type: array+ default: []- type: productlabel: Product(s)description:@@ -20177,15 +20170,15 @@ paths:application/json:example:id: re_UkLWZg9DAJ- transaction_id: BGS-a62993241c1a+ transaction_id: BGS-cd7154ac83e8amount: '5.0'payment_id: py_UkLWZg9DAJrefund_reason_id: rr_UkLWZg9DAJoriginator_id:originator_type:metadata: {}- created_at: '2026-08-15T13:59:58.993Z'- updated_at: '2026-08-15T13:59:58.993Z'+ created_at: '2026-08-16T14:39:54.301Z'+ updated_at: '2026-08-16T14:39:54.301Z'requestBody:content:application/json:@@ -20329,8 +20322,8 @@ paths:data:- id: sccat_UkLWZg9DAJname: Goodwill- created_at: '2026-08-15T14:00:06.031Z'- updated_at: '2026-08-15T14:00:06.031Z'+ created_at: '2026-08-16T14:40:01.556Z'+ updated_at: '2026-08-16T14:40:01.556Z'non_expiring: falsemeta:page: 1@@ -20424,8 +20417,8 @@ paths:example:id: sccat_UkLWZg9DAJname: Goodwill- created_at: '2026-08-15T14:00:06.072Z'- updated_at: '2026-08-15T14:00:06.072Z'+ created_at: '2026-08-16T14:40:01.596Z'+ updated_at: '2026-08-16T14:40:01.596Z'non_expiring: falseschema:"$ref": "#/components/schemas/StoreCreditCategory"@@ -20519,8 +20512,8 @@ paths:preferred_order_number_prefix: Rpreferred_order_number_suffix: ''preferred_order_number_sequence_start: 1001- created_at: '2026-08-15T13:59:46.622Z'- updated_at: '2026-08-15T14:00:06.122Z'+ created_at: '2026-08-16T14:39:41.362Z'+ updated_at: '2026-08-16T14:40:01.655Z'order_number_sequence_started: falseurl: http://www.example.com:3000api_url: http://www.example.com:3000@@ -20835,8 +20828,8 @@ paths:preferred_order_number_prefix: Rpreferred_order_number_suffix: ''preferred_order_number_sequence_start: 1001- created_at: '2026-08-15T13:59:46.622Z'- updated_at: '2026-08-15T14:00:06.237Z'+ created_at: '2026-08-16T14:39:41.362Z'+ updated_at: '2026-08-16T14:40:01.824Z'order_number_sequence_started: falseurl: http://www.example.com:3000api_url: http://www.example.com:3000@@ -21233,12 +21226,12 @@ paths:example:data:- id: tax_UkLWZg9DAJ- name: TaxRate - 884556+ name: TaxRate - 762605included_in_price: trueshow_rate_in_label: truemetadata: {}- created_at: '2026-08-15T14:00:06.404Z'- updated_at: '2026-08-15T14:00:06.404Z'+ created_at: '2026-08-16T14:40:01.977Z'+ updated_at: '2026-08-16T14:40:01.977Z'deleted_at:amount: '0.19'amount_percentage: 19.0@@ -21320,8 +21313,8 @@ paths:included_in_price: trueshow_rate_in_label: truemetadata: {}- created_at: '2026-08-15T14:00:06.459Z'- updated_at: '2026-08-15T14:00:06.459Z'+ created_at: '2026-08-16T14:40:02.046Z'+ updated_at: '2026-08-16T14:40:02.046Z'deleted_at:amount: '0.19'amount_percentage: 19.0@@ -21412,12 +21405,12 @@ paths:application/json:example:id: tax_UkLWZg9DAJ- name: TaxRate - 324073+ name: TaxRate - 937320included_in_price: trueshow_rate_in_label: truemetadata: {}- created_at: '2026-08-15T14:00:06.497Z'- updated_at: '2026-08-15T14:00:06.497Z'+ created_at: '2026-08-16T14:40:02.088Z'+ updated_at: '2026-08-16T14:40:02.088Z'deleted_at:amount: '0.19'amount_percentage: 19.0@@ -21454,12 +21447,12 @@ paths:application/json:example:id: tax_UkLWZg9DAJ- name: TaxRate - 494707+ name: TaxRate - 849444included_in_price: trueshow_rate_in_label: truemetadata: {}- created_at: '2026-08-15T14:00:06.527Z'- updated_at: '2026-08-15T14:00:06.547Z'+ created_at: '2026-08-16T14:40:02.116Z'+ updated_at: '2026-08-16T14:40:02.134Z'deleted_at:amount: '0.07'amount_percentage: 7.0@@ -21620,6 +21613,13 @@ paths:- key: bodytype: htmlreadable: false+ - resource_type: vendor+ fields:+ - key: name+ type: string+ - key: about+ type: html+ readable: false"/api/v3/admin/translations/batch":post:summary: Batch upsert translations@@ -21765,13 +21765,13 @@ paths:example:data:- id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Rebekah- last_name: Corkery- full_name: Rebekah Corkery+ email: [email protected]+ first_name: Kandace+ last_name: Koelpin+ full_name: Kandace Koelpinselected_locale:- created_at: '2026-08-15T13:59:46.706Z'- updated_at: '2026-08-15T13:59:46.706Z'+ created_at: '2026-08-16T14:39:41.482Z'+ updated_at: '2026-08-16T14:39:41.482Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -21837,13 +21837,13 @@ paths:application/json:example:id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Hailey- last_name: Volkman- full_name: Hailey Volkman+ email: [email protected]+ first_name: Dottie+ last_name: Vandervort+ full_name: Dottie Vandervortselected_locale:- created_at: '2026-08-15T13:59:46.873Z'- updated_at: '2026-08-15T13:59:46.873Z'+ created_at: '2026-08-16T14:39:41.623Z'+ updated_at: '2026-08-16T14:39:41.623Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -21904,13 +21904,13 @@ paths:application/json:example:id: adm_UkLWZg9DAJ- email: [email protected]+ email: [email protected]first_name: Renamed- last_name: Johns- full_name: Renamed Johns+ last_name: Quigley+ full_name: Renamed Quigleyselected_locale:- created_at: '2026-08-15T13:59:46.894Z'- updated_at: '2026-08-15T13:59:46.908Z'+ created_at: '2026-08-16T14:39:41.649Z'+ updated_at: '2026-08-16T14:39:41.665Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -22026,15 +22026,15 @@ paths:example:data:- id: inv_UkLWZg9DAJ- email: [email protected]+ email: [email protected]status: pending- created_at: '2026-08-15T13:59:53.094Z'- updated_at: '2026-08-15T13:59:53.094Z'- expires_at: '2026-08-29T13:59:53.091Z'+ created_at: '2026-08-16T14:39:47.506Z'+ updated_at: '2026-08-16T14:39:47.506Z'+ expires_at: '2026-08-30T14:39:47.502Z'role_id: role_UkLWZg9DAJrole_name: admin- inviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=Q7QUpqiKTW7CA3Q339whknDZ"+ inviter_email: [email protected]+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=QpbpknHGYf4aXx75M1j1eshj"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -22098,13 +22098,13 @@ paths:id: inv_gbHJdmfrXBemail: [email protected]status: pending- created_at: '2026-08-15T13:59:53.125Z'- updated_at: '2026-08-15T13:59:53.125Z'- expires_at: '2026-08-29T13:59:53.123Z'+ created_at: '2026-08-16T14:39:47.545Z'+ updated_at: '2026-08-16T14:39:47.545Z'+ expires_at: '2026-08-30T14:39:47.542Z'role_id: role_UkLWZg9DAJrole_name: admin- inviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=F7h85tQ9ipcho7p9k33i8ki2"+ inviter_email: [email protected]+ acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=FNQsF2B2LekGgY2o3qPTiSWE"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -22217,15 +22217,15 @@ paths:application/json:example:id: inv_UkLWZg9DAJ- email: [email protected]+ email: [email protected]status: pending- created_at: '2026-08-15T13:59:53.158Z'- updated_at: '2026-08-15T13:59:53.158Z'- expires_at: '2026-08-29T13:59:53.156Z'+ created_at: '2026-08-16T14:39:47.591Z'+ updated_at: '2026-08-16T14:39:47.591Z'+ expires_at: '2026-08-30T14:39:47.590Z'role_id: role_UkLWZg9DAJrole_name: admin- inviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=at38jzkyLiFTp7x8965brLY4"+ inviter_email: [email protected]+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=doQAQKCePug9EE4r6TRepW5e"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -22513,6 +22513,34 @@ paths:group_label: Accesslabel: Staff & rolesdescription: Team members, invitations, roles and their permissions+ - key: read_vendors+ resource: vendors+ kind: read+ group: access+ group_label: Access+ label: Vendors+ description: ''+ - key: write_vendors+ resource: vendors+ kind: write+ group: access+ group_label: Access+ label: Vendors+ description: ''+ - key: read_vendor_profile+ resource: vendor_profile+ kind: read+ group: access+ group_label: Access+ label: Vendor profile+ description: ''+ - key: write_vendor_profile+ resource: vendor_profile+ kind: write+ group: access+ group_label: Access+ label: Vendor profile+ description: ''- key: read_dashboardresource: dashboardkind: read@@ -22521,7 +22549,7 @@ paths:label: Analytics dashboarddescription: Sales and performance analyticsmeta:- count: 35+ count: 39"/api/v3/admin/roles":get:summary: List roles@@ -22570,8 +22598,8 @@ paths:- id: role_UkLWZg9DAJname: admindescription:- created_at: '2026-08-15T14:00:05.615Z'- updated_at: '2026-08-15T14:00:05.615Z'+ created_at: '2026-08-16T14:40:01.053Z'+ updated_at: '2026-08-16T14:40:01.053Z'permissions:- read_orders- write_orders@@ -22607,6 +22635,10 @@ paths:- write_api_keys- read_staff- write_staff+ - read_vendors+ - write_vendors+ - read_vendor_profile+ - write_vendor_profile- read_dashboardmutable: falseusers_count: 1@@ -22671,8 +22703,8 @@ paths:id: role_gbHJdmfrXBname: order_managerdescription: Handles daily orders- created_at: '2026-08-15T14:00:05.648Z'- updated_at: '2026-08-15T14:00:05.648Z'+ created_at: '2026-08-16T14:40:01.090Z'+ updated_at: '2026-08-16T14:40:01.090Z'permissions:- write_orders- read_customers@@ -22766,8 +22798,8 @@ paths:id: role_gbHJdmfrXBname: supportdescription:- created_at: '2026-08-15T14:00:05.671Z'- updated_at: '2026-08-15T14:00:05.681Z'+ created_at: '2026-08-16T14:40:01.124Z'+ updated_at: '2026-08-16T14:40:01.138Z'permissions:- read_orders- read_customers@@ -22963,8 +22995,8 @@ paths:kind: warehousepickup_enabled: falsepickup_stock_policy: local- created_at: '2026-08-15T14:00:05.821Z'- updated_at: '2026-08-15T14:00:05.821Z'+ created_at: '2026-08-16T14:40:01.310Z'+ updated_at: '2026-08-16T14:40:01.310Z'meta:page: 1limit: 25@@ -23078,8 +23110,8 @@ paths:kind: storepickup_enabled: truepickup_stock_policy: local- created_at: '2026-08-15T14:00:05.871Z'- updated_at: '2026-08-15T14:00:05.871Z'+ created_at: '2026-08-16T14:40:01.367Z'+ updated_at: '2026-08-16T14:40:01.367Z'schema:"$ref": "#/components/schemas/StockLocation"'422':@@ -23256,8 +23288,8 @@ paths:kind: warehousepickup_enabled: falsepickup_stock_policy: local- created_at: '2026-08-15T14:00:05.906Z'- updated_at: '2026-08-15T14:00:05.906Z'+ created_at: '2026-08-16T14:40:01.405Z'+ updated_at: '2026-08-16T14:40:01.405Z'schema:"$ref": "#/components/schemas/StockLocation"'404':@@ -23346,8 +23378,8 @@ paths:kind: warehousepickup_enabled: truepickup_stock_policy: local- created_at: '2026-08-15T14:00:05.951Z'- updated_at: '2026-08-15T14:00:05.967Z'+ created_at: '2026-08-16T14:40:01.460Z'+ updated_at: '2026-08-16T14:40:01.478Z'schema:"$ref": "#/components/schemas/StockLocation"'422':@@ -23593,14 +23625,14 @@ paths:country_of_origin:customs_description:deleted_at:- created_at: '2026-08-15T14:00:06.665Z'- updated_at: '2026-08-15T14:00:06.676Z'+ created_at: '2026-08-16T14:40:02.270Z'+ updated_at: '2026-08-16T14:40:02.280Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1019082+ product_name: Product 1014865- id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJsku: SKU-121@@ -23613,10 +23645,10 @@ paths:in_stock: falsebackorderable: truepreorder: false- weight: 30.4- height: 101.36- width: 84.25- depth: 160.61+ weight: 128.39+ height: 190.37+ width: 170.31+ depth: 47.53price:id: price_gbHJdmfrXBamount: '19.99'@@ -23639,8 +23671,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T14:00:06.691Z'- updated_at: '2026-08-15T14:00:06.691Z'+ created_at: '2026-08-16T14:40:02.309Z'+ updated_at: '2026-08-16T14:40:02.309Z'metadata: {}position: 2cost_price: '17.0'@@ -23653,14 +23685,14 @@ paths:country_of_origin:customs_description:deleted_at:- created_at: '2026-08-15T14:00:06.689Z'- updated_at: '2026-08-15T14:00:06.699Z'+ created_at: '2026-08-16T14:40:02.305Z'+ updated_at: '2026-08-16T14:40:02.318Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1019082+ product_name: Product 1014865meta:page: 1limit: 25@@ -23774,8 +23806,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T14:00:06.821Z'- updated_at: '2026-08-15T14:00:06.821Z'+ created_at: '2026-08-16T14:40:02.439Z'+ updated_at: '2026-08-16T14:40:02.439Z'metadata: {}position: 3cost_price:@@ -23788,14 +23820,14 @@ paths:country_of_origin:customs_description:deleted_at:- created_at: '2026-08-15T14:00:06.824Z'- updated_at: '2026-08-15T14:00:06.825Z'+ created_at: '2026-08-16T14:40:02.443Z'+ updated_at: '2026-08-16T14:40:02.444Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1024364+ product_name: Product 1021487'422':description: validation errorcontent:@@ -23982,10 +24014,10 @@ paths:in_stock: falsebackorderable: truepreorder: false- weight: 74.19- height: 136.15- width: 119.61- depth: 38.53+ weight: 6.14+ height: 172.9+ width: 89.62+ depth: 49.23price:id: price_gbHJdmfrXBamount: '19.99'@@ -24008,8 +24040,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T14:00:06.962Z'- updated_at: '2026-08-15T14:00:06.962Z'+ created_at: '2026-08-16T14:40:02.598Z'+ updated_at: '2026-08-16T14:40:02.598Z'metadata: {}position: 2cost_price: '17.0'@@ -24022,14 +24054,14 @@ paths:country_of_origin:customs_description:deleted_at:- created_at: '2026-08-15T14:00:06.958Z'- updated_at: '2026-08-15T14:00:06.970Z'+ created_at: '2026-08-16T14:40:02.595Z'+ updated_at: '2026-08-16T14:40:02.605Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1043344+ product_name: Product 1046215'404':description: variant not foundcontent:@@ -24113,10 +24145,10 @@ paths:in_stock: falsebackorderable: truepreorder: false- weight: 42.76- height: 130.11- width: 85.45- depth: 199.22+ weight: 57.59+ height: 180.97+ width: 7.58+ depth: 102.83price:id: price_gbHJdmfrXBamount: '19.99'@@ -24139,8 +24171,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-15T14:00:07.112Z'- updated_at: '2026-08-15T14:00:07.112Z'+ created_at: '2026-08-16T14:40:02.777Z'+ updated_at: '2026-08-16T14:40:02.777Z'metadata: {}position: 2cost_price: '17.0'@@ -24153,14 +24185,14 @@ paths:country_of_origin:customs_description:deleted_at:- created_at: '2026-08-15T14:00:07.110Z'- updated_at: '2026-08-15T14:00:07.146Z'+ created_at: '2026-08-16T14:40:02.774Z'+ updated_at: '2026-08-16T14:40:02.810Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1067669+ product_name: Product 1069743requestBody:content:application/json:@@ -24405,9 +24437,9 @@ paths:request_errors:response_body:success: false- created_at: '2026-08-15T14:00:07.386Z'- updated_at: '2026-08-15T14:00:07.386Z'- delivered_at: '2026-08-15T14:00:07.385Z'+ created_at: '2026-08-16T14:40:03.393Z'+ updated_at: '2026-08-16T14:40:03.393Z'+ delivered_at: '2026-08-16T14:40:03.393Z'payload:event: order.createddata:@@ -24423,9 +24455,9 @@ paths:request_errors:response_body:success: true- created_at: '2026-08-15T14:00:07.384Z'- updated_at: '2026-08-15T14:00:07.384Z'- delivered_at: '2026-08-15T14:00:07.384Z'+ created_at: '2026-08-16T14:40:03.392Z'+ updated_at: '2026-08-16T14:40:03.392Z'+ delivered_at: '2026-08-16T14:40:03.392Z'payload:event: order.createddata:@@ -24528,9 +24560,9 @@ paths:request_errors:response_body:success: false- created_at: '2026-08-15T14:00:07.520Z'- updated_at: '2026-08-15T14:00:07.520Z'- delivered_at: '2026-08-15T14:00:07.520Z'+ created_at: '2026-08-16T14:40:03.482Z'+ updated_at: '2026-08-16T14:40:03.482Z'+ delivered_at: '2026-08-16T14:40:03.482Z'payload:event: order.createddata:@@ -24619,8 +24651,8 @@ paths:request_errors:response_body:success:- created_at: '2026-08-15T14:00:07.646Z'- updated_at: '2026-08-15T14:00:07.646Z'+ created_at: '2026-08-16T14:40:03.589Z'+ updated_at: '2026-08-16T14:40:03.589Z'delivered_at:payload:event: order.created@@ -24723,8 +24755,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-15T14:00:07.686Z'- updated_at: '2026-08-15T14:00:07.686Z'+ created_at: '2026-08-16T14:40:03.625Z'+ updated_at: '2026-08-16T14:40:03.625Z'disabled_at:secret_key:last_delivery_at:@@ -24819,10 +24851,10 @@ paths:subscriptions:- order.placeddisabled_reason:- created_at: '2026-08-15T14:00:07.931Z'- updated_at: '2026-08-15T14:00:07.931Z'+ created_at: '2026-08-16T14:40:03.754Z'+ updated_at: '2026-08-16T14:40:03.754Z'disabled_at:- secret_key: 560b62e3758fb4613bdf9fda367e88049f369265142367b4e1ddc3c96fe11f44+ secret_key: f48132b2256a8674dea494ecff5da4552824e0fd6f424891fd90a5fd5141aa07last_delivery_at:recent_delivery_count: 0recent_failure_count: 0@@ -24945,8 +24977,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-15T14:00:08.070Z'- updated_at: '2026-08-15T14:00:08.070Z'+ created_at: '2026-08-16T14:40:03.837Z'+ updated_at: '2026-08-16T14:40:03.837Z'disabled_at:secret_key:last_delivery_at:@@ -25025,8 +25057,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-15T14:00:08.194Z'- updated_at: '2026-08-15T14:00:08.209Z'+ created_at: '2026-08-16T14:40:03.919Z'+ updated_at: '2026-08-16T14:40:03.935Z'disabled_at:secret_key:last_delivery_at:@@ -25183,13 +25215,13 @@ paths:request_errors:response_body:success:- created_at: '2026-08-15T14:00:08.472Z'- updated_at: '2026-08-15T14:00:08.472Z'+ created_at: '2026-08-16T14:40:04.078Z'+ updated_at: '2026-08-16T14:40:04.078Z'delivered_at:payload:- id: ccd356f1-b7f8-48ae-ba8b-cf7a2cf892dd+ id: 863faa7e-2a13-4f12-b008-96e1b2ea0036name: webhook.test- created_at: '2026-08-15T14:00:08Z'+ created_at: '2026-08-16T14:40:04Z'data:message: This is a test webhook from Spree.metadata:@@ -25258,8 +25290,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-15T14:00:08.510Z'- updated_at: '2026-08-15T14:00:08.525Z'+ created_at: '2026-08-16T14:40:04.110Z'+ updated_at: '2026-08-16T14:40:04.127Z'disabled_at:secret_key:last_delivery_at:@@ -25336,9 +25368,9 @@ paths:- order.completed- product.createddisabled_reason: Investigating- created_at: '2026-08-15T14:00:08.578Z'- updated_at: '2026-08-15T14:00:08.594Z'- disabled_at: '2026-08-15T14:00:08.594Z'+ created_at: '2026-08-16T14:40:04.182Z'+ updated_at: '2026-08-16T14:40:04.198Z'+ disabled_at: '2026-08-16T14:40:04.198Z'secret_key:last_delivery_at:recent_delivery_count: 0@@ -25421,8 +25453,8 @@ paths:automatic: falserules_match_policy: allmetadata: {}- created_at: '2026-08-15T13:59:48.854Z'- updated_at: '2026-08-15T13:59:48.854Z'+ created_at: '2026-08-16T14:39:43.263Z'+ updated_at: '2026-08-16T14:39:43.263Z'meta:page: 1limit: 25@@ -25490,8 +25522,8 @@ paths:automatic: truerules_match_policy: anymetadata: {}- created_at: '2026-08-15T13:59:48.995Z'- updated_at: '2026-08-15T13:59:48.997Z'+ created_at: '2026-08-16T14:39:43.316Z'+ updated_at: '2026-08-16T14:39:43.318Z'schema:"$ref": "#/components/schemas/Collection"'422':@@ -25618,8 +25650,8 @@ paths:automatic: falserules_match_policy: allmetadata: {}- created_at: '2026-08-15T13:59:49.060Z'- updated_at: '2026-08-15T13:59:49.060Z'+ created_at: '2026-08-16T14:39:43.388Z'+ updated_at: '2026-08-16T14:39:43.388Z'schema:"$ref": "#/components/schemas/Collection"'404':@@ -25683,8 +25715,8 @@ paths:automatic: falserules_match_policy: allmetadata: {}- created_at: '2026-08-15T13:59:49.121Z'- updated_at: '2026-08-15T13:59:49.139Z'+ created_at: '2026-08-16T14:39:43.443Z'+ updated_at: '2026-08-16T14:39:43.463Z'schema:"$ref": "#/components/schemas/Collection"requestBody:@@ -25859,8 +25891,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 65685- slug: product-65685+ name: Product 61813+ slug: product-61813meta_title:meta_description:meta_keywords:@@ -25872,12 +25904,22 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Repellendus dolor perspiciatis iure inventore ut voluptatibus- quisquam autem. Ea tempore cum dicta maxime doloribus unde. Quod- impedit recusandae beatae corrupti itaque deleniti.- description_html: Repellendus dolor perspiciatis iure inventore ut- voluptatibus quisquam autem. Ea tempore cum dicta maxime doloribus- unde. Quod impedit recusandae beatae corrupti itaque deleniti.+ description: Dolores adipisci molestias optio unde maxime laboriosam.+ Magnam optio ipsam expedita architecto harum explicabo. Saepe sapiente+ voluptate eaque illum rerum id doloremque. Dolorum aliquam beatae+ sed eum nobis laudantium. Culpa et rerum quaerat deserunt fuga.+ Maxime hic doloremque iure sapiente adipisci corrupti molestias+ repellendus. Voluptas voluptatum deleniti consequuntur rem. Nulla+ dicta veniam alias dolores. Quis officia voluptatibus tempore quasi+ a. Fugit laboriosam assumenda labore at adipisci. Aspernatur culpa+ esse nisi repellendus reiciendis fugit. Eum dicta voluptas voluptatibus+ veritatis expedita. Eaque laboriosam dolores dicta ducimus corporis.+ Neque ipsa odit corrupti vel.+ description_html: |-+ Dolores adipisci molestias optio unde maxime laboriosam. Magnam optio ipsam expedita architecto harum explicabo. Saepe sapiente voluptate eaque illum rerum id doloremque.+ Dolorum aliquam beatae sed eum nobis laudantium. Culpa et rerum quaerat deserunt fuga. Maxime hic doloremque iure sapiente adipisci corrupti molestias repellendus. Voluptas voluptatum deleniti consequuntur rem.+ Nulla dicta veniam alias dolores. Quis officia voluptatibus tempore quasi a. Fugit laboriosam assumenda labore at adipisci. Aspernatur culpa esse nisi repellendus reiciendis fugit.+ Eum dicta voluptas voluptatibus veritatis expedita. Eaque laboriosam dolores dicta ducimus corporis. Neque ipsa odit corrupti vel.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -25892,14 +25934,14 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-15T13:59:49.250Z'- updated_at: '2026-08-15T13:59:49.250Z'+ created_at: '2026-08-16T14:39:43.561Z'+ updated_at: '2026-08-16T14:39:43.561Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-15T13:59:49.231Z'- updated_at: '2026-08-15T13:59:49.266Z'+ created_at: '2026-08-16T14:39:43.549Z'+ updated_at: '2026-08-16T14:39:43.569Z'delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJ@@ -26102,8 +26144,8 @@ paths:name: Berlinexternal_id:metadata: {}- created_at: '2026-08-15T13:59:49.674Z'- updated_at: '2026-08-15T13:59:49.674Z'+ created_at: '2026-08-16T14:39:43.784Z'+ updated_at: '2026-08-16T14:39:43.784Z'company_id: comp_UkLWZg9DAJcontacts_count: 0billing_address:@@ -26182,8 +26224,8 @@ paths:name: Hamburg warehouseexternal_id:metadata: {}- created_at: '2026-08-15T13:59:49.731Z'- updated_at: '2026-08-15T13:59:49.731Z'+ created_at: '2026-08-16T14:39:43.837Z'+ updated_at: '2026-08-16T14:39:43.837Z'company_id: comp_UkLWZg9DAJcontacts_count: 0billing_address:@@ -26209,8 +26251,8 @@ paths:state_name:label:metadata: {}- created_at: '2026-08-15T13:59:49.730Z'- updated_at: '2026-08-15T13:59:49.730Z'+ created_at: '2026-08-16T14:39:43.836Z'+ updated_at: '2026-08-16T14:39:43.836Z'customer_id:shipping_address:'422':@@ -26309,8 +26351,8 @@ paths:name: Berlinexternal_id:metadata: {}- created_at: '2026-08-15T13:59:49.773Z'- updated_at: '2026-08-15T13:59:49.773Z'+ created_at: '2026-08-16T14:39:43.867Z'+ updated_at: '2026-08-16T14:39:43.867Z'company_id: comp_UkLWZg9DAJcontacts_count: 0billing_address:@@ -26356,8 +26398,8 @@ paths:name: Berlin Mitteexternal_id:metadata: {}- created_at: '2026-08-15T13:59:49.794Z'- updated_at: '2026-08-15T13:59:49.808Z'+ created_at: '2026-08-16T14:39:43.889Z'+ updated_at: '2026-08-16T14:39:43.905Z'company_id: comp_UkLWZg9DAJcontacts_count: 0billing_address:@@ -26472,8 +26514,8 @@ paths:issued_at:expires_at:verified_at:- created_at: '2026-08-15T13:59:49.845Z'- updated_at: '2026-08-15T13:59:49.845Z'+ created_at: '2026-08-16T14:39:43.939Z'+ updated_at: '2026-08-16T14:39:43.939Z'company_id: comp_UkLWZg9DAJcountry_code:state_code:@@ -26557,8 +26599,8 @@ paths:issued_at:expires_at:verified_at:- created_at: '2026-08-15T13:59:49.887Z'- updated_at: '2026-08-15T13:59:49.889Z'+ created_at: '2026-08-16T14:39:43.990Z'+ updated_at: '2026-08-16T14:39:43.992Z'company_id: comp_UkLWZg9DAJcountry_code: DEstate_code:@@ -26687,9 +26729,9 @@ paths:metadata: {}issued_at:expires_at:- verified_at: '2026-08-15T13:59:50.015Z'- created_at: '2026-08-15T13:59:49.985Z'- updated_at: '2026-08-15T13:59:50.015Z'+ verified_at: '2026-08-16T14:39:44.079Z'+ created_at: '2026-08-16T14:39:44.060Z'+ updated_at: '2026-08-16T14:39:44.080Z'company_id: comp_UkLWZg9DAJcountry_code:state_code:@@ -26767,9 +26809,9 @@ paths:metadata: {}issued_at:expires_at:- verified_at: '2026-08-15T13:59:50.026Z'- created_at: '2026-08-15T13:59:50.026Z'- updated_at: '2026-08-15T13:59:50.043Z'+ verified_at: '2026-08-16T14:39:44.090Z'+ created_at: '2026-08-16T14:39:44.090Z'+ updated_at: '2026-08-16T14:39:44.106Z'company_id: comp_UkLWZg9DAJcountry_code:state_code:@@ -26887,8 +26929,8 @@ paths:validation_evidence:source:validated_at:- created_at: '2026-08-15T13:59:50.107Z'- updated_at: '2026-08-15T13:59:50.107Z'+ created_at: '2026-08-16T14:39:44.185Z'+ updated_at: '2026-08-16T14:39:44.185Z'validatable: falsecustomer_id:cart_id:@@ -26950,8 +26992,8 @@ paths:validation_evidence:source:validated_at:- created_at: '2026-08-15T13:59:50.152Z'- updated_at: '2026-08-15T13:59:50.152Z'+ created_at: '2026-08-16T14:39:44.239Z'+ updated_at: '2026-08-16T14:39:44.239Z'validatable: falsecustomer_id:cart_id:@@ -27098,8 +27140,8 @@ paths:name: Acme Industrialexternal_id: ACME-1metadata: {}- created_at: '2026-08-15T13:59:50.214Z'- updated_at: '2026-08-15T13:59:50.214Z'+ created_at: '2026-08-16T14:39:44.299Z'+ updated_at: '2026-08-16T14:39:44.299Z'locations_count: 0meta:page: 1@@ -27161,8 +27203,8 @@ paths:name: Globex Corporationexternal_id: GLBX-42metadata: {}- created_at: '2026-08-15T13:59:50.251Z'- updated_at: '2026-08-15T13:59:50.251Z'+ created_at: '2026-08-16T14:39:44.343Z'+ updated_at: '2026-08-16T14:39:44.343Z'locations_count: 0'422':description: invalid request@@ -27244,8 +27286,8 @@ paths:data:- id: cc_UkLWZg9DAJrole: buyer- created_at: '2026-08-15T13:59:50.299Z'- updated_at: '2026-08-15T13:59:50.299Z'+ created_at: '2026-08-16T14:39:44.384Z'+ updated_at: '2026-08-16T14:39:44.384Z'company_location_id: cloc_UkLWZg9DAJcustomer_id: cust_UkLWZg9DAJemail: [email protected]@@ -27301,11 +27343,11 @@ paths:example:id: cc_gbHJdmfrXBrole: admin- created_at: '2026-08-15T13:59:50.364Z'- updated_at: '2026-08-15T13:59:50.364Z'+ created_at: '2026-08-16T14:39:44.437Z'+ updated_at: '2026-08-16T14:39:44.437Z'company_location_id: cloc_UkLWZg9DAJcustomer_id: cust_gbHJdmfrXB- email: [email protected]+ email: [email protected]'422':description: invalid requestcontent:@@ -27380,8 +27422,8 @@ paths:example:id: cc_UkLWZg9DAJrole: buyer- created_at: '2026-08-15T13:59:50.408Z'- updated_at: '2026-08-15T13:59:50.408Z'+ created_at: '2026-08-16T14:39:44.480Z'+ updated_at: '2026-08-16T14:39:44.480Z'company_location_id: cloc_UkLWZg9DAJcustomer_id: cust_UkLWZg9DAJemail: [email protected]@@ -27464,8 +27506,8 @@ paths:name: Generaldefault: trueposition: 1- created_at: '2026-08-15T13:59:46.679Z'- updated_at: '2026-08-15T13:59:46.679Z'+ created_at: '2026-08-16T14:39:41.448Z'+ updated_at: '2026-08-16T14:39:41.448Z'kind: shippingdigital: falseoffers_pickup: false@@ -27536,11 +27578,11 @@ paths:application/json:example:id: fp_gbHJdmfrXB- name: Oversized 1786802391.653931+ name: Oversized 1786891185.882346default: falseposition: 2- created_at: '2026-08-15T13:59:51.657Z'- updated_at: '2026-08-15T13:59:51.657Z'+ created_at: '2026-08-16T14:39:45.886Z'+ updated_at: '2026-08-16T14:39:45.886Z'kind: shippingdigital: falseoffers_pickup: false@@ -27644,8 +27686,8 @@ paths:id: og_EfhxLZ9ck8name: EU warehouseposition: 2- created_at: '2026-08-15T13:59:51.702Z'- updated_at: '2026-08-15T13:59:51.702Z'+ created_at: '2026-08-16T14:39:45.940Z'+ updated_at: '2026-08-16T14:39:45.940Z'delivery_profile_id: fp_gbHJdmfrXBstock_location_ids:- sloc_UkLWZg9DAJ@@ -27720,11 +27762,11 @@ paths:application/json:example:id: fp_gbHJdmfrXB- name: Bulky 1786802391.7094169+ name: Bulky 1786891185.948169default: falseposition: 2- created_at: '2026-08-15T13:59:51.710Z'- updated_at: '2026-08-15T13:59:51.710Z'+ created_at: '2026-08-16T14:39:45.948Z'+ updated_at: '2026-08-16T14:39:45.948Z'kind: shippingdigital: falseoffers_pickup: false@@ -27855,8 +27897,8 @@ paths:tracking_url:markup_flat: '0.0'markup_percent: '0.0'- created_at: '2026-08-15T13:59:51.777Z'- updated_at: '2026-08-15T13:59:51.780Z'+ created_at: '2026-08-16T14:39:46.044Z'+ updated_at: '2026-08-16T14:39:46.046Z'deleted_at:services: []rules: []@@ -27867,9 +27909,9 @@ paths:stock_location_ids: []calculator_type: Spree::Calculator::Shipping::FlatRatecalculator_preferences:- amounts: {}amount: '10.0'currency: USD+ amounts: {}meta:page: 1limit: 25@@ -27944,8 +27986,8 @@ paths:tracking_url:markup_flat: '0.0'markup_percent: '0.0'- created_at: '2026-08-15T13:59:51.839Z'- updated_at: '2026-08-15T13:59:51.840Z'+ created_at: '2026-08-16T14:39:46.152Z'+ updated_at: '2026-08-16T14:39:46.153Z'deleted_at:services: []rules: []@@ -27956,9 +27998,9 @@ paths:stock_location_ids: []calculator_type: Spree::Calculator::Shipping::FlatRatecalculator_preferences:- amounts: {}amount: '12.5'currency: USD+ amounts: {}requestBody:content:application/json:@@ -28063,18 +28105,21 @@ paths:- type: Spree::Calculator::Shipping::FlatRatename: Flat ratepreference_schema:- - key: amounts- type: hash- default: {}- key: amounttype: decimaldefault: 0- key: currencytype: stringdefault: USD+ - key: amounts+ type: hash+ default: {}- type: Spree::Calculator::Shipping::FlexiRatename: Flexible Rate per package itempreference_schema:+ - key: currency+ type: string+ default: USD- key: first_itemtype: decimaldefault: 0.0@@ -28084,27 +28129,21 @@ paths:- key: max_itemstype: integerdefault: 0- - key: currency- type: string- default: USD- type: Spree::Calculator::Shipping::PerItemname: Flat rate per package itempreference_schema:- - key: amounts- type: hash- default: {}- key: amounttype: decimaldefault: 0- key: currencytype: stringdefault: USD+ - key: amounts+ type: hash+ default: {}- type: Spree::Calculator::Shipping::PriceSackname: Price sackpreference_schema:- - key: minimal_amount- type: decimal- default: 0- key: normal_amounttype: decimaldefault: 0@@ -28114,18 +28153,21 @@ paths:- key: currencytype: stringdefault: USD+ - key: minimal_amount+ type: decimal+ default: 0- type: Spree::Calculator::Shipping::DigitalDeliveryname: Digital Deliverypreference_schema:- - key: amounts- type: hash- default: {}- key: amounttype: decimaldefault: 0- key: currencytype: stringdefault: USD+ - key: amounts+ type: hash+ default: {}"/api/v3/admin/delivery_zones":post:summary: Create delivery zone@@ -28195,8 +28237,8 @@ paths:postal_code_to:country_name: United Statesstate_name:- created_at: '2026-08-15T13:59:51.918Z'- updated_at: '2026-08-15T13:59:51.918Z'+ created_at: '2026-08-16T14:39:46.257Z'+ updated_at: '2026-08-16T14:39:46.257Z'- id: dzm_gbHJdmfrXBmember_type: postal_codecountry_code: US@@ -28206,10 +28248,10 @@ paths:postal_code_to:country_name: United Statesstate_name:- created_at: '2026-08-15T13:59:51.919Z'- updated_at: '2026-08-15T13:59:51.919Z'- created_at: '2026-08-15T13:59:51.918Z'- updated_at: '2026-08-15T13:59:51.918Z'+ created_at: '2026-08-16T14:39:46.257Z'+ updated_at: '2026-08-16T14:39:46.257Z'+ created_at: '2026-08-16T14:39:46.256Z'+ updated_at: '2026-08-16T14:39:46.256Z'delivery_profile_id: fp_UkLWZg9DAJdelivery_origin_group_id: og_UkLWZg9DAJdelivery_method_ids: []@@ -28304,8 +28346,8 @@ paths:- id: int_UkLWZg9DAJname: Carrieractive: false- created_at: '2026-08-15T13:59:53.002Z'- updated_at: '2026-08-15T13:59:53.002Z'+ created_at: '2026-08-16T14:39:47.390Z'+ updated_at: '2026-08-16T14:39:47.390Z'type: carriergroup: shippingpreferences:@@ -28377,8 +28419,8 @@ paths:id: int_UkLWZg9DAJname: Carrieractive: false- created_at: '2026-08-15T13:59:53.037Z'- updated_at: '2026-08-15T13:59:53.037Z'+ created_at: '2026-08-16T14:39:47.432Z'+ updated_at: '2026-08-16T14:39:47.432Z'type: carriergroup: shippingpreferences:@@ -28570,8 +28612,8 @@ paths:- id: pt_UkLWZg9DAJname: T-Shirtproducts_count: 0- created_at: '2026-08-15T14:00:02.609Z'- updated_at: '2026-08-15T14:00:02.609Z'+ created_at: '2026-08-16T14:39:57.759Z'+ updated_at: '2026-08-16T14:39:57.759Z'delivery_profile_id:option_type_ids: []category_ids: []@@ -28646,8 +28688,8 @@ paths:id: pt_gbHJdmfrXBname: Hoodieproducts_count: 0- created_at: '2026-08-15T14:00:02.676Z'- updated_at: '2026-08-15T14:00:02.676Z'+ created_at: '2026-08-16T14:39:57.819Z'+ updated_at: '2026-08-16T14:39:57.819Z'delivery_profile_id:option_type_ids: []category_ids: []@@ -28747,8 +28789,8 @@ paths:id: pt_UkLWZg9DAJname: T-Shirtproducts_count: 0- created_at: '2026-08-15T14:00:02.712Z'- updated_at: '2026-08-15T14:00:02.712Z'+ created_at: '2026-08-16T14:39:57.857Z'+ updated_at: '2026-08-16T14:39:57.857Z'delivery_profile_id:option_type_ids: []category_ids: []@@ -28801,8 +28843,8 @@ paths:id: pt_UkLWZg9DAJname: Premium T-Shirtproducts_count: 0- created_at: '2026-08-15T14:00:02.757Z'- updated_at: '2026-08-15T14:00:02.775Z'+ created_at: '2026-08-16T14:39:57.913Z'+ updated_at: '2026-08-16T14:39:57.934Z'delivery_profile_id:option_type_ids: []category_ids: []@@ -28915,6 +28957,1043 @@ paths:properties:products_count:type: integer+ "/api/v3/admin/vendors":+ get:+ summary: List vendors+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Returns the sellers on this marketplace. `status` says where each one+ is in its life on the marketplace, and `sellable` answers the question+ the status alone cannot: an approved vendor who is away cannot be+ bought from either.+++ **Required scope:** `read_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // `sellable` is the one to read for "can this seller be bought from" — an+ // approved vendor who is away answers false.+ const { data: vendors } = await client.vendors.list({ page: 1, limit: 25 })+ - lang: bash+ label: Spree CLI+ source: spree api get /vendors -d '{"page":1,"limit":25}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ description: Bearer token for admin authentication+ schema:+ type: string+ - name: page+ in: query+ required: false+ description: Page number+ schema:+ type: integer+ - name: limit+ in: query+ required: false+ description: Number of records per page+ schema:+ type: integer+ - name: q[name_cont]+ in: query+ required: false+ description: Filter by name (contains)+ schema:+ type: string+ - name: q[status_eq]+ in: query+ required: false+ description: Filter by status+ schema:+ type: string+ - name: sort+ in: query+ required: false+ description: Sort by field. Prefix with `-` for descending (e.g., `-created_at`).+ schema:+ type: string+ responses:+ '200':+ description: vendors found+ content:+ application/json:+ example:+ data:+ - id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: pending+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata: {}+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:02.923Z'+ updated_at: '2026-08-16T14:40:02.923Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ meta:+ page: 1+ limit: 25+ count: 1+ pages: 1+ from: 1+ to: 1+ in: 1+ previous:+ next:+ schema:+ type: object+ properties:+ data:+ type: array+ items:+ "$ref": "#/components/schemas/Vendor"+ meta:+ "$ref": "#/components/schemas/PaginationMeta"+ required:+ - data+ - meta+ '401':+ description: unauthorized+ content:+ application/json:+ example:+ error:+ code: authentication_required+ message: Authentication required+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ post:+ summary: Create a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Opens a seller record. The vendor starts as `pending` and has no team+ yet — invite someone to run it with the `invite` action below.++ `status` is deliberately not writable here or on update: every move+ through the lifecycle is its own action, because each one does more+ than set a column.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // The vendor starts as `pending` and has no team yet — invite someone to run+ // it next.+ const vendor = await client.vendors.create({+ name: 'Northwind Books',+ contact_email: '[email protected]',+ })+ - lang: bash+ label: Spree CLI+ source: spree api post /vendors -d '{"name":"Northwind Books","contact_email":"[email protected]"}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '201':+ description: vendor created+ content:+ application/json:+ example:+ id: ven_gbHJdmfrXB+ name: Northwind Books+ slug: northwind-books+ status: pending+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata: {}+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:02.986Z'+ updated_at: '2026-08-16T14:40:02.986Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ schema:+ "$ref": "#/components/schemas/Vendor"+ '422':+ description: validation error+ content:+ application/json:+ example:+ error:+ code: validation_error+ message: Name can't be blank and Slug can't be blank+ details:+ name:+ - can't be blank+ slug:+ - can't be blank+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ required:+ - name+ properties:+ name:+ type: string+ example: Northwind Books+ slug:+ type: string+ example: northwind-books+ description: Derived from the name when omitted.+ contact_email:+ type: string+ example: [email protected]+ nullable: true+ billing_email:+ type: string+ example: [email protected]+ nullable: true+ about:+ type: string+ example: "<p>Independent bookshop.</p>"+ nullable: true+ tax_remittance:+ type: string+ enum:+ - vendor+ - platform+ example: vendor+ payouts_schedule_interval:+ type: string+ enum:+ - daily+ - weekly+ - biweekly+ - monthly+ - manual+ nullable: true+ minimum_payout_amount:+ type: string+ example: '25.0'+ nullable: true+ "/api/v3/admin/vendors/{id}":+ parameters:+ - name: id+ in: path+ required: true+ description: Vendor prefixed ID+ schema:+ type: string+ get:+ summary: Get a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Returns a single vendor, including its settlement and tax configuration.++ **Required scope:** `read_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ const vendor = await client.vendors.get('ven_UkLWZg9DAJ')+ - lang: bash+ label: Spree CLI+ source: spree api get /vendors/{id}+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: vendor found+ content:+ application/json:+ example:+ id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: pending+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata: {}+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:03.025Z'+ updated_at: '2026-08-16T14:40:03.025Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ schema:+ "$ref": "#/components/schemas/Vendor"+ '404':+ description: vendor not found+ content:+ application/json:+ example:+ error:+ code: record_not_found+ message: Vendor not found+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ patch:+ summary: Update a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Updates the vendor's profile and the settlement configuration the+ operator owns. A `status` sent here is ignored — use the lifecycle+ actions.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // `status` is not writable here: each move through the lifecycle is its own+ // action, because each one does more than set a column.+ const vendor = await client.vendors.update('ven_UkLWZg9DAJ', {+ billing_email: '[email protected]',+ payouts_schedule_interval: 'weekly',+ minimum_payout_amount: '25.0',+ })+ - lang: bash+ label: Spree CLI+ source: spree api patch /vendors/{id} -d '{"billing_email":"[email protected]","payouts_schedule_interval":"weekly","minimum_payout_amount":"25.0"}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: vendor address written inline+ content:+ application/json:+ example:+ id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: pending+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata: {}+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:03.105Z'+ updated_at: '2026-08-16T14:40:03.125Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ billing_address:+ id: addr_UkLWZg9DAJ+ first_name: Ada+ last_name: Lovelace+ full_name: Ada Lovelace+ address1: 1 Vendor Way+ address2:+ postal_code: EC1A 1BB+ city: London+ phone: '555'+ company:+ country_name: United Kingdom+ country_code: GB+ state_text:+ state_code:+ quick_checkout: false+ is_default_billing: false+ is_default_shipping: false+ state_abbr:+ country_iso: GB+ state_name:+ label:+ metadata: {}+ created_at: '2026-08-16T14:40:03.125Z'+ updated_at: '2026-08-16T14:40:03.125Z'+ customer_id:+ schema:+ "$ref": "#/components/schemas/Vendor"+ '422':+ description: validation error+ content:+ application/json:+ example:+ error:+ code: validation_error+ message: Name can't be blank+ details:+ name:+ - can't be blank+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ name:+ type: string+ example: Sparks Audio Ltd+ billing_email:+ type: string+ example: [email protected]+ nullable: true+ payouts_schedule_interval:+ type: string+ enum:+ - daily+ - weekly+ - biweekly+ - monthly+ - manual+ nullable: true+ minimum_payout_amount:+ type: string+ example: '25.0'+ nullable: true+ holiday_mode_until:+ type: string+ format: date-time+ nullable: true+ logo:+ type: string+ nullable: true+ description: ActiveStorage signed id of a direct-uploaded file.+ Send `null` to remove the attachment, or omit the key to leave+ it alone. Same for `square_logo` and `cover_photo`.+ square_logo:+ type: string+ nullable: true+ cover_photo:+ type: string+ nullable: true+ billing_address:+ type: object+ description: The vendor's own address, written inline. There is+ no `billing_address_id` — an address belongs to whoever it was+ created for, so it is never referenced by id here.+ properties:+ first_name:+ type: string+ example: Ada+ last_name:+ type: string+ example: Lovelace+ company:+ type: string+ example: Sparks Audio Ltd+ address1:+ type: string+ example: 1 Vendor Way+ address2:+ type: string+ example: Unit 4+ city:+ type: string+ example: London+ postal_code:+ type: string+ example: EC1A 1BB+ phone:+ type: string+ example: "+44 20 7946 0000"+ country_code:+ type: string+ example: GB+ state_code:+ type: string+ example: NY+ state_name:+ type: string+ example: New York+ label:+ type: string+ example: Head office+ returns_address:+ type: object+ description: The vendor's own address, written inline. There is+ no `billing_address_id` — an address belongs to whoever it was+ created for, so it is never referenced by id here.+ properties:+ first_name:+ type: string+ example: Ada+ last_name:+ type: string+ example: Lovelace+ company:+ type: string+ example: Sparks Audio Ltd+ address1:+ type: string+ example: 1 Vendor Way+ address2:+ type: string+ example: Unit 4+ city:+ type: string+ example: London+ postal_code:+ type: string+ example: EC1A 1BB+ phone:+ type: string+ example: "+44 20 7946 0000"+ country_code:+ type: string+ example: GB+ state_code:+ type: string+ example: NY+ state_name:+ type: string+ example: New York+ label:+ type: string+ example: Head office+ delete:+ summary: Delete a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Soft-deletes the vendor. Their products are kept and left without a+ seller rather than deleted — what happens to a departed seller's+ catalog is the operator's decision.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // Soft-deletes the vendor. Their products stay in the catalog without a+ // seller rather than being deleted with them.+ await client.vendors.delete('ven_UkLWZg9DAJ')+ - lang: bash+ label: Spree CLI+ source: spree api delete /vendors/{id}+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '204':+ description: vendor deleted+ "/api/v3/admin/vendors/{id}/invite":+ parameters:+ - name: id+ in: path+ required: true+ description: Vendor prefixed ID+ schema:+ type: string+ post:+ summary: Invite someone to run a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Sends an invitation to the vendor's own team and moves the vendor to+ `invited`. The person becomes a member when they accept, and can then+ sign in to the vendor panel.++ `role_id` must name a role this vendor owns; omit it for the vendor's+ own admin role. Re-inviting is allowed — an invitation expires, or the+ first one goes to the wrong address.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // They join the vendor's team when they accept, and can then sign in to the+ // vendor panel. Omit `role_id` for the vendor's own admin role.+ const vendor = await client.vendors.invite('ven_UkLWZg9DAJ', {+ email: '[email protected]',+ })+ - lang: bash+ label: Spree CLI+ source: spree api post /vendors/{id}/invite -d '{"email":"[email protected]"}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '201':+ description: invitation sent+ content:+ application/json:+ example:+ id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: invited+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata: {}+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:03.206Z'+ updated_at: '2026-08-16T14:40:03.227Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ schema:+ "$ref": "#/components/schemas/Vendor"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ required:+ properties:+ email:+ type: string+ example: [email protected]+ role_id:+ type: string+ example: role_UkLWZg9DAJ+ nullable: true+ "/api/v3/admin/vendors/{id}/approve":+ parameters:+ - name: id+ in: path+ required: true+ description: Vendor prefixed ID+ schema:+ type: string+ patch:+ summary: Approve a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Lets the vendor sell. This is also the way back for one that was+ suspended or turned down, and it clears any holiday along with the+ suspension.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // Also the way back for a vendor that was suspended or turned down — and it+ // clears any holiday along with the suspension.+ const vendor = await client.vendors.approve('ven_UkLWZg9DAJ')+ - lang: bash+ label: Spree CLI+ source: spree api patch /vendors/{id}/approve -d '{ ... }'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: vendor approved+ content:+ application/json:+ example:+ id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: approved+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata: {}+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:03.241Z'+ updated_at: '2026-08-16T14:40:03.260Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: true+ products_count: 0+ users_count: 0+ schema:+ "$ref": "#/components/schemas/Vendor"+ '422':+ description: vendor cannot be approved from its current status+ content:+ application/json:+ example:+ error:+ code: processing_error+ message: already_approved+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ "/api/v3/admin/vendors/{id}/suspend":+ parameters:+ - name: id+ in: path+ required: true+ description: Vendor prefixed ID+ schema:+ type: string+ patch:+ summary: Suspend a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Stops a trading vendor from selling. Their catalog and history stay,+ and approving reinstates them. Use this rather than `reject` for a+ vendor already on the marketplace — it says something different, and+ it can be undone.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // Stops a trading vendor from selling. Their catalog and history stay, and+ // approving reinstates them.+ const vendor = await client.vendors.suspend('ven_UkLWZg9DAJ', {+ reason: 'Counterfeit goods',+ })+ - lang: bash+ label: Spree CLI+ source: spree api patch /vendors/{id}/suspend -d '{"reason":"Counterfeit goods"}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: vendor suspended+ content:+ application/json:+ example:+ id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: suspended+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata:+ suspension_reason: Counterfeit goods+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:03.296Z'+ updated_at: '2026-08-16T14:40:03.316Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ schema:+ "$ref": "#/components/schemas/Vendor"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ reason:+ type: string+ example: Counterfeit goods+ "/api/v3/admin/vendors/{id}/reject":+ parameters:+ - name: id+ in: path+ required: true+ description: Vendor prefixed ID+ schema:+ type: string+ patch:+ summary: Reject a vendor+ tags:+ - Vendors+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Turns down an applicant who never traded. A vendor already selling is+ suspended instead; rejecting one is refused.+++ **Required scope:** `write_vendors` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ // For an applicant who never traded. A vendor already selling is suspended+ // instead.+ const vendor = await client.vendors.reject('ven_UkLWZg9DAJ', {+ reason: 'Incomplete paperwork',+ })+ - lang: bash+ label: Spree CLI+ source: spree api patch /vendors/{id}/reject -d '{"reason":"Incomplete paperwork"}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: vendor rejected+ content:+ application/json:+ example:+ id: ven_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ status: rejected+ contact_email: [email protected]+ billing_email:+ tax_remittance: vendor+ payouts_schedule_interval:+ metadata:+ rejection_reason: Incomplete paperwork+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-08-16T14:40:03.329Z'+ updated_at: '2026-08-16T14:40:03.350Z'+ deleted_at:+ minimum_payout_amount:+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ schema:+ "$ref": "#/components/schemas/Vendor"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ reason:+ type: string+ example: Incomplete paperworkservers:- url: http://{defaultHost}variables:@@ -34510,6 +35589,98 @@ components:- total_on_hand- product_namex-typelizer: true+ Vendor:+ type: object+ properties:+ id:+ type: string+ name:+ type: string+ slug:+ type: string+ status:+ type: string+ contact_email:+ type: string+ nullable: true+ billing_email:+ type: string+ nullable: true+ tax_remittance:+ type: string+ payouts_schedule_interval:+ type: string+ nullable: true+ metadata:+ type: object+ nullable: true+ holiday_mode_until:+ type: string+ nullable: true+ terms_accepted_at:+ type: string+ nullable: true+ created_at:+ type: string+ updated_at:+ type: string+ deleted_at:+ type: string+ nullable: true+ minimum_payout_amount:+ type: string+ nullable: true+ about:+ type: string+ about_html:+ type: string+ logo_url:+ type: string+ nullable: true+ square_logo_url:+ type: string+ nullable: true+ cover_photo_url:+ type: string+ nullable: true+ on_holiday:+ type: boolean+ sellable:+ type: boolean+ products_count:+ type: number+ users_count:+ type: number+ billing_address:+ "$ref": "#/components/schemas/Address"+ returns_address:+ "$ref": "#/components/schemas/Address"+ required:+ - id+ - name+ - slug+ - status+ - contact_email+ - billing_email+ - tax_remittance+ - payouts_schedule_interval+ - metadata+ - holiday_mode_until+ - terms_accepted_at+ - created_at+ - updated_at+ - deleted_at+ - minimum_payout_amount+ - about+ - about_html+ - logo_url+ - square_logo_url+ - cover_photo_url+ - on_holiday+ - sellable+ - products_count+ - users_count+ x-typelizer: trueWebhookDelivery:type: objectproperties:diff --git a/docs/plans/6.0-multi-vendor-marketplace.md b/docs/plans/6.0-multi-vendor-marketplace.mdindex 6f2615e1dd..b730d5261b 100644--- a/docs/plans/6.0-multi-vendor-marketplace.md+++ b/docs/plans/6.0-multi-vendor-marketplace.md@@ -664,6 +664,9 @@ Even before this lands, work touching adjacent areas should:## Resolved Decisions+- **Vendor lifecycle → four workflows, never a writable `status`** (RESOLVED 2026-08-16, shipped). `Spree::Vendors::Invite` / `Approve` / `Suspend` / `Reject` (seams `vendor_invite_workflow` and siblings), each with `validate` + `after_*` hooks and its own `vendor.*` event. The Admin API exposes them as member actions (`POST invite`, `PATCH approve|suspend|reject`) and deliberately omits `status` from `permitted_params` — a PATCH that moved a vendor would skip the mail, the payout provisioning and the extension hooks, which is exactly what `6.0-service-workflows.md` keeps out of a column write. Guards admit more than the linear path: `Approve` also lifts a suspension (clearing holiday mode with it) and revives a rejected applicant; `Suspend` is for a vendor already on the marketplace while `Reject` is for one that never traded, so rejecting an approved vendor is refused. Suspension and rejection reasons live in `metadata` rather than columns — each is a note about one event, and the next one has its own. Creation stays plain CRUD (it is not a lifecycle transition), so the default status is applied in an `after_initialize` on the model, as on `Spree::Fulfillment`.+- **Lifecycle emails are seller-facing, event-driven, and skip the invitation** (RESOLVED 2026-08-16, shipped). `Spree::VendorMailer` (approved/suspended/rejected) in `spree_emails`, fired by `Spree::VendorEmailSubscriber` off the `vendor.*` events the workflows already publish — nothing mails from a workflow step, so mail is one listener among several rather than something a transition waits on. Three departures from the legacy module: **no `vendor.invited` email** (inviting creates an `Invitation`, which already mails the invitee — a second message would be the same news to the same address), **no marketplace-staff copies** (the legacy module mailed every store admin on approval and onboarding; staff read status in the dashboard, and per-admin fan-out across many sellers is the kind of noise merchants switch off — staff notifications ride the event/webhook surface), and **suspension/rejection reasons never appear in the email** (the operator's note is an internal record; the seller is asked to get in touch). Gated on a new `send_vendor_transactional_emails` Store preference rather than the consumer one — sellers are a different audience, and silencing customer receipts must not silence seller mail. Onboarding started/completed emails wait for the onboarding task registry.+- **Vendor management is staff-only, on its own catalog resource** (RESOLVED 2026-08-16, shipped). `register_resource(:vendors, …)` mints `read_vendors`/`write_vendors` with `Spree::Vendor` as its subject, and is deliberately not offered to the `vendor` audience — a seller administering other sellers is the one thing the vendor key must never allow. `vendor_profile` (the seller's own record, on the vendor branch) therefore claims no subject, so the subject→resource lookup stays unambiguous.- **Vendor principal → `Spree::AdminUser` (`Spree.admin_user_class`), no `VendorUser` model** (RESOLVED 2026-08-15). Reuse the whole shipped auth stack and the RBAC rails (`RoleUser`/`Invitation` on `resource: vendor`); membership is by resource type, never `store_id`. Isolation guaranteed at the token layer: own `vendor_api` JWT audience, own `Spree.vendor_authentication_strategies` + `/vendor/auth/*` (so staff can be SSO-only while vendors use passwords; the vendor login refuses non-members), `spree_refresh_tokens.audience`. See Decision 10 + `decisions.md` 2026-08-15.- **Vendor API → dedicated `/api/v3/vendor` branch, `current_vendor` scope-fetching; vendors never call the Admin API** (RESOLVED 2026-08-15). Supersedes the 2026-07-14 "vendor users hit the same admin API with vendor-scoped abilities" wording — permission sets with tenancy conditions no longer exist (RBAC, PR #14412), and the RBAC plan's 2026-08-08 direction already named `current_vendor` endpoints. Own serializer branch off the store serializers, own OpenAPI spec, no subclassing of admin controllers. See Decision 10.- **Store credit / gift cards split across child orders → group-level payments, prorated through `PaymentSplit` like any other payment** (RESOLVED 2026-08-15). A store-credit or gift-card payment is a `Payment` on the `OrderGroup` exactly like the gateway payment; every group payment gets one `PaymentSplit` row per child order, prorated by child totals with the same largest-remainder rule as order-level discounts. One attribution rule for every payment source, no priority ordering, no special-casing — and it composes with the resolved payment-source-agnostic transfer basis (the vendor's earning never depends on how the buyer paid). Confirmed against the shipped `Carts::Complete` pipeline (payments attach before the split runs).diff --git a/docs/plans/decisions.md b/docs/plans/decisions.mdindex d82dbf488b..b3eeb39a9f 100644--- a/docs/plans/decisions.md+++ b/docs/plans/decisions.md@@ -1,3 +1,38 @@+## 2026-08-16: A vendor's status is something that happened to it, not a field you set++Damian asked for vendor management with "invitation, approvals, all in+workflows". Recording why the API refuses the obvious shortcut.++**The shortcut we did not take.** A `status` in `permitted_params` would have+made the whole lifecycle one endpoint. It is also how the transitions stop+meaning anything: approving a vendor sends mail, provisions payouts and is the+moment extensions want to hook — none of which happens when the value arrives+by mass assignment. So each move is its own workflow (`Spree::Vendors::Invite`,+`Approve`, `Suspend`, `Reject`), reached through its own member action, and+`status` is simply not writable. Consistent with returns and claims, which+already ship this way.++**The guards admit more than the happy path**, because the interesting moves+are the ones back. `Approve` lifts a suspension and revives a rejected+applicant, and it clears holiday mode on the way — a vendor coming back is+coming back to sell, and leaving them invisible would look like the approval+had not worked. `Suspend` and `Reject` are not synonyms: suspension is for a+vendor already trading and can be undone; rejection is for one that never did.+Rejecting an approved vendor is refused rather than quietly aliased, because+the two say different things to the person on the other end.++**Reasons live in metadata, not columns.** A suspension reason is a note about+one event; the next suspension has its own. A column would hold only the most+recent and read as though it described the vendor.++**Creating a vendor is not a transition**, so it stays plain CRUD and the+default status is applied in an `after_initialize`, following+`Spree::Fulfillment`. Only the moves are workflows.++**Managing sellers is staff-only.** `read_vendors`/`write_vendors` are not+offered to the vendor audience: a seller administering other sellers is the one+thing that key must never allow.+## 2026-08-16: Several sellers share a product by sharing it — the seller is on the variant, not on an offer recordDamian's call, after a survey of how marketplace platforms model a shareddiff --git a/packages/admin-sdk/examples/vendors/approve.ts b/packages/admin-sdk/examples/vendors/approve.tsnew file mode 100644index 0000000000..b6d70e3411--- /dev/null+++ b/packages/admin-sdk/examples/vendors/approve.ts@@ -0,0 +1,15 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// Also the way back for a vendor that was suspended or turned down — and it+// clears any holiday along with the suspension.+const vendor = await client.vendors.approve('ven_UkLWZg9DAJ')++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/examples/vendors/create.ts b/packages/admin-sdk/examples/vendors/create.tsnew file mode 100644index 0000000000..77f4727871--- /dev/null+++ b/packages/admin-sdk/examples/vendors/create.ts@@ -0,0 +1,18 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// The vendor starts as `pending` and has no team yet — invite someone to run+// it next.+const vendor = await client.vendors.create({+ name: 'Northwind Books',+ contact_email: '[email protected]',+})++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/examples/vendors/delete.ts b/packages/admin-sdk/examples/vendors/delete.tsnew file mode 100644index 0000000000..7d86976ce7--- /dev/null+++ b/packages/admin-sdk/examples/vendors/delete.ts@@ -0,0 +1,12 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// Soft-deletes the vendor. Their products stay in the catalog without a+// seller rather than being deleted with them.+await client.vendors.delete('ven_UkLWZg9DAJ')+// endregion:examplediff --git a/packages/admin-sdk/examples/vendors/get.ts b/packages/admin-sdk/examples/vendors/get.tsnew file mode 100644index 0000000000..48ed553795--- /dev/null+++ b/packages/admin-sdk/examples/vendors/get.ts@@ -0,0 +1,13 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+const vendor = await client.vendors.get('ven_UkLWZg9DAJ')++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/examples/vendors/invite.ts b/packages/admin-sdk/examples/vendors/invite.tsnew file mode 100644index 0000000000..dfa6e8922d--- /dev/null+++ b/packages/admin-sdk/examples/vendors/invite.ts@@ -0,0 +1,17 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// They join the vendor's team when they accept, and can then sign in to the+// vendor panel. Omit `role_id` for the vendor's own admin role.+const vendor = await client.vendors.invite('ven_UkLWZg9DAJ', {+ email: '[email protected]',+})++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/examples/vendors/list.ts b/packages/admin-sdk/examples/vendors/list.tsnew file mode 100644index 0000000000..ee65cf5091--- /dev/null+++ b/packages/admin-sdk/examples/vendors/list.ts@@ -0,0 +1,15 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// `sellable` is the one to read for "can this seller be bought from" — an+// approved vendor who is away answers false.+const { data: vendors } = await client.vendors.list({ page: 1, limit: 25 })++// endregion:example++export { vendors }diff --git a/packages/admin-sdk/examples/vendors/reject.ts b/packages/admin-sdk/examples/vendors/reject.tsnew file mode 100644index 0000000000..a4b68c3166--- /dev/null+++ b/packages/admin-sdk/examples/vendors/reject.ts@@ -0,0 +1,17 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// For an applicant who never traded. A vendor already selling is suspended+// instead.+const vendor = await client.vendors.reject('ven_UkLWZg9DAJ', {+ reason: 'Incomplete paperwork',+})++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/examples/vendors/suspend.ts b/packages/admin-sdk/examples/vendors/suspend.tsnew file mode 100644index 0000000000..f22203b96c--- /dev/null+++ b/packages/admin-sdk/examples/vendors/suspend.ts@@ -0,0 +1,17 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// Stops a trading vendor from selling. Their catalog and history stay, and+// approving reinstates them.+const vendor = await client.vendors.suspend('ven_UkLWZg9DAJ', {+ reason: 'Counterfeit goods',+})++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/examples/vendors/update.ts b/packages/admin-sdk/examples/vendors/update.tsnew file mode 100644index 0000000000..7bbd0de097--- /dev/null+++ b/packages/admin-sdk/examples/vendors/update.ts@@ -0,0 +1,19 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+// `status` is not writable here: each move through the lifecycle is its own+// action, because each one does more than set a column.+const vendor = await client.vendors.update('ven_UkLWZg9DAJ', {+ billing_email: '[email protected]',+ payouts_schedule_interval: 'weekly',+ minimum_payout_amount: '25.0',+})++// endregion:example++export { vendor }diff --git a/packages/admin-sdk/src/admin-client.ts b/packages/admin-sdk/src/admin-client.tsindex 123cac4d1e..60144e1026 100644--- a/packages/admin-sdk/src/admin-client.ts+++ b/packages/admin-sdk/src/admin-client.ts@@ -219,6 +219,11 @@ import type {TrackingCarrierOption,VariantCreateParams,VariantUpdateParams,+ VendorCreateParams,+ VendorInviteParams,+ VendorRejectParams,+ VendorSuspendParams,+ VendorUpdateParams,WebhookEndpointCreateParams,WebhookEndpointDisableParams,WebhookEndpointUpdateParams,@@ -299,6 +304,7 @@ import type {TranslatableResource,TranslationBatchEntry,Variant,+ Vendor,WebhookDelivery,WebhookEndpoint,} from './types'@@ -2343,6 +2349,60 @@ export class AdminClient {this.request<void>('DELETE', `/customer_groups/${id}`, options),}+ // ============================================+ // Marketplace sellers+ // ============================================++ /**+ * CRUD for `Spree::Vendor`, plus the lifecycle actions. Status is never+ * writable through `update` — each transition is a workflow that also+ * sends mail and runs extension hooks, so moving a vendor by hand would+ * skip all of it.+ */+ readonly vendors = {+ list: (+ params?: ListParams & Record<string, unknown>,+ options?: RequestOptions,+ ): Promise<PaginatedResponse<Vendor>> =>+ this.request<PaginatedResponse<Vendor>>('GET', '/vendors', {+ ...options,+ params: params ? transformListParams(params) : undefined,+ }),++ get: (id: string, params?: { expand?: string[] }, options?: RequestOptions): Promise<Vendor> =>+ this.request<Vendor>('GET', `/vendors/${id}`, {+ ...options,+ params: getParams(params),+ }),++ create: (params: VendorCreateParams, options?: RequestOptions): Promise<Vendor> =>+ this.request<Vendor>('POST', '/vendors', { ...options, body: params }),++ update: (id: string, params: VendorUpdateParams, options?: RequestOptions): Promise<Vendor> =>+ this.request<Vendor>('PATCH', `/vendors/${id}`, { ...options, body: params }),++ delete: (id: string, options?: RequestOptions): Promise<void> =>+ this.request<void>('DELETE', `/vendors/${id}`, options),++ /** Opens the vendor's team to someone; they join when they accept. */+ invite: (id: string, params: VendorInviteParams, options?: RequestOptions): Promise<Vendor> =>+ this.request<Vendor>('POST', `/vendors/${id}/invite`, { ...options, body: params }),++ /** Lets the vendor trade — also the way back from suspended or rejected. */+ approve: (id: string, options?: RequestOptions): Promise<Vendor> =>+ this.request<Vendor>('PATCH', `/vendors/${id}/approve`, options),++ suspend: (+ id: string,+ params?: VendorSuspendParams,+ options?: RequestOptions,+ ): Promise<Vendor> =>+ this.request<Vendor>('PATCH', `/vendors/${id}/suspend`, { ...options, body: params }),++ reject: (id: string, params?: VendorRejectParams, options?: RequestOptions): Promise<Vendor> =>+ this.request<Vendor>('PATCH', `/vendors/${id}/reject`, { ...options, body: params }),+ }+// ============================================// Gift cards (admin-issued)// ============================================diff --git a/packages/admin-sdk/src/params.ts b/packages/admin-sdk/src/params.tsindex 1c601db0ff..92d338243f 100644--- a/packages/admin-sdk/src/params.ts+++ b/packages/admin-sdk/src/params.ts@@ -1350,6 +1350,73 @@ export interface CustomerGroupUpdateParams {customer_ids?: string[]}+/**+ * A marketplace seller. `status` is absent by design — a vendor moves+ * through its lifecycle via the invite/approve/suspend/reject actions,+ * never through a plain update.+ */+export interface VendorCreateParams {+ name: string+ /** URL-safe slug; derived from `name` when omitted. */+ slug?: string+ contact_email?: string | null+ billing_email?: string | null+ /** Sanitized HTML — the vendor's public description. */+ about?: string | null+ /**+ * Branding attachments. Pass an ActiveStorage signed id to set one, `null`+ * to remove it, or omit the key to leave it untouched.+ */+ logo?: string | null+ square_logo?: string | null+ cover_photo?: string | null+ tax_remittance?: 'vendor' | 'platform'+ payouts_schedule_interval?: 'daily' | 'weekly' | 'biweekly' | 'monthly' | 'manual' | null+ minimum_payout_amount?: string | number | null+ /** Set while the vendor is away: the catalog stays but stops selling. */+ holiday_mode_until?: string | null+ /**+ * Written as nested attributes, never by id — an address has no store of+ * its own, so an id would reference a row belonging to someone else.+ */+ billing_address?: VendorAddressParams+ returns_address?: VendorAddressParams+ metadata?: Record<string, unknown>+}++/** The vendor's own billing / returns address. */+export interface VendorAddressParams {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ zipcode?: string+ phone?: string+ country_code?: string+ state_code?: string+ state_name?: string+ label?: string+}++export type VendorUpdateParams = Partial<VendorCreateParams>++export interface VendorInviteParams {+ email: string+ /** A role the vendor owns; defaults to the vendor's own admin role. */+ role_id?: string+}++export interface VendorSuspendParams {+ reason?: string+}++export interface VendorRejectParams {+ reason?: string+}+/*** One entry in `preference_schema`, describing a single tunable knob on* a STI subclass (payment provider, promotion action, promotion rule).diff --git a/packages/admin-sdk/src/types/generated/Vendor.ts b/packages/admin-sdk/src/types/generated/Vendor.tsnew file mode 100644index 0000000000..4dba2b3e2c--- /dev/null+++ b/packages/admin-sdk/src/types/generated/Vendor.ts@@ -0,0 +1,35 @@+// Typelizer digest 5e804187b967e1bd254b762e9fdbc743+//+// DO NOT MODIFY: This file was automatically generated by Typelizer.+import type {Address} from '@/types'++interface Vendor {+ id: string;+ name: string;+ slug: string;+ status: string;+ contact_email: string | null;+ billing_email: string | null;+ tax_remittance: string;+ payouts_schedule_interval: string | null;+ metadata: Record<string, unknown> | null;+ holiday_mode_until: string | null;+ terms_accepted_at: string | null;+ created_at: string;+ updated_at: string;+ deleted_at: string | null;+ minimum_payout_amount: string | null;+ about: string;+ about_html: string;+ logo_url: string | null;+ square_logo_url: string | null;+ cover_photo_url: string | null;+ on_holiday: boolean;+ sellable: boolean;+ products_count: number;+ users_count: number;+ billing_address?: Address;+ returns_address?: Address;+}++export default Vendor;diff --git a/packages/admin-sdk/src/types/generated/index.ts b/packages/admin-sdk/src/types/generated/index.tsindex 694e900521..9baeb43e3f 100644--- a/packages/admin-sdk/src/types/generated/index.ts+++ b/packages/admin-sdk/src/types/generated/index.ts@@ -1,4 +1,4 @@-// Typelizer digest 0b73b2f9288a9667db08b7519f1a4841+// Typelizer digest e219697ade470609d92dd9ee61d32bdd//// DO NOT MODIFY: This file was automatically generated by Typelizer.export type { default as Address } from './Address'@@ -91,5 +91,6 @@ export type { default as TaxIdentifier } from './TaxIdentifier'export type { default as TaxLine } from './TaxLine'export type { default as TaxRate } from './TaxRate'export type { default as Variant } from './Variant'+export type { default as Vendor } from './Vendor'export type { default as WebhookDelivery } from './WebhookDelivery'export type { default as WebhookEndpoint } from './WebhookEndpoint'diff --git a/packages/admin-sdk/src/types/index.ts b/packages/admin-sdk/src/types/index.tsindex 45f2170217..7589e0a620 100644--- a/packages/admin-sdk/src/types/index.ts+++ b/packages/admin-sdk/src/types/index.ts@@ -101,6 +101,7 @@ export type { default as TaxIdentifier } from './generated/TaxIdentifier'export type { default as TaxLine } from './generated/TaxLine'export type { default as TaxRate } from './generated/TaxRate'export type { default as Variant } from './generated/Variant'+export type { default as Vendor } from './generated/Vendor'export type { default as WebhookDelivery } from './generated/WebhookDelivery'export type { default as WebhookEndpoint } from './generated/WebhookEndpoint'diff --git a/packages/cli/src/generated/admin-spec.json b/packages/cli/src/generated/admin-spec.jsonindex a25925e9f1..b197578311 100644--- a/packages/cli/src/generated/admin-spec.json+++ b/packages/cli/src/generated/admin-spec.json@@ -1 +1 @@-{"info":{"title":"Admin API","contact":{"name":"Spree Commerce","url":"https://spreecommerce.org","email":"[email protected]"},"description":"Spree Admin API v3 - Administrative API for managing products, orders, and store settings.\n\n## Authentication\n\nThe Admin API requires a secret API key passed in the `x-spree-api-key` header.\nSecret API keys can be generated in the Spree admin dashboard.\n\n## Response Format\n\nAll responses are JSON. List endpoints return paginated responses with `data` and `meta` keys.\nSingle resource endpoints return a flat JSON object.\n\n## Resource IDs\n\nEvery resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,\n`variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,\nrequest bodies, and Ransack filters all accept them directly.\n\n## Error Handling\n\nErrors return a consistent format:\n```json\n{\n \"error\": {\n \"code\": \"validation_error\",\n \"message\": \"Validation failed\",\n \"details\": { \"name\": [\"can't be blank\"] }\n }\n}\n```\n","version":"v3"},"paths":{"/api/v3/admin/auth/login":{"post":{"summary":"Login","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Authenticates an admin user and returns a short-lived JWT access token.\nThe rotatable refresh token is set in an HttpOnly cookie — it is not\nincluded in the response body.\n\nThe `provider` field selects the authentication method. When omitted it\ndefaults to `email`, the built-in email/password login.\n\nTo authenticate against a third-party identity provider (Okta, Azure AD,\nGoogle Workspace SSO, a custom JWT issuer, SAML, etc.), send\n`{ \"provider\": \"<your_key>\", ... }` with the fields that provider\nrequires. The endpoint returns the same JWT regardless of which provider\nauthenticated the request. See\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication)\nfor the list of configured providers and their required fields.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"title":"EmailPasswordLogin","description":"Built-in email/password authentication (default when `provider` is omitted).","type":"object","properties":{"provider":{"type":"string","enum":["email"],"default":"email"},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"]},{"title":"ProviderLogin","description":"Provider-dispatched login. The `provider` key selects a configured\nauthentication provider; the remaining fields are forwarded to it.\nRequired fields depend on the provider — see\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication).\n","type":"object","properties":{"provider":{"type":"string","description":"Registered provider key (anything other than `email`).","not":{"enum":["email"]}}},"required":["provider"],"additionalProperties":true}]}}}}}},"/api/v3/admin/auth/refresh":{"post":{"summary":"Refresh token","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Exchanges the HttpOnly refresh-token cookie for a new access JWT and a\nrotated refresh token cookie. No request body or Authorization header\nis required — the cookie alone authenticates the call.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"refresh successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"missing or invalid refresh-token cookie","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/auth/logout":{"post":{"summary":"Logout","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Revokes the refresh-token cookie, effectively logging the admin out.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"logout successful"}}}},"/api/v3/admin/me":{"get":{"summary":"Get current admin user and permissions","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current admin user profile and a serialized list of permissions (CanCanCan rules). The SPA uses these to drive UI permission checks.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current admin user and permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current admin profile","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Self-service update of the signed-in admin's own profile, such as their admin UI display language (`selected_locale`).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"profile updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selected_locale":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}}},"/api/v3/admin/auth/password_resets":{"post":{"summary":"Request password reset","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Requests a password reset email for an admin user. Always returns `202`\nwhether or not the email matches an account, to prevent enumeration.\n\n`redirect_url` is where the emailed link should point (the reset token\nis appended as a `token` query param). It must match one of the store's\nallowed origins — otherwise it is silently ignored and the server-side\ndefault is used. The email is delivered by Spree itself via the\n`admin_user.password_reset_requested` event; this event is never\nforwarded to webhook endpoints.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"reset requested","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"redirect_url":{"type":"string","description":"Must match an allowed origin of the store; ignored otherwise."}},"required":["email"]}}}}}},"/api/v3/admin/auth/password_resets/{id}":{"patch":{"summary":"Reset password","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Consumes a password reset token (the `token` query param from the\nemailed link), sets the new password, and signs the admin in: the\nresponse carries a JWT access token and the rotatable refresh token is\nset in an HttpOnly cookie. The token is single-use — it invalidates as\nsoon as the password changes.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The reset token from the emailed link","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"password reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"invalid or expired token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"password_confirmation":{"type":"string"}},"required":["password","password_confirmation"]}}}}}},"/api/v3/admin/auth/setup":{"get":{"summary":"Check first-run setup availability","tags":["Authentication"],"description":"Reports whether first-run setup is still available — true only while\nthe installation has no admin user. Unauthenticated; the dashboard\nlogin page uses it to offer the setup screen.\n","responses":{"200":{"description":"setup status","content":{"application/json":{}}}}},"post":{"summary":"Complete first-run setup","tags":["Authentication"],"description":"Creates the first admin account and adopts the seeded store, authorized\nby the one-time setup token printed at install time (rotate it with\n`bin/rails spree:setup:token`). Issues a JWT access token and a\nrefresh-token cookie exactly like login. Returns 404 once any admin\nuser exists — the flow is closed permanently after setup.\n","parameters":[],"responses":{"200":{"description":"setup completed","content":{"application/json":{}}},"404":{"description":"setup not available","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["setup_token","email","password","country_code"],"properties":{"setup_token":{"type":"string","description":"One-time token from the install output."},"email":{"type":"string","format":"email"},"password":{"type":"string"},"password_confirmation":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"store_name":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country the store sells from. Determines the default market, the warehouse, the delivery zones and the currency."},"locale":{"type":"string","description":"Storefront locale. Defaults to the country's own language."},"currency":{"type":"string","description":"ISO 4217 currency. Defaults to the country's own currency — pass one only when the store prices in something else."}}}}}}}},"/api/v3/admin/auth/setup/countries":{"get":{"summary":"List countries for first-run setup","tags":["Authentication"],"description":"Countries the store can be set up in, each with the currency and\nofficial languages derived from it. Unauthenticated, because the setup\nscreen runs before any credential exists. Returns 404 once any admin\nuser exists.\n","responses":{"200":{"description":"countries","content":{"application/json":{}}}}}},"/api/v3/admin/allowed_origins":{"get":{"summary":"List allowed origins","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the CORS allowlist for the current store. Each entry is a\nbare `scheme://host[:port]` permitted to call the admin API from a\nbrowser. Backs the `Rack::Cors` allowlist and the CSRF boundary of\nthe admin cookie session (see\n`docs/plans/5.5-admin-auth-cookie-refresh.md`).\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[origin_cont]","in":"query","required":false,"description":"Filter by origin (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origins found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AllowedOrigin"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds an origin to the admin CORS allowlist. The value must be a bare\n`scheme://host[:port]` (no path, query, or fragment) and use `http` or\n`https`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"allowed origin created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}},"required":["origin"]}}}}}},"/api/v3/admin/allowed_origins/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Allowed origin ID","schema":{"type":"string"}}],"get":{"summary":"Get an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single allowed origin by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"404":{"description":"allowed origin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing allowed origin.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}}}}}}},"delete":{"summary":"Delete an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an origin from the admin CORS allowlist. After deletion the\nadmin SPA running at that origin will no longer be able to call the\nadmin API from a browser.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"allowed origin deleted"}}}},"/api/v3/admin/api_keys":{"get":{"summary":"List API keys","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns publishable and secret API keys for the current store. Secret keys are listed by `token_prefix` only — the plaintext token is delivered exactly once on create.\n\n**Required scope:** `read_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API keys found","content":{"application/json":{}}}}},"post":{"summary":"Create an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a publishable or secret API key. The plaintext token is included in the response **once** for secret keys; publishable keys expose their token on every read since they are intended for client-side use.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"secret key created — plaintext token returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","key_type"],"properties":{"name":{"type":"string"},"key_type":{"type":"string","enum":["publishable","secret"]},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/api_keys/{id}":{"get":{"summary":"Show an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key found","content":{"application/json":{}}}}},"patch":{"summary":"Update an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a key. `key_type` and `scopes` are fixed at creation — to change a key's authority, create a new key and revoke the old one.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key renamed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}}},"delete":{"summary":"Delete an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"API key deleted"}}}},"/api/v3/admin/api_keys/current":{"get":{"summary":"Describe the current API key","tags":["API Keys"],"security":[{"api_key":[]}],"description":"Returns the secret key that authenticated this request, including its live scopes. Useful to confirm a key's real, current authority. Only secret-key principals have a single key to describe.\n\n**Required scope:** none — any key can describe itself (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"current API key","content":{"application/json":{}}}}}},"/api/v3/admin/api_keys/{id}/revoke":{"patch":{"summary":"Revoke an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key revoked","content":{"application/json":{}}}}}},"/api/v3/admin/categories":{"get":{"summary":"List categories","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's categories (manual hierarchical taxons; rule-based collections are excluded).\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a category. Nests under the parent when parent_id is given, otherwise creates a top-level category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"category created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}},"required":["name"]}}}}}},"/api/v3/admin/categories/{id}":{"get":{"summary":"Get a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single category by ID.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"404":{"description":"category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}}}}}}},"delete":{"summary":"Delete a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a category and its descendants.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"204":{"description":"category deleted"}}}},"/api/v3/admin/categories/{id}/reposition":{"patch":{"summary":"Reposition a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a category to a new parent and/or index within the tree.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category repositioned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_parent_id":{"type":"string","description":"Prefixed ID of the new parent (omit for top level)"},"new_position":{"type":"integer","description":"0-based index among the new parent's children"}},"required":["new_position"]}}}}}},"/api/v3/admin/categories/{category_id}/products":{"get":{"summary":"List category products","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products classified under the category, ordered by their classification position.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Classifies a product under the category (appended to the end).\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/categories/{category_id}/products/{id}":{"delete":{"summary":"Remove a product from a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the category's manual classification.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/categories/{category_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a category product","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the category's products.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the category's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/channels":{"get":{"summary":"List channels","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channels configured for the current store.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"channels found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new channel on the current store. `code` is normalized to a\nURL-safe slug (`Point of Sale` → `point-of-sale`); when omitted it's\nderived from `name`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"channel created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string","description":"Slug — auto-derived from `name` when blank."},"active":{"type":"boolean","default":true},"default":{"type":"boolean","default":false},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}}},"/api/v3/admin/channels/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel found","content":{"application/json":{}}}}},"patch":{"summary":"Update a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}},"delete":{"summary":"Delete a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"channel deleted"}}}},"/api/v3/admin/channels/{id}/add_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Publish products on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the listed products on this channel. Idempotent — re-publishing\nan already-published product updates its publication window. Products from\nsibling stores are silently dropped.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}},"published_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications go live. `null` means immediately."},"unpublished_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications come down. `null` means never."}}}}}}}},"/api/v3/admin/channels/{id}/remove_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Unpublish products from a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes the listed products from this channel.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List order routing rules for a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channel's routing rules in priority order. The rules engine walks them top-down; see the Order Routing guide.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create an order routing rule on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a rule to the channel's routing list. The `type` is the wire shorthand from `GET /order_routing_rules/types` (e.g. `preferred_location`). Omitting `position` appends the rule at the end of the list. Each rule kind can appear at most once per channel — a duplicate `type` is rejected with a validation error.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"rule created","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules/{id}":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a rule's `active` flag, `position` (the list reorders around it), or `preferences`. The rule kind cannot be changed — delete and re-create instead.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/order_routing_rules/types":{"get":{"summary":"List available order routing rule types","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels, descriptions and preference schemas — drives the \"Add rule\" picker in the admin dashboard. Plugins extend the list by registering `Spree::OrderRoutingRule` subclasses via `Spree.order_routing.rules`.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/custom_field_definitions":{"get":{"summary":"List custom field definitions","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all defined custom fields. Filter by `?q[resource_type_eq]=Spree::Product` to narrow to one parent type.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definitions returned","content":{"application/json":{}}}}},"post":{"summary":"Create a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"definition created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["key","field_type","resource_type"],"properties":{"namespace":{"type":"string","description":"Defaults to `custom`"},"key":{"type":"string"},"label":{"type":"string","description":"Human-readable name; defaults to titleized `key`"},"field_type":{"type":"string","description":"Custom field type identifier (one of the registered field-type class names)."},"resource_type":{"type":"string","description":"Owner class, e.g. `Spree::Product`"},"storefront_visible":{"type":"boolean","description":"When false, the definition is admin-only and never exposed in the Store API"},"searchable":{"type":"boolean","description":"When true, values are included in storefront product text search"},"sortable":{"type":"boolean","description":"When true, storefront product listings can sort by this field"}}}}}}}},"/api/v3/admin/custom_field_definitions/{id}":{"get":{"summary":"Show a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definition found","content":{"application/json":{}}}}},"patch":{"summary":"Update a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"definition updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the definition and cascades to all custom field values referencing it.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"definition deleted"}}}},"/api/v3/admin/customer_groups":{"get":{"summary":"List customer groups","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer groups configured for the current store. Groups\nsegment customers for targeted promotions (see the `customer_group`\npromotion rule) and reporting. The list endpoint never embeds the\nmember list — fetch a single group with `?expand=customers` if you\nneed them inline, or query `/admin/customers?customer_group_id_in=…`\nfor paginated membership.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer group in the current store. `customer_ids` is\noptional; when present, customers are attached at create time.\nPass prefixed IDs (e.g. `cus_…`) — the server decodes them\nautomatically.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"customer group created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customer_groups/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer group prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single customer group. Pass `?expand=customers` to embed\nthe full member list inline (recommended only for single-record\nreads — embed cost scales with membership size).\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `customers`.","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer group with embedded customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"404":{"description":"customer group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, description, or membership. `customer_ids` is a\nfull-set replacement — the server reconciles the membership to\nmatch the array, adding new IDs and removing ones not present.\nSend `customer_ids: []` to clear all members.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer group updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the group. Member users are not deleted; their `customer_group_users` rows are dropped.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer group deleted"}}}},"/api/v3/admin/customers/{customer_id}/addresses":{"get":{"summary":"List customer addresses","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved addresses.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., country, state). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., first_name,last_name,address1,city). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"addresses found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new address to the customer's address book. Pass `is_default_billing: true` or `is_default_shipping: true` to set as the default — the previous default loses its flag in the same transaction.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"address created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string","description":"ISO-2 country code (e.g. US)"},"state_code":{"type":"string","description":"State/province abbreviation (e.g. NY)"},"phone":{"type":"string"},"company":{"type":"string"},"label":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}}},"/api/v3/admin/customers/{customer_id}/addresses/{id}":{"patch":{"summary":"Update a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a customer address.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"address updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"city":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the address. If it was a default, the customer loses that default (no auto-promotion).\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"address deleted"}}}},"/api/v3/admin/customers/{customer_id}/credit_cards":{"get":{"summary":"List customer credit cards","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved credit cards. Useful for off-session admin charges via `POST /admin/orders/:id/payments { source_id }`.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit cards found","content":{"application/json":{}}}}}},"/api/v3/admin/customers/{customer_id}/credit_cards/{id}":{"get":{"summary":"Show a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a saved credit card by ID.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit card found","content":{"application/json":{}}}}},"delete":{"summary":"Delete a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a saved credit card.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"credit card deleted"}}}},"/api/v3/admin/customers/{customer_id}/store_credits":{"get":{"summary":"List customer store credits","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns store credits issued to the customer.\n\n**Required scope:** `read_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., category, store, created_by). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,amount_used,memo,currency). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credits found","content":{"application/json":{}}}}},"post":{"summary":"Issue a store credit to a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"`created_by` is set automatically from the authenticated admin.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"store credit created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount","currency","category_id"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"},"category_id":{"type":"string","description":"StoreCreditCategory ID"},"memo":{"type":"string"}}}}}}}},"/api/v3/admin/customers/{customer_id}/store_credits/{id}":{"patch":{"summary":"Update a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Update memo / category / amount. The amount can only be changed if `amount_used == 0`.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"store credit updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"category_id":{"type":"string"},"memo":{"type":"string"}}}}}}},"delete":{"summary":"Delete a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused store credit (amount_used == 0). Returns 422 otherwise.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"store credit deleted"}}}},"/api/v3/admin/customers":{"get":{"summary":"List customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of customers. Supports Ransack search/filters.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[search]","in":"query","required":false,"description":"Email + name full-text-ish search","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., addresses, store_credits). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customers found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer. No welcome email is sent automatically.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"customer created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}}},"/api/v3/admin/customers/{id}":{"get":{"summary":"Show a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full customer details including computed order stats (orders_count, total_spent, last_order_completed_at).\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Customer ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations: addresses, orders, store_credits, default_billing_address, default_shipping_address","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer found","content":{"application/json":{}}}}},"patch":{"summary":"Update a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates customer attributes. `tags` replaces the full set.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}},"delete":{"summary":"Delete a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a customer. Returns 422 if the customer has any orders.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer deleted"}}}},"/api/v3/admin/customers/bulk_add_to_groups":{"post":{"summary":"Bulk-add customers to groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each customer in `ids` to every group in `customer_group_ids`.\nIdempotent — customers already in a group are skipped server-side.\nGroups from sibling stores are silently ignored. Returns counts of\ncustomers and groups that were processed (post store-scoping).\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers added to groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_from_groups":{"post":{"summary":"Bulk-remove customers from groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each customer in `ids` from every group in `customer_group_ids`.\nNo-op for non-members. Groups from sibling stores are silently ignored.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers removed from groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_add_tags":{"post":{"summary":"Bulk-add tags to customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every customer in `ids`. Tags are\nupserted by name; re-adding an existing tag is a no-op.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag name in `tags` from every customer in `ids`. No-op\nfor customers that don't carry the tag.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/exports":{"get":{"summary":"List exports","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV exports queued or completed for the current store. Polled by the admin SPA to detect when an export finishes (`done: true`).\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"exports found","content":{"application/json":{}}}}},"post":{"summary":"Create an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV export. The `type` selects the dataset; `search_params` is an\noptional Ransack query (same shape used by the `q[...]` params on list endpoints)\nthat filters which records are exported. Pass `record_selection: \"all\"` to\nclear the filter server-side and export everything in scope.\n\nGeneration is asynchronous. Poll `GET /admin/exports/{id}` until `done` is `true`,\nthen redirect the browser to `download_url` to fetch the file.\n\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"export queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["products","orders","customers","product_translations","gift_cards","coupon_codes","newsletter_subscribers"]},"record_selection":{"type":"string","enum":["filtered","all"],"description":"Set to \"all\" to ignore search_params and export everything in scope."},"search_params":{"type":"object","description":"Ransack query hash. Same predicates accepted by the list endpoint.","additionalProperties":true},"results_url":{"type":"string","description":"Absolute URL of your admin exports view; the export-done email uses it as the download button target. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/exports/{id}":{"get":{"summary":"Show an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns export status. While `done` is `false`, the SPA continues polling.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"export found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the export and purges its attachment.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"export deleted"}}}},"/api/v3/admin/exports/{id}/download":{"get":{"summary":"Download an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the exported CSV with `Content-Disposition: attachment`. Returns 422 with `code: export_not_ready` while `done` is still `false`. The endpoint is JWT/API-key protected, so SPA clients must fetch it (with `Authorization` header) and trigger the browser download via a Blob URL — a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments":{"get":{"summary":"List fulfillments","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all shipments for an order.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillments found","content":{"application/json":{}}}}},"post":{"summary":"Create a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually creates a fulfillment on a completed order, bypassing order routing — for example to mirror a shipment handled by an external carrier or 3PL. Moves the requested line item quantities out of their current fulfillments; when `items` is omitted, every not-yet-shipped unit is moved. Pass `status: 'shipped'` to register an already-shipped fulfillment (fires shipped webhooks and freezes cost/carrier). When `delivery_method_id` is omitted, the fulfillment inherits the delivery method and cost of the source fulfillment(s) it fully drains — keeping the order total unchanged; partially drained splits get no carrier when shipped, and pending fulfillments are otherwise (re)priced by the standard rate engine, which selects the lowest-cost available rate. Pass `cost` to set an explicit shipping cost instead (e.g. the 3PL price) — note this changes the order total and payment state, and is guaranteed to persist only with `status: 'shipped'` (pending fulfillments are re-priced by the rate engine).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fulfillment created","content":{"application/json":{}}},"422":{"description":"order not completed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stock_location_id"],"properties":{"stock_location_id":{"type":"string","description":"Stock location the fulfillment ships from"},"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link — a full URL is served back as tracking_url unchanged instead of being templated into the delivery method tracking URL"},"delivery_method_id":{"type":"string","description":"Delivery method (carrier) to attach as the selected rate. Defaults to the delivery method of the fully drained source fulfillment(s)"},"cost":{"type":"string","description":"Explicit shipping cost. Defaults to the summed cost of the fully drained source fulfillment(s), which keeps the order total unchanged; an explicit cost changes the order total and payment state. Guaranteed to persist only with status: 'shipped' — pending fulfillments are re-priced by the rate engine"},"status":{"type":"string","enum":["shipped"],"description":"Pass 'shipped' to register the fulfillment as already shipped"},"items":{"type":"array","description":"Line item quantities to fulfill. Omit to fulfill every not-yet-shipped unit.","items":{"type":"object","required":["item_id","quantity"],"properties":{"item_id":{"type":"string","description":"Line item ID"},"quantity":{"type":"integer"}}}},"metadata":{"type":"object","additionalProperties":true}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}":{"get":{"summary":"Show a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific shipment.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment found","content":{"application/json":{}}}}},"patch":{"summary":"Update a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a fulfillment (tracking, delivery rate).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link served back as tracking_url unchanged"},"selected_delivery_rate_id":{"type":"string","description":"Delivery rate ID (dr_...) to select"}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill":{"patch":{"summary":"Fulfill a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks a fulfillment as fulfilled.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment fulfilled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/purchase_label":{"patch":{"summary":"Buy the shipping label","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Buys the shipping label for a parcel that has not shipped yet — print it, pack the box, then mark the fulfillment fulfilled. Only delivery methods whose provider produces labels accept this.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"label purchased","content":{"application/json":{}}},"422":{"description":"provider does not produce labels","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/mark_delivered":{"patch":{"summary":"Mark a fulfillment delivered","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records that the customer received the goods. Only a fulfilled shipment can be marked delivered.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment delivered","content":{"application/json":{}}},"422":{"description":"fulfillment has not shipped","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When the goods arrived. Defaults to now."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification. Defaults to true."}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":{"patch":{"summary":"Cancel a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment canceled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":{"patch":{"summary":"Resume a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a canceled fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":{"patch":{"summary":"Split a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Transfers items from this shipment to a new shipment at a different stock location.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment split","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"stock_location_id":{"type":"string","description":"Target stock location ID"}}}}}}}},"/api/v3/admin/gift_card_batches":{"get":{"summary":"List gift card batches","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift card batches issued by the current store. Each batch\ngroups the cards generated together for a campaign or bulk-issuance\n— the cards themselves live under `/admin/gift_cards` and reference\nthe batch via `gift_card_batch_id`.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page","schema":{"type":"integer"}},{"name":"q[prefix_cont]","in":"query","required":false,"description":"Filter by prefix (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batches found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardBatch"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a batch of gift cards in a single call. The server generates\n`codes_count` cards inline for small batches (configurable via\n`Spree.config.gift_card_batch_web_limit`, default 500) or enqueues\na background job for larger ones. Each card's code is the batch\n`prefix` followed by random hex.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"gift card batch created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prefix","amount","codes_count"],"properties":{"prefix":{"type":"string","description":"Lowercased and prepended to every generated code."},"amount":{"type":"string","description":"Decimal amount per card, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"codes_count":{"type":"integer","description":"Number of cards to generate. Capped at `gift_card_batch_limit`."},"expires_at":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/gift_card_batches/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card batch prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single batch.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batch found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"404":{"description":"gift card batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/gift_cards":{"get":{"summary":"List gift cards","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift cards issued by the current store. Filter by\n`q[code_cont]` for code search, `q[user_id_eq]` for cards issued\nto a specific customer, or `q[state_eq]` for status filtering.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[code_cont]","in":"query","required":false,"description":"Filter by gift card code (contains)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by status (active, redeemed, partially_redeemed, canceled)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift cards found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a gift card scoped to the current store. The code is\nauto-generated when omitted. `currency` defaults to the store's\nconfigured currency. Pass `user_id` (prefixed ID) to attach the\ncard to a specific customer.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"gift card created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","description":"Decimal amount, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"code":{"type":"string","description":"Optional caller-supplied code. Auto-generated when omitted."},"expires_at":{"type":"string","description":"ISO 8601 date.","nullable":true},"user_id":{"type":"string","description":"Optional customer prefixed ID.","nullable":true}}}}}}}},"/api/v3/admin/gift_cards/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single gift card.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"404":{"description":"gift card not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an active gift card's editable attributes. Redeemed or\npartially-redeemed cards cannot be edited.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"expires_at":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused gift card. Cards that have been redeemed or\npartially redeemed cannot be deleted and return 422.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"gift card deleted"},"422":{"description":"redeemed gift card cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/imports":{"get":{"summary":"List imports","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV imports queued or completed for the current store.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"imports found","content":{"application/json":{}}}}},"post":{"summary":"Create an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV import. Upload the file first via `POST /api/v3/admin/direct_uploads`\nand pass the returned `signed_id` as `attachment`. On success the import is in the\n`mapping` state and the response carries the mapping payload: `schema_fields`\n(the canonical columns for the type), `csv_headers`, a `sample_row`, and the\nauto-assigned `mappings`.\n\nAdjust mappings if needed, then call `PATCH /admin/imports/{id}/complete_mapping`\nto start processing. Poll `GET /admin/imports/{id}` while `status` is\n`completed_mapping`/`processing`; terminal statuses are `completed` and `failed`.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"import created in mapping state","content":{"application/json":{}}},"422":{"description":"unknown import type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type","attachment"],"properties":{"type":{"type":"string","enum":["products","customers","product_translations"]},"attachment":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."},"preferred_delimiter":{"type":"string","enum":[",",";","|","\t"],"description":"CSV column separator. Defaults to a comma."},"results_url":{"type":"string","description":"Absolute URL of your admin imports view; the import-done email links back to it with `?import=<id>` appended. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/imports/template":{"get":{"summary":"Download an import template","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a CSV header row for the given import type, including the custom field columns available for the model.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"200":{"description":"CSV template","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/example":{"get":{"summary":"Download an example import file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Redirects to a populated example CSV for the given import type — the same sample data `rake spree:load_sample_data` uses, pinned to the installed Spree version. Returns 404 for a type that ships no example file.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to the example CSV"}}}},"/api/v3/admin/imports/{id}":{"get":{"summary":"Show an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns import status and row counters. The admin dashboard polls this endpoint while `status` is `completed_mapping` or `processing`; `rows_count`, `completed_rows_count` and `failed_rows_count` drive the progress bar. The mapping payload (`csv_headers`, `sample_row`) is only present while `status` is `mapping`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"import found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the import, its rows and the uploaded file. Returns 422 while the import is being processed.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"import deleted"}}}},"/api/v3/admin/imports/{id}/download":{"get":{"summary":"Download the originally uploaded file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the CSV exactly as it was uploaded — the audit trail for what was imported. JWT/API-key protected; SPA clients fetch it with the Authorization header and trigger the browser download via a Blob URL.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/{id}/complete_mapping":{"patch":{"summary":"Complete mapping and start processing","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the submitted column mappings, then starts row processing. Omit `mappings`\nto accept the auto-assigned ones from the create response. Returns 422 when a\nrequired schema field is left unmapped (`details.missing_required_fields`) or a\nfile column is assigned twice.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"mapping completed, processing queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"array","description":"Column assignments to apply before starting. `file_column: null` unmaps a field.","items":{"type":"object","required":["schema_field"],"properties":{"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/imports/{id}/retry_failed_rows":{"patch":{"summary":"Retry failed rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-processes the rows that failed. The import re-enters `processing`; poll `GET /admin/imports/{id}` until it completes again. Returns 422 when the import is not `completed` or has no failed rows.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"retry queued","content":{"application/json":{}}}}}},"/api/v3/admin/imports/{import_id}/rows":{"get":{"summary":"List import rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Paginated rows of an import — the failure report. Filter with `q[status_eq]=failed` to list only rows that could not be imported; each row carries the raw CSV `data` and its `validation_errors`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter rows by status: pending, processing, completed, failed.","schema":{"type":"string"}}],"responses":{"200":{"description":"rows found","content":{"application/json":{}}}}}},"/api/v3/admin/markets":{"get":{"summary":"List markets","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `countries`.","schema":{"type":"string"}}],"responses":{"200":{"description":"markets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new market for the current store.\n\n- `country_codes` 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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"market created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code."},"default_locale":{"type":"string","description":"IETF locale tag used as the market default."},"supported_locales":{"type":"array","items":{"type":"string"},"description":"Locale codes available in this market. The default is always implicitly included."},"tax_inclusive":{"type":"boolean","default":false,"description":"Display prices with tax included."},"default":{"type":"boolean","default":false,"description":"Setting to true demotes the previous default."},"position":{"type":"integer","description":"Sort order within the store; lower = first."},"country_codes":{"type":"array","items":{"type":"string"},"description":"2-letter ISO country codes assigned to this market. At least one is required."}},"required":["name","currency","default_locale","country_codes"]}}}}}},"/api/v3/admin/markets/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"market found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"404":{"description":"market not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing market. Pass `country_codes` 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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"market updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"supported_locales":{"type":"array","items":{"type":"string"}},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer"},"country_codes":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"market deleted"},"422":{"description":"cannot delete default or last market","content":{"application/json":{}}}}}},"/api/v3/admin/option_types":{"get":{"summary":"List option types","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of option types.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new option type. Supports nested option values.\n\nOption values can be provided inline and will be created or updated by name.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"option type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}},"required":["name","label"]}}}}}},"/api/v3/admin/option_types/{id}":{"get":{"summary":"Get an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single option type by ID, including its option values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"404":{"description":"option type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an option type. Supports updating nested option values.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"200":{"description":"option type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Existing option value ID to update"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an option type.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"204":{"description":"option type deleted"}}}},"/api/v3/admin/orders/{order_id}/tax_lines":{"get":{"summary":"List tax lines","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed tax rows on the order. Read-only — written exclusively by the tax provider.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"tax lines found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/discounts":{"get":{"summary":"List discounts","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed discount rows (promotion-sourced and manual) on the order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"discounts found","content":{"application/json":{}}}}},"post":{"summary":"Create manual discount","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual discount. With line_item_id a single row is created; without it the amount is distributed across line items (largest remainder). This is the sanctioned post-placement discount path and works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"discount created","content":{"application/json":{}}},"422":{"description":"invalid discount","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"},"value_type":{"type":"string","enum":["flat","percent"]},"line_item_id":{"type":"string","nullable":true,"description":"Target line item; omit to distribute order-level"}},"required":["label","value"]}}}}}},"/api/v3/admin/orders/{order_id}/fees":{"post":{"summary":"Create fee","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a fee (surcharge, handling, gift wrap, COD, payment fee). Order-level when no target is given. Works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fee created","content":{"application/json":{}}},"422":{"description":"invalid fee","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty"],"description":"Defaults to 'surcharge'"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true}},"required":["label","amount"]}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards":{"post":{"summary":"Apply a gift card to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"gift card applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Gift card code"}}}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards/{id}":{"delete":{"summary":"Remove a gift card from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Gift card ID","schema":{"type":"string"}}],"responses":{"204":{"description":"gift card removed"}}}},"/api/v3/admin/orders/{order_id}/items":{"get":{"summary":"List order items","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"items found","content":{"application/json":{}}}}},"post":{"summary":"Add an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"item added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Prefixed variant ID"},"quantity":{"type":"integer","default":1}}}}}}}},"/api/v3/admin/orders/{order_id}/items/{id}":{"get":{"summary":"Show an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"item found","content":{"application/json":{}}}}},"patch":{"summary":"Update an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"200":{"description":"item updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer"}}}}}}},"delete":{"summary":"Remove an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"204":{"description":"line item removed"}}}},"/api/v3/admin/orders/{order_id}/store_credits":{"post":{"summary":"Apply customer's store credit to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"store credit applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","description":"Optional explicit amount; defaults to order outstanding balance"}}}}}}},"delete":{"summary":"Remove store credit from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"store credit removed"}}}},"/api/v3/admin/orders":{"get":{"summary":"List orders","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., created_at, -created_at, completed_at)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by state (cart, address, delivery, payment, confirm, complete, canceled)","schema":{"type":"string"}},{"name":"q[email_cont]","in":"query","required":false,"description":"Filter by email (contains)","schema":{"type":"string"}},{"name":"q[number_eq]","in":"query","required":false,"description":"Filter by order number","schema":{"type":"string"}},{"name":"q[completed_at_gt]","in":"query","required":false,"description":"Filter by completed after date","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"orders found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft order in one shot. Customer, items, addresses, currency,\nmarket, channel, locale, notes, metadata, and a coupon code can all be\nprovided inline.\n\nSetting `preferred_stock_location_id` pins the order's preferred fulfillment\nlocation — Order Routing's built-in `PreferredLocation` rule consumes it\nwhen picking which stock location ships each shipment.\n\nInvalid coupon codes are non-fatal — the order is created and the failure\nis reported on the service result (not in the API response body for now).\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"order created with preferred_stock_location_id","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_id":{"type":"string","description":"Customer ID. Alias: user_id (legacy)."},"use_customer_default_address":{"type":"boolean","description":"When true with customer_id, copies the customer's saved billing/shipping addresses onto the order."},"currency":{"type":"string"},"market_id":{"type":"string","description":"Market ID"},"channel_id":{"type":"string","description":"Channel ID. Defaults to the store primary channel when omitted."},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Order Routing's built-in PreferredLocation rule reads this and ranks the location first; routing falls back to the next rule when the preferred location can't cover the cart."},"locale":{"type":"string"},"customer_note":{"type":"string","description":"Public, customer-visible note"},"internal_note":{"type":"string","description":"Staff-only note"},"metadata":{"type":"object","description":"Arbitrary key/value metadata"},"shipping_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"shipping_address_id":{"type":"string","description":"Existing customer address ID"},"billing_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"billing_address_id":{"type":"string","description":"Existing customer address ID"},"items":{"type":"array","items":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}},"coupon_code":{"type":"string","description":"Optional. Applied non-fatally; invalid codes do not block creation."}}}}}}}},"/api/v3/admin/orders/{id}":{"get":{"summary":"Show an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID (e.g., or_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"order found","content":{"application/json":{}}},"404":{"description":"order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_note":{"type":"string"},"internal_note":{"type":"string"},"channel_id":{"type":"string","description":"Channel ID"},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Re-runs Order Routing's PreferredLocation rule on subsequent shipment rebuilds."},"ship_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"bill_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}}}}}}}},"delete":{"summary":"Delete a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"order deleted"}}}},"/api/v3/admin/orders/{id}/complete":{"patch":{"summary":"Complete an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Completes an order in the `confirm` state, marking it as placed.\n\nSet `notify_customer: true` to send the order confirmation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order completed","content":{"application/json":{}}},"422":{"description":"order cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{"patch":{"summary":"Cancel an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a completed order.\n\nSet `notify_customer: true` to send the order cancellation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order canceled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order cancellation email after canceling."}}}}}}}},"/api/v3/admin/orders/{id}/approve":{"patch":{"summary":"Approve an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order approved","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resume":{"patch":{"summary":"Resume a canceled order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resend_confirmation":{"post":{"summary":"Resend confirmation email","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"confirmation resent","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods":{"get":{"summary":"List payment methods","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment methods found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/types":{"get":{"summary":"List available payment provider types","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a \"Provider\" dropdown in admin UIs.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"provider types found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/{id}":{"get":{"summary":"Show a payment method","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a payment method by ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment method found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments":{"get":{"summary":"List payments","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all payments for an order.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payments found","content":{"application/json":{}}}}},"post":{"summary":"Create a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new payment for the order.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"payment created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_method_id"],"properties":{"payment_method_id":{"type":"string","description":"Payment method ID"},"amount":{"type":"string"},"source_id":{"type":"string","description":"Payment source ID"}}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}":{"get":{"summary":"Show a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific payment.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/capture":{"patch":{"summary":"Capture a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Captures a pending payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment captured","content":{"application/json":{}}},"422":{"description":"capture failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/void":{"patch":{"summary":"Void a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Voids a payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment voided","content":{"application/json":{}}}}}},"/api/v3/admin/price_lists":{"get":{"summary":"List price lists","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `price_rules`.","schema":{"type":"string"}}],"responses":{"200":{"description":"price lists found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceList"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft price list.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"price list created (server-to-server — rules + prices, no product_ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids to seed the list with."},"rules":{"type":"array","description":"STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Server-to-server alternative to `product_ids`: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)`. Mix-and-match with `product_ids` is supported but typically unnecessary — `prices` alone tells the server which variants belong to the list and what the override amount is.","items":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/price_lists/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"404":{"description":"price list not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list updated with nested rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids — reconciles list membership (adds + removes)."},"rules":{"type":"array","items":{"type":"object","required":["type"],"properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Individual price overrides (the spreadsheet payload). Each row updates by `id` if shipped, otherwise upserts on the unique key `(variant_id, currency, price_list_id)`.","items":{"type":"object","oneOf":[{"required":["id"]},{"required":["variant_id","currency"]}],"properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}},"delete":{"summary":"Delete a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price list. Associated prices are removed asynchronously.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price list deleted"}}}},"/api/v3/admin/price_lists/{id}/activate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Activate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/price_lists/{id}/deactivate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Deactivate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/prices":{"get":{"summary":"List prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[price_list_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[price_list_id_null]","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q[currency_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[variant_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`.","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `variant`.","schema":{"type":"string"}}],"responses":{"200":{"description":"prices found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"price created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/prices/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"404":{"description":"price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price (acts_as_paranoid).\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price deleted"}}}},"/api/v3/admin/prices/bulk_upsert":{"post":{"summary":"Bulk-upsert prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices upserted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}},"422":{"description":"missing prices key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"type":"array","items":{"type":"object","required":["variant_id","currency"],"properties":{"id":{"type":"string","nullable":true},"variant_id":{"type":"string"},"currency":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/prices/bulk_destroy":{"delete":{"summary":"Bulk-delete prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each price in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices deleted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields":{"get":{"summary":"List product custom fields","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the product's custom field values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom fields found","content":{"application/json":{}}}}},"post":{"summary":"Create a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"custom field created","content":{"application/json":{}}},"422":{"description":"duplicate definition for the same product","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["custom_field_definition_id","value"],"properties":{"custom_field_definition_id":{"type":"string","description":"Prefixed `cfdef_…` id"},"value":{"description":"Value matching the definition's `field_type`"}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields/{id}":{"get":{"summary":"Show a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom field found","content":{"application/json":{}}}}},"patch":{"summary":"Update a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"custom field updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"New value"}}}}}}},"delete":{"summary":"Delete a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"custom field deleted"}}}},"/api/v3/admin/products/{product_id}/translations":{"get":{"summary":"List product translations","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the full translation matrix for the product: the source value and content type per translatable field, plus the translated value for every supported locale.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations found","content":{"application/json":{}}}}}},"/api/v3/admin/products":{"get":{"summary":"List products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of products for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., name, -name, price, -price, best_selling)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new product. Supports nested variants with prices and option types.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}},"required":["name"]}}}}}},"/api/v3/admin/products/{id}":{"get":{"summary":"Get a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID (e.g., prod_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"product found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"404":{"description":"product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"200":{"description":"product updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}}}},"delete":{"summary":"Delete a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a product.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product deleted"},"422":{"description":"deletion refused by a store rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/products/bulk_status_update":{"post":{"summary":"Bulk-update product status","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets `status` on each product in `ids`. Reindexes the affected products\nfor search. Cross-store IDs are silently dropped. Returns counts.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"cross-store products silently dropped","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"status":{"type":"string"}}}}}},"422":{"description":"invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","active","archived"]}}}}}}}},"/api/v3/admin/products/bulk_add_to_categories":{"post":{"summary":"Bulk-add products to categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every category (category) in `category_ids`.\nCategories from sibling stores are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to categories","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"category_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_categories":{"post":{"summary":"Bulk-remove products from categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every category in `category_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from categories","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_collections":{"post":{"summary":"Bulk-add products to collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every manual collection in `collection_ids`.\nAutomatic (rule-based) and sibling-store collections are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to collections","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"collection_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_collections":{"post":{"summary":"Bulk-remove products from collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every collection in `collection_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from collections","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_channels":{"post":{"summary":"Bulk-add products to channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes each product in `ids` on every channel in `channel_ids`. Idempotent —\nre-publishing on an existing channel is a no-op. Channels from sibling stores\nare silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published on channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_channels":{"post":{"summary":"Bulk-remove products from channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes each product in `ids` from every channel in `channel_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished from channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"},"removed":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_tags":{"post":{"summary":"Bulk-add tags to products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag in `tags` from every product in `ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_destroy":{"delete":{"summary":"Bulk-delete products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each product in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products deleted","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/promotions/{promotion_id}/coupon_codes":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List coupon codes for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"coupon codes found","content":{"application/json":{}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List actions for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"actions found","content":{"application/json":{}}}}},"post":{"summary":"Create an action on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"action created","content":{"application/json":{}}},"422":{"description":"unknown action type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Delete an action from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"action deleted"}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List rules for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create a rule on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"rule created with preferences","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a rule's preferences","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete a rule from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/promotions":{"get":{"summary":"List promotions","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotions found","content":{"application/json":{}}}}},"post":{"summary":"Create a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"promotion created with rules and actions","content":{"application/json":{}}},"422":{"description":"invalid params","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"integer","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}},"required":["name"]}}}}}},"/api/v3/admin/promotions/{id}":{"get":{"summary":"Show a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotion found","content":{"application/json":{}}}}},"patch":{"summary":"Update a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules and actions cleared with empty arrays","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"Pass to update an existing rule; omit to build a new one"},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}}}}}}},"delete":{"summary":"Delete a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"promotion deleted"}}}},"/api/v3/admin/promotion_actions/types":{"get":{"summary":"List available promotion action types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"action types found","content":{"application/json":{}}}}}},"/api/v3/admin/promotion_rules/types":{"get":{"summary":"List available promotion rule types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule types found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/refunds":{"get":{"summary":"List refunds","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all refunds for an order.\n\n**Required scope:** `read_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment, refund_reason). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,reason,transaction_id). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"refunds found","content":{"application/json":{}}}}},"post":{"summary":"Create a refund","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.\n\n**Required scope:** `write_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"refund created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_id","amount"],"properties":{"payment_id":{"type":"string","description":"Payment ID"},"amount":{"type":"string"},"refund_reason_id":{"type":"string","description":"Refund reason ID"}}}}}}}},"/api/v3/admin/locales":{"get":{"summary":"List supported locales","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the locales a merchant can translate content into for the current store, with the default and right-to-left flags.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"locales found","content":{"application/json":{}}}}}},"/api/v3/admin/store_credit_categories":{"get":{"summary":"List store credit categories","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured store credit categories. Categories classify\nstore credits (e.g., \"Goodwill\", \"Gift Card\", \"Refund\") and surface\nin the admin UI as a dropdown when issuing or editing a store\ncredit. Category names matching `Spree::Config[:non_expiring_credit_types]`\nare flagged via `non_expiring: true`.\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCreditCategory"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credit_categories/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Store credit category ID","schema":{"type":"string"}}],"get":{"summary":"Get a store credit category","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single store credit category by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCreditCategory"}}}},"404":{"description":"store credit category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store":{"get":{"summary":"Get the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current store configuration. The store is resolved from the request context (host or admin selection); there is no `id` parameter.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the current store configuration.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"store updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"preferred_admin_locale":{"type":"string"},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_unit_system":{"type":"string"}}}}}}}},"/api/v3/admin/tags":{"get":{"summary":"List tags","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns tag names for a given taggable type. Used for autocomplete in tag inputs on products, orders, and customers.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"taggable_type","in":"query","required":true,"description":"Taggable type (`Spree::Product`, `Spree::Order`, or `Spree::User`)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Optional case-insensitive substring filter","schema":{"type":"string"}}],"responses":{"200":{"description":"tags found","content":{"application/json":{}}},"422":{"description":"invalid taggable type","content":{"application/json":{}}}}}},"/api/v3/admin/tax_rates":{"get":{"summary":"List tax rates","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's tax rates. Rates are the entire configuration of\nthe built-in tax provider: each pairs a tax category with a jurisdiction\n(a country, optionally narrowed to one state) and a percentage, and\ndecides whether the tax is already included in the product price\n(VAT-style) or added on top (US-style).\n\nMarkets using an external tax provider ignore these rows — that\nprovider carries its own jurisdiction data.\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[included_in_price_true]","in":"query","required":false,"description":"Only rates included in the product price","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rates found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a tax rate for the current store. Give either `amount` as a\ndecimal (`0.19`) or `amount_percentage` as a percentage (`19`).\n\nName the jurisdiction with `country_code` (and `state_code` for a\nstate-level rate). Omitting the country makes the rate apply everywhere.\n\nSet `included_in_price` for VAT-style pricing, where the rate is backed\nout of the displayed price rather than added to it.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"tax rate created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Customer-facing rate name, e.g. \"VAT\""},"amount":{"type":"string","description":"Rate as a decimal, e.g. \"0.19\""},"amount_percentage":{"type":"number","description":"Rate as a percentage, e.g. 19"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string","description":"ISO code, e.g. \"DE\". Omit for every country."},"state_code":{"type":"string","description":"State abbreviation within that country, e.g. \"CA\"."}},"required":["name","tax_category_id"]}}},"required":true}}},"/api/v3/admin/tax_rates/{id}":{"parameters":[{"name":"id","in":"path","description":"Tax rate ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}}},"patch":{"summary":"Update a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"amount":{"type":"string"},"amount_percentage":{"type":"number"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"}}}}},"required":true}},"delete":{"summary":"Delete a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the rate. Tax lines it already produced keep their own rate snapshot.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"tax rate deleted"}}}},"/api/v3/admin/translatable_resources":{"get":{"summary":"List translatable resources","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every translatable resource type and its translatable fields (key + content type), so clients can render translation editors generically.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translatable resources found","content":{"application/json":{}}}}}},"/api/v3/admin/translations/batch":{"post":{"summary":"Batch upsert translations","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Atomically upserts translations across many records of (possibly) different translatable resource types in one request — e.g. an option type and all its option values in one save. A flat list of independent registry writes; all entries succeed or none do.\n\n**Required scope:** `write_<resource>` for every resource type in the batch (for API-key authentication) (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations upserted","content":{"application/json":{}}},"422":{"description":"unsupported locale rolls back the whole batch","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["translations"],"properties":{"translations":{"type":"array","items":{"type":"object","required":["resource_type","resource_id","values"],"properties":{"resource_type":{"type":"string","description":"Translatable resource type token, e.g. `option_type`"},"resource_id":{"type":"string","description":"Prefixed id of the record"},"values":{"type":"object","description":"Map of locale code to { field: value }","additionalProperties":{"type":"object","additionalProperties":true}}}}}}}}}}}},"/api/v3/admin/admin_users":{"get":{"summary":"List staff","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns admin users with at least one role assignment on the current store.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff found","content":{"application/json":{}}}}}},"/api/v3/admin/admin_users/{id}":{"get":{"summary":"Show a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member found","content":{"application/json":{}}}}},"patch":{"summary":"Update a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name fields and reassigns roles for the current store. `role_ids` is a complete replacement — roles not in the array are removed for this store.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"role_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Remove a staff member from this store","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the user's role assignments on the current store. The account is preserved — the user keeps access to any other stores.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"staff removed from store"}}}},"/api/v3/admin/invitations":{"get":{"summary":"List invitations","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns invitations for the current store, including pending and accepted.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitations found","content":{"application/json":{}}}}},"post":{"summary":"Create an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Invites a teammate by email. The invitation is scoped to the current store and carries the chosen role; on accept, a `RoleUser` is created via the invitation's `after_accept` callback.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"invitation created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","role_id"],"properties":{"email":{"type":"string"},"role_id":{"type":"string"}}}}}}}},"/api/v3/admin/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"invitation revoked"}}}},"/api/v3/admin/invitations/{id}/resend":{"patch":{"summary":"Resend an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a fresh token and dispatches the invitation email again.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitation resent","content":{"application/json":{}}}}}},"/api/v3/admin/permissions":{"get":{"summary":"List the permission catalog","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the permission catalog — the grant vocabulary shared by staff role permissions and secret API key scopes. Entries are grouped for permission pickers; labels and descriptions are localized. Readable by any authenticated admin credential.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"catalog returned","content":{"application/json":{}}}}}},"/api/v3/admin/roles":{"get":{"summary":"List roles","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns staff roles with their catalog permissions. Roles are global, not per-store; `mutable: false` marks the protected admin role and host-locked rows.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"roles found","content":{"application/json":{}}}}},"post":{"summary":"Create a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a staff role. `permissions` holds catalog keys (see GET /admin/permissions); a caller may only grant keys they effectively hold.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"role created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}}}},"/api/v3/admin/roles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a role name, description or permissions. The admin role and host-locked roles (`mutable: false`) reject changes.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"role updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a role. Fails with 422 while the role is protected or still referenced by staff members or pending invitations.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"role deleted"},"422":{"description":"role cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/stock_locations":{"get":{"summary":"List stock locations","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured stock locations. Stock locations are global\n(shared across stores). Filter with Ransack predicates such as\n`q[active_eq]`, `q[kind_eq]`, `q[pickup_enabled_eq]`, or\n`q[name_cont]`.\n\nPickup-related attributes (`kind`, `pickup_enabled`,\n`pickup_stock_policy`, `pickup_ready_in_minutes`,\n`pickup_instructions`) drive merchant pickup support at checkout —\ncustomers can collect orders from any active location with\n`pickup_enabled: true`.\n\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[active_eq]","in":"query","required":false,"description":"Filter by active status","schema":{"type":"boolean"}},{"name":"q[kind_eq]","in":"query","required":false,"description":"Filter by kind (built-in: 'warehouse', 'store', 'fulfillment_center')","schema":{"type":"string"}},{"name":"q[pickup_enabled_eq]","in":"query","required":false,"description":"Filter by pickup-enabled flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock locations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLocation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new stock location.\n\nSetting `default: true` automatically demotes the previous default\nlocation.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"stock location created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true,"description":"Internal name shown only in the admin"},"active":{"type":"boolean"},"default":{"type":"boolean","description":"Setting to true demotes the previous default."},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"],"description":"Categorizes the location."},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true,"description":"ISO-3166 alpha-2 country code (e.g. \"US\")."},"state_code":{"type":"string","nullable":true,"description":"State / province abbreviation (e.g. \"NY\"). Resolved against the selected country."},"state_name":{"type":"string","nullable":true,"description":"Free-text state for countries without a states list."},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"],"description":"'local' = items at this location only; 'any' = transfer-eligible (ship-to-store)."},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/stock_locations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock location ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single stock location by prefixed ID.\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"404":{"description":"stock location not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing stock location. Same address-field conventions as\nthe create endpoint.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"]},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"]},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the stock location (sets `deleted_at`). Existing\nfulfillments that referenced it keep the historical record via\n`Spree::StockLocation.with_deleted`.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"stock location deleted"}}}},"/api/v3/admin/products/{product_id}/variants":{"get":{"summary":"List product variants","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of variants for a product, including the default variant.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variants found","content":{"application/json":{}}}}},"post":{"summary":"Create a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new variant for a product. Supports nested prices and stock items.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"201":{"description":"variant created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"A variant on a product with option types should declare its option pairs (e.g. size + color) — one per option type it participates in. Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}},"/api/v3/admin/products/{product_id}/variants/{id}":{"get":{"summary":"Get a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single variant by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variant found","content":{"application/json":{}}},"404":{"description":"variant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a variant. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"200":{"description":"variant updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}},"delete":{"summary":"Delete a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a variant.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"204":{"description":"variant deleted"}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"List webhook deliveries","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns delivery attempts for the given endpoint, most recent first.\nEach row carries the original request payload, the response code\n(when the receiver replied), the execution time, and any transport\nerror — everything needed to audit failures and decide whether to\nredeliver.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[event_name_eq]","in":"query","required":false,"description":"Filter by event name (exact)","schema":{"type":"string"}},{"name":"q[success_eq]","in":"query","required":false,"description":"Filter by success flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-delivered_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}},"404":{"description":"parent webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single delivery attempt with the full request payload and\nthe response body the receiver returned. Use this for ad-hoc debug\nof failed deliveries.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery found","content":{"application/json":{}}},"404":{"description":"delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}/redeliver":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID to redeliver","schema":{"type":"string"}}],"post":{"summary":"Redeliver a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new delivery row with the same payload + event_name and\nqueues it. The original row is preserved for audit history.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"redelivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints":{"get":{"summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns outbound webhook subscriptions for the current store. Each\nendpoint receives a signed POST when any subscribed event fires.\n`secret_key` is `null` on list reads — the plaintext is delivered\nexactly once on create.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[url_cont]","in":"query","required":false,"description":"Filter by URL (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoints found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new outbound webhook subscription. The plaintext\n`secret_key` is returned **once** in this response — persist it\nimmediately to verify incoming webhook signatures. Subsequent reads\nreturn `null` for the secret. Pass an empty `subscriptions` array or\nomit it to receive every event.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"webhook endpoint created — secret_key returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/webhook_endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single webhook endpoint by prefixed ID.\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint found","content":{"application/json":{}}},"404":{"description":"webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, URL, active flag, or the event subscription list.\nToggling `active` here is equivalent to calling `disable`/`enable`\nwithout an audit reason.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint updated","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the endpoint and stops future deliveries.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"webhook endpoint deleted"}}}},"/api/v3/admin/webhook_endpoints/{id}/send_test":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"post":{"summary":"Send a test delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a `webhook.test` delivery record and queues it. Use this to\nverify the endpoint is reachable and your signature verification\naccepts Spree's payloads.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"test delivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/enable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Re-enable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-enables an endpoint that was manually or automatically disabled.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint enabled","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/disable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Disable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually pauses an endpoint. Unlike auto-disable (triggered after\nrepeated delivery failures), no notification email is sent.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint disabled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/collections":{"get":{"summary":"List collections","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's collections.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collections found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual or automatic (rule-based) collection. For automatic collections, send the full desired rule set under `rules`.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"collection created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"sort_order":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"rules":{"type":"array","description":"Full desired rule set. Entries with an id update, id-less entries create, omitted rules are removed.","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}},"required":["name"]}}}}}},"/api/v3/admin/collections/{id}":{"get":{"summary":"Get a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single collection by ID, including its rules.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collection found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"404":{"description":"collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a collection. Send `position` to reorder it within the flat list; send the full `rules` set to sync automatic rules.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"collection updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"sort_order":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer","description":"Reorders the collection within the flat list (acts_as_list)"},"rules":{"type":"array","description":"Full desired rule set (see create).","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}}}}}}},"delete":{"summary":"Delete a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a collection.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"204":{"description":"collection deleted"}}}},"/api/v3/admin/collections/{collection_id}/products":{"get":{"summary":"List collection products","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products curated in the collection, ordered by their membership position.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Curates a product into the collection (appended to the end).\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/collections/{collection_id}/products/{id}":{"delete":{"summary":"Remove a product from a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the collection's manual curation.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/collections/{collection_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a collection product","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the collection's products.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the collection's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/collection_rules/types":{"get":{"summary":"List available collection rule types","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels and descriptions — drives the rule picker on an automatic collection. Plugins extend the list by registering `Spree::CollectionRule` subclasses via `config.spree.collection_rules`. The `type` returned here is the wire shorthand accepted when writing a collection's `rules`.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/locations":{"get":{"summary":"List company locations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the branches of a business customer. Each branch owns its own addresses and the buyers authorised to purchase for it.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"locations found","content":{"application/json":{}}}}},"post":{"summary":"Create a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a branch. Addresses are supplied inline and belong to the branch, so editing one later changes the branch's own record rather than an address the buyer also uses.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"location created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"external_id":{"type":"string","nullable":true},"billing_address":{"type":"object","description":"Created inline and owned by the branch.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string"}}}},"required":["name"]}}}}}},"/api/v3/admin/company_locations/{id}":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Branches are addressed by their own id once you hold one — the company id is not needed.\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"location found","content":{"application/json":{}}}}},"patch":{"summary":"Update a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Address fields sent here edit the branch's existing address in place; send only what changes.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"200":{"description":"location updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"billing_address":{"type":"object","properties":{"city":{"type":"string"}}}}}}}}},"delete":{"summary":"Delete a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the branch, its buyers and the addresses it owned.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"204":{"description":"location deleted"}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List tax exemption certificates","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a business's exemption evidence. `active` is the field that decides whether a certificate\nexempts a sale: a verified certificate stops counting once its expiry date passes, so the status\nalone does not answer it.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"certificates found","content":{"application/json":{}}}}},"post":{"summary":"Create a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records exemption evidence against a business. Certificates start `pending` and exempt nothing\nuntil verified.\n\n`country_code` and `state_code` say where the certificate holds — omit both for one valid\neverywhere, give only the country for one valid throughout it. `document` takes an ActiveStorage\nsigned blob id obtained from `POST /api/v3/admin/direct_uploads`.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"certificate created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"certificate_number":{"type":"string"},"reason_code":{"type":"string","description":"Becomes the tax provider's entity use code."},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"issuing_authority":{"type":"string","nullable":true},"document":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."}},"required":["certificate_number","reason_code"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/verify":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Verify a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Accepts the certificate as evidence, which is what makes it exempt sales. Only a pending\ncertificate can be accepted — re-accepting a revoked one would restore evidence that was\ndeliberately withdrawn. An installation that checks numbers against a registry, or requires a\nsecond approval, can refuse here, and the refusal is returned as a validation error.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate verified","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/revoke":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Revoke a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws accepted evidence. A verified certificate cannot be deleted — how a sale was taxed has to remain explainable — so revoking is the way out.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate revoked","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/download":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Download a certificate document","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the uploaded document. Deliberately not a storage link: the bytes come through the API so\nthe same credentials apply to every read of a confidential document. Requires only read access.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"document streamed","content":{"application/json":{}}},"422":{"description":"no document attached","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company tax registrations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business's tax registrations, one per kind. A business registration takes precedence\nover the buyer's own when a sale is for that business, because the invoice is addressed to the\nentity rather than the person who placed the order.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"registrations found","content":{"application/json":{}}}}},"post":{"summary":"Create a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registers a tax number against the business. Verification against the relevant registry runs in\nthe background where a validator is installed for the kind; a stock installation registers none,\nleaving the status unattempted.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"registration created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","description":"The regime the number belongs to."},"value":{"type":"string"}},"required":["kind","value"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers/{id}/validate":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Re-check a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Asks the registry again. Manual because a registry answers only \"valid now\" — a number verified\nlast year may have been deregistered since — and because a check that came back unavailable\ncannot otherwise be retried without editing the number.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"422":{"description":"no validator installed for this kind","content":{"application/json":{}}}}}},"/api/v3/admin/companies":{"get":{"summary":"List companies","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business customers of the current store.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"companies found","content":{"application/json":{}}}}},"post":{"summary":"Create a company","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a business customer. Exemption certificates and tax registrations hang off it.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"company created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"external_id":{"type":"string","nullable":true,"description":"Your own reference for this business, unique within the store."}},"required":["name"]}}}}}},"/api/v3/admin/company_locations/{company_location_id}/contacts":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_location_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company contacts","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customers authorised to purchase for a branch. A customer may act for more than one branch.\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"contacts found","content":{"application/json":{}}}}},"post":{"summary":"Create a company contact","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Authorises a customer to purchase for a branch. A customer who acts for exactly one branch has\ntheir orders attributed to it automatically; one who acts for several needs the branch set on\nthe order, because guessing would invoice the wrong business.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"contact created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_id":{"type":"string"},"role":{"type":"string","description":"Free-form label; carries no permissions in 6.0."}},"required":["customer_id"]}}}}}},"/api/v3/admin/company_contacts/{id}":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a company contact","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"contact found","content":{"application/json":{}}}}},"delete":{"summary":"Delete a company contact","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws the customer's authority to purchase for the branch. The customer account itself is untouched.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"204":{"description":"contact deleted"}}}},"/api/v3/admin/delivery_profiles":{"get":{"summary":"List delivery profiles","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Fulfillment profiles group products with the stock locations, delivery zones and delivery methods that fulfill them. Every store has exactly one default profile.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery profiles found","content":{"application/json":{}}}}},"post":{"summary":"Create a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery profile. `kind` selects the registered profile kind (shipping, digital, extension kinds); `stock_location_ids` limits fulfillment to those locations — empty means every store location.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"delivery profile created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","description":"Registered profile kind; defaults to shipping."},"default":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Empty means every store location."}},"required":["name"]}}}}}},"/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups":{"parameters":[{"name":"delivery_profile_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Create an origin group","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Origin groups partition a profile's fulfillment origins: zones and methods belong to a group, so the same products can quote different rate tables per warehouse. `stock_location_ids` replaces the full membership; empty means every store location.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"origin group created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Empty means every store location."}}}}}}}},"/api/v3/admin/delivery_profiles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery profile updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"default":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The default profile and profiles still referenced by products cannot be deleted.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"delivery profile deleted"}}}},"/api/v3/admin/delivery_methods":{"get":{"summary":"List delivery methods","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all delivery methods with calculator and zone configuration.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery methods found","content":{"application/json":{}}}}},"post":{"summary":"Create delivery method","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery method inside a delivery profile (defaults to the store default profile). Delivery behavior comes from the fulfillment provider.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"delivery method created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"integer","nullable":true},"estimated_transit_business_days_max":{"type":"integer","nullable":true},"tax_category_id":{"type":"string","nullable":true},"calculator_type":{"type":"string"},"calculator_preferences":{"type":"object"},"delivery_zone_id":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/delivery_methods/calculators":{"get":{"summary":"List delivery calculators","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registered delivery calculator classes with preference schemas for building configuration forms.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"calculators found","content":{"application/json":{}}}}}},"/api/v3/admin/delivery_zones":{"post":{"summary":"Create delivery zone","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery zone with typed members: country, state, or postal_code (prefix or from/to range).\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed, e.g. `members`","schema":{"type":"string"}}],"responses":{"201":{"description":"delivery zone created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"type":"object","properties":{"member_type":{"type":"string","enum":["country","state","postal_code"]},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true}},"required":["member_type"]}}},"required":["name"]}}}}}},"/api/v3/admin/integrations":{"get":{"summary":"List integrations","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the integrations connected to the current store. Secret preference values are masked.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integrations found","content":{"application/json":{}}}}},"post":{"summary":"Connect integration","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Connects an integration type to the current store. Setting active: true verifies the connection and fails with 422 when it cannot connect. Submitting a masked secret value back keeps the stored secret.\n\n**Required scope:** `write_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"integration connected","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand from GET /integrations/types"},"active":{"type":"boolean"},"preferences":{"type":"object"}},"required":["type"]}}}}}},"/api/v3/admin/integrations/types":{"get":{"summary":"List integration types","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every registered integration type with its gallery metadata and configuration schema. Pure registry discovery — read live connection state from GET /integrations.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integration types found","content":{"application/json":{}}}}}},"/api/v3/admin/integrations/{id}/test":{"post":{"summary":"Test integration connection","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Runs a live connection check against the provider. Nothing is persisted; a failed check reports the vendor error message.\n\n**Required scope:** `write_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"connection checked","content":{"application/json":{}}}}}},"/api/v3/admin/product_types":{"get":{"summary":"List product types","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of product types.\n\nA product type is a back-office template: it seeds option types and\ncategories onto products created with it, and defines which custom\nfields those products' forms show. It is not exposed on the Store API.\n\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}}],"responses":{"200":{"description":"product types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a product type.\n\n`option_type_ids` and `category_ids` seed products created with this\ntype. `custom_field_definitions` is a replace-set of the definitions the\nproduct form renders, in `sort_order`. `required` is advisory — the\ndashboard marks the field, but a blank value is never rejected.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"422":{"description":"unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true,"description":"Fulfillment profile stamped onto products created with this type. Null leaves new products on the store default profile."},"option_type_ids":{"type":"array","items":{"type":"string"},"description":"Option types seeded onto products created with this type."},"category_ids":{"type":"array","items":{"type":"string"},"description":"Categories seeded onto products created with this type."},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Prefixed custom field definition id."},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}},"required":["name"]}}}}}},"/api/v3/admin/product_types/{id}":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Retrieve a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product type with its option types, categories and custom fields.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"404":{"description":"product type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product type.\n\nChanges never modify products that already carry the type — use\n`apply_to_products` to backfill those.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a product type. Types still used by products cannot be deleted.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"product type deleted"}}}},"/api/v3/admin/product_types/{id}/apply_to_products":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"post":{"summary":"Apply a product type to its existing products","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Backfills the type's option types and categories onto the products that\nalready carry it. Additive and idempotent — nothing is removed, and\nre-running is safe.\n\nRuns in the background; the response reports how many products the type\ncurrently has.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"202":{"description":"backfill accepted","content":{"application/json":{"schema":{"type":"object","properties":{"products_count":{"type":"integer"}}}}}}}}}},"components":{"schemas":{"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"count":{"type":"integer","description":"Total number of records"},"pages":{"type":"integer","description":"Total number of pages"},"from":{"type":"integer","description":"Index of first record on this page"},"to":{"type":"integer","description":"Index of last record on this page"},"in":{"type":"integer","description":"Number of records on this page"},"previous":{"type":"integer","nullable":true,"description":"Previous page number"},"next":{"type":"integer","nullable":true,"description":"Next page number"}},"required":["page","limit","count","pages","from","to","in"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","description":"Field-specific validation errors","nullable":true}},"required":["code","message"]}},"required":["error"]},"AuthResponse":{"type":"object","properties":{"token":{"type":"string","description":"JWT access token"},"user":{"$ref":"#/components/schemas/AdminUser"}},"required":["token","user"]},"PermissionRule":{"type":"object","description":"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.","properties":{"allow":{"type":"boolean","description":"true for `can`, false for `cannot`"},"actions":{"type":"array","items":{"type":"string"},"description":"Action names, e.g. [\"read\", \"update\"] or [\"manage\"]"},"subjects":{"type":"array","items":{"type":"string"},"description":"Subject class names, e.g. [\"Spree::Product\"] or [\"all\"]"},"has_conditions":{"type":"boolean","description":"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},"required":["allow","actions","subjects","has_conditions"]},"MeResponse":{"type":"object","description":"Current admin user profile and serialized permissions","properties":{"user":{"$ref":"#/components/schemas/AdminUser"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionRule"}}},"required":["user","permissions"]},"ImportSchemaField":{"type":"object","description":"A canonical column of an import type, including per-store custom field columns","properties":{"name":{"type":"string","description":"Canonical field name used in mappings"},"label":{"type":"string","description":"Human-readable label"},"required":{"type":"boolean","description":"Whether the field must be mapped before processing"}},"required":["name","label","required"]},"CheckoutRequirement":{"type":"object","properties":{"step":{"type":"string","description":"Checkout step this requirement belongs to"},"field":{"type":"string","description":"Field that needs to be satisfied"},"message":{"type":"string","description":"Human-readable requirement message"}},"required":["step","field","message"]},"CartWarning":{"type":"object","description":"A warning about a cart issue (e.g., item removed due to stock change)","properties":{"code":{"type":"string","description":"Machine-readable warning code"},"message":{"type":"string","description":"Human-readable warning message"},"line_item_id":{"type":"string","nullable":true,"description":"Prefixed line item ID (when applicable)"},"variant_id":{"type":"string","nullable":true,"description":"Prefixed variant ID (when applicable)"},"item_index":{"type":"integer","nullable":true,"description":"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},"required":["code","message"]},"FulfillmentManifestItem":{"type":"object","description":"An item within a fulfillment — which line item and how many units are in this fulfillment","properties":{"item_id":{"type":"string","description":"Line item ID"},"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer","description":"Quantity in this fulfillment"}},"required":["item_id","variant_id","quantity"]},"AdminUserRoleAssignment":{"type":"object","description":"A role assignment for the current store on a staff member","properties":{"id":{"type":"string","description":"Prefixed role ID"},"name":{"type":"string","description":"Role name"}},"required":["id","name"]},"AdminUserStore":{"type":"object","description":"A store the staff member can access through a role assignment","properties":{"id":{"type":"string","description":"Prefixed store ID"},"name":{"type":"string","description":"Store name"},"code":{"type":"string","description":"Store code"}},"required":["id","name","code"]},"PreferenceField":{"type":"object","description":"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.","properties":{"key":{"type":"string"},"type":{"type":"string","description":"string | text | password | integer | decimal | boolean | array | hash"},"default":{"description":"Default value (any JSON type), null when there is no default","nullable":true}},"required":["key","type"]},"PromotionActionCalculator":{"type":"object","description":"The action's nested calculator (when the action carries one — null for actions like `free_shipping`)","properties":{"type":{"type":"string","description":"Wire shorthand for the calculator subclass"},"label":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}}},"required":["type","label","preferences","preference_schema"]},"PromotionActionLineItem":{"type":"object","description":"One row in a `create_line_items` action — the variant added to the order and how many","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_id","quantity"]},"Address":{"type":"object","properties":{"id":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_name":{"type":"string"},"country_code":{"type":"string"},"state_text":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"},"state_abbr":{"type":"string","nullable":true},"country_iso":{"type":"string"},"state_name":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true}},"required":["id","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","label","metadata","created_at","updated_at","customer_id"],"x-typelizer":true},"AdminUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string","nullable":true},"selected_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"avatar_url":{"type":"string","nullable":true},"roles":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserRoleAssignment"}},"stores":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserStore"}}},"required":["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":true},"AllowedOrigin":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","origin","created_at","updated_at"],"x-typelizer":true},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key_type":{"type":"string"},"token_prefix":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"revoked_at":{"type":"string","nullable":true},"last_used_at":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"plaintext_token":{"type":"string","nullable":true},"created_by_email":{"type":"string","nullable":true}},"required":["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email"],"x-typelizer":true},"AppliedPromotion":{"type":"object","properties":{"id":{"type":"string"},"promotion_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":true},"Cart":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"preferred_stock_location_id":{"type":"string","nullable":true},"number":{"type":"string"},"token":{"type":"string"},"email":{"type":"string","nullable":true},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/CartWarning"}},"coupon_code":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"display_item_total":{"type":"string","nullable":true},"adjustment_total":{"type":"string","nullable":true},"display_adjustment_total":{"type":"string","nullable":true},"discount_total":{"type":"string","nullable":true},"display_discount_total":{"type":"string","nullable":true},"tax_total":{"type":"string","nullable":true},"display_tax_total":{"type":"string","nullable":true},"included_tax_total":{"type":"string","nullable":true},"display_included_tax_total":{"type":"string","nullable":true},"additional_tax_total":{"type":"string","nullable":true},"display_additional_tax_total":{"type":"string","nullable":true},"total":{"type":"string","nullable":true},"display_total":{"type":"string","nullable":true},"gift_card_total":{"type":"string","nullable":true},"display_gift_card_total":{"type":"string","nullable":true},"amount_due":{"type":"string","nullable":true},"display_amount_due":{"type":"string","nullable":true},"delivery_total":{"type":"string","nullable":true},"display_delivery_total":{"type":"string","nullable":true},"fee_total":{"type":"string","nullable":true},"display_fee_total":{"type":"string","nullable":true},"store_credit_total":{"type":"string","nullable":true},"display_store_credit_total":{"type":"string","nullable":true},"covered_by_store_credit":{"type":"boolean"},"current_step":{"type":"string"},"completed_steps":{"type":"array","items":{"type":"string"}},"requirements":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutRequirement"}},"shipping_eq_billing_address":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"completed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}}},"required":["id","market_id","channel_id","preferred_stock_location_id","number","token","email","customer_note","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":true},"Category":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"depth":{"type":"number"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"children_count":{"type":"number"},"parent_id":{"type":"string","nullable":true},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"is_root":{"type":"boolean"},"is_child":{"type":"boolean"},"is_leaf":{"type":"boolean"},"parent":{"$ref":"#/components/schemas/Category"},"children":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"ancestors":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"metadata":{"type":"object"},"pretty_name":{"type":"string"},"lft":{"type":"number"},"rgt":{"type":"number"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":true},"Channel":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"storefront_access":{"type":"string"},"guest_checkout":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true},"preferred_storefront_access":{"type":"string","nullable":true},"preferred_guest_checkout":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","code","active","default","storefront_access","guest_checkout","preferred_order_routing_strategy","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","stock_location_ids"],"x-typelizer":true},"ClaimLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"send_replacement":{"type":"boolean"},"description":{"type":"string","nullable":true},"refund_amount":{"type":"string"},"paid_amount":{"type":"string"},"display_refund_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"replacement_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"replacement_variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","quantity","send_replacement","description","refund_amount","paid_amount","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":true},"ClaimReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Claim":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"resolution":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"denied_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ClaimReason"},"claim_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ClaimLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id"],"x-typelizer":true},"CollectionRule":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string","nullable":true},"match_policy":{"type":"string"}},"required":["id","type","value","match_policy"],"x-typelizer":true},"Collection":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"sort_order":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"products_count":{"type":"number"},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRule"}}},"required":["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":true},"CompanyContact":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_location_id":{"type":"string"},"customer_id":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["id","role","created_at","updated_at","company_location_id","customer_id","email"],"x-typelizer":true},"CompanyLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_id":{"type":"string"},"contacts_count":{"type":"number"},"billing_address":{"$ref":"#/components/schemas/Address"},"shipping_address":{"$ref":"#/components/schemas/Address"},"company_contacts":{"type":"array","items":{"$ref":"#/components/schemas/CompanyContact"}}},"required":["id","name","external_id","metadata","created_at","updated_at","company_id","contacts_count","billing_address","shipping_address"],"x-typelizer":true},"Company":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"locations_count":{"type":"number"},"company_locations":{"type":"array","items":{"$ref":"#/components/schemas/CompanyLocation"}}},"required":["id","name","external_id","metadata","created_at","updated_at","locations_count"],"x-typelizer":true},"Country":{"type":"object","properties":{"iso":{"type":"string"},"iso3":{"type":"string"},"name":{"type":"string"},"states_required":{"type":"boolean"},"zipcode_required":{"type":"boolean"},"states":{"type":"array","items":{"$ref":"#/components/schemas/State"}},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true}},"required":["iso","iso3","name","states_required","zipcode_required"],"x-typelizer":true},"CouponCode":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"state":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"promotion_id":{"type":"string"},"order_id":{"type":"string","nullable":true}},"required":["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":true},"CreditCard":{"type":"object","properties":{"id":{"type":"string"},"brand":{"type":"string"},"last4":{"type":"string"},"month":{"type":"number"},"year":{"type":"number"},"name":{"type":"string","nullable":true},"default":{"type":"boolean"},"gateway_payment_profile_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"payment_method_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":true},"CustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"namespace":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"resource_type":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"},"filter_key":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","namespace","key","label","field_type","resource_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at"],"x-typelizer":true},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","deprecated":true},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"key":{"type":"string"},"value":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"storefront_visible":{"type":"boolean"},"custom_field_definition_id":{"type":"string"}},"required":["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":true},"CustomerGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"customers_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":true},"Customer":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"accepts_email_marketing":{"type":"boolean"},"full_name":{"type":"string"},"available_store_credit_total":{"type":"string"},"display_available_store_credit_total":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"default_billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"default_shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"newsletter_subscriber":{"allOf":[{"$ref":"#/components/schemas/NewsletterSubscriber"}],"nullable":true},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"failed_attempts":{"type":"number"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"internal_note_html":{"type":"string","nullable":true},"default_billing_address_id":{"type":"string","nullable":true},"default_shipping_address_id":{"type":"string","nullable":true},"orders_count":{"type":"number"},"total_spent":{"type":"string"},"display_total_spent":{"type":"string"},"last_order_completed_at":{"type":"string","nullable":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"store_credits":{"type":"array","items":{"$ref":"#/components/schemas/StoreCredit"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}},"required":["id","email","first_name","last_name","phone","accepts_email_marketing","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","created_at","updated_at","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":true},"DeliveryMethodRule":{"type":"object","properties":{"id":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","active","created_at","updated_at","type","name","description","preferences","preference_schema","product_ids"],"x-typelizer":true},"DeliveryMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"number","nullable":true},"estimated_transit_business_days_max":{"type":"number","nullable":true},"digital":{"type":"boolean"},"pickup":{"type":"boolean"},"pickup_point":{"type":"boolean"},"admin_name":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string"},"pickup_point_provider":{"type":"string","nullable":true},"rate_provider":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"},"services":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodService"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodRule"}},"tax_category_id":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string"},"delivery_origin_group_id":{"type":"string","nullable":true},"delivery_zone_id":{"type":"string","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"}},"calculator_type":{"type":"string","nullable":true},"calculator_preferences":{"type":"object","nullable":true}},"required":["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","fulfillment_provider","pickup_point_provider","rate_provider","storefront_visible","tracking_url","markup_flat","markup_percent","created_at","updated_at","deleted_at","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","calculator_type","calculator_preferences"],"x-typelizer":true},"DeliveryMethodService":{"type":"object","properties":{"id":{"type":"string"},"carrier":{"type":"string"},"service":{"type":"string"},"label":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"position":{"type":"number"}},"required":["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":true},"DeliveryOriginGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"position":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"delivery_zones_count":{"type":"number"},"delivery_methods_count":{"type":"number"}},"required":["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":true},"DeliveryProfile":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"default":{"type":"boolean"},"position":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"kind":{"type":"string"},"digital":{"type":"boolean"},"offers_pickup":{"type":"boolean"},"offers_shipping":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"origin_groups":{"type":"object"},"products_count":{"type":"number"},"delivery_methods_count":{"type":"number"},"delivery_zones_count":{"type":"number"}},"required":["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":true},"DeliveryRate":{"type":"object","properties":{"id":{"type":"string"},"delivery_method_id":{"type":"string"},"name":{"type":"string"},"selected":{"type":"boolean"},"cost":{"type":"string"},"total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"carrier":{"type":"string","nullable":true},"service_level":{"type":"string","nullable":true},"estimated_delivery_date":{"type":"string","nullable":true},"display_cost":{"type":"string"},"display_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":true},"DeliveryZoneMember":{"type":"object","properties":{"id":{"type":"string"},"member_type":{"type":"string"},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","state_name","created_at","updated_at"],"x-typelizer":true},"DeliveryZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZoneMember"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string"},"delivery_origin_group_id":{"type":"string","nullable":true},"delivery_method_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":true},"DigitalLink":{"type":"object","properties":{"id":{"type":"string"},"access_counter":{"type":"number"},"filename":{"type":"string"},"content_type":{"type":"string"},"download_url":{"type":"string"},"authorizable":{"type":"boolean"},"expired":{"type":"boolean"},"access_limit_exceeded":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","access_counter","filename","content_type","download_url","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":true},"Discount":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"code":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"value":{"type":"string","nullable":true},"promotion_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"ExchangeLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"original_price":{"type":"string"},"new_variant_price":{"type":"string"},"price_difference":{"type":"string"},"original_variant_id":{"type":"string","nullable":true},"new_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"original_variant":{"$ref":"#/components/schemas/Variant"},"new_variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"Exchange":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"price_difference":{"type":"string"},"display_price_difference":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"fulfilled_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"exchange_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id"],"x-typelizer":true},"Export":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"format":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"done":{"type":"boolean"},"filename":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"download_url":{"type":"string","nullable":true}},"required":["id","number","format","created_at","updated_at","type","user_id","done","filename","byte_size","download_url"],"x-typelizer":true},"Fee":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"FulfillmentItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"status":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":true},"Fulfillment":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"tracking":{"type":"string","nullable":true},"tracking_url":{"type":"string","nullable":true},"tracking_carrier":{"type":"string","nullable":true},"tracking_carrier_name":{"type":"string","nullable":true},"pickup_point_data":{"type":"object","nullable":true},"selected_delivery_rate_id":{"type":"string","nullable":true},"cost":{"type":"string"},"display_cost":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"status":{"type":"string"},"fulfillment_type":{"type":"string"},"fulfilled_at":{"type":"string","nullable":true},"tracking_status":{"type":"string","nullable":true},"estimated_delivery_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentManifestItem"}},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"delivery_rates":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryRate"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"metadata":{"type":"object"},"tracking_details":{"type":"object","nullable":true},"adjustment_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"documents":{"type":"object"},"provider_generates_labels":{"type":"boolean"},"fulfillment_items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentItem"}},"order":{"$ref":"#/components/schemas/Order"}},"required":["id","number","tracking","tracking_url","tracking_carrier","tracking_carrier_name","pickup_point_data","selected_delivery_rate_id","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","tracking_status","estimated_delivery_at","delivered_at","items","metadata","tracking_details","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","provider_generates_labels"],"x-typelizer":true},"GiftCardBatch":{"type":"object","properties":{"id":{"type":"string"},"codes_count":{"type":"number"},"currency":{"type":"string","nullable":true},"prefix":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true}},"required":["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":true},"GiftCard":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_authorized":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"expires_at":{"type":"string","nullable":true},"redeemed_at":{"type":"string","nullable":true},"expired":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/AdminUser"},"gift_card_batch":{"$ref":"#/components/schemas/GiftCardBatch"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}},"required":["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":true},"ImportMapping":{"type":"object","properties":{"id":{"type":"string"},"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true},"required":{"type":"boolean"}},"required":["id","schema_field","file_column","required"],"x-typelizer":true},"ImportRow":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"number"},"status":{"type":"string"},"validation_errors":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"import_id":{"type":"string","nullable":true},"item_type":{"type":"string","nullable":true},"item_id":{"type":"string","nullable":true},"data":{"type":"object"}},"required":["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":true},"Import":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"rows_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"status":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"processing_errors":{"type":"string","nullable":true},"preferred_delimiter":{"type":"string"},"original_filename":{"type":"string","nullable":true},"original_byte_size":{"type":"number","nullable":true},"original_file_url":{"type":"string","nullable":true},"completed_rows_count":{"type":"number"},"failed_rows_count":{"type":"number"},"schema_fields":{"type":"array","items":{"$ref":"#/components/schemas/ImportSchemaField"}},"csv_headers":{"type":"array","items":{"type":"string"}},"sample_row":{"type":"object"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ImportMapping"}}},"required":["id","number","rows_count","created_at","updated_at","type","status","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":true},"Integration":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"group":{"type":"string","nullable":true},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":true},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expires_at":{"type":"string"},"role_id":{"type":"string"},"role_name":{"type":"string"},"inviter_email":{"type":"string"},"acceptance_url":{"type":"string"},"invitee_exists":{"type":"boolean"},"store":{"type":"object"}},"required":["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":true},"LineItem":{"type":"object","properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"preorder":{"type":"boolean"},"preorder_ships_at":{"type":"string","nullable":true},"quantity":{"type":"number"},"currency":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"options_text":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"discounted_amount":{"type":"string"},"display_discounted_amount":{"type":"string"},"display_compare_at_amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"digital_links":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost_price":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"tax_category":{"$ref":"#/components/schemas/TaxCategory"}},"required":["id","variant_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","created_at","updated_at","cost_price","tax_category_id"],"x-typelizer":true},"Market":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"country_codes":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"tax_provider":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_codes","supported_locales","tax_provider","created_at","updated_at"],"x-typelizer":true},"Media":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string","nullable":true},"variant_ids":{"type":"array","items":{"type":"string"}},"position":{"type":"number"},"alt":{"type":"string","nullable":true},"media_type":{"type":"string"},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"external_video_url":{"type":"string","nullable":true},"original_url":{"type":"string","nullable":true},"mini_url":{"type":"string","nullable":true},"small_url":{"type":"string","nullable":true},"medium_url":{"type":"string","nullable":true},"large_url":{"type":"string","nullable":true},"xlarge_url":{"type":"string","nullable":true},"og_image_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"viewable_id":{"type":"string"},"download_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"viewable_type":{"type":"string"}},"required":["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","created_at","updated_at","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":true},"NewsletterSubscriber":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"verified":{"type":"boolean"},"verified_at":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true}},"required":["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":true},"OptionType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"kind":{"type":"string"},"translations":{"type":"object"},"metadata":{"type":"object"},"filterable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}}},"required":["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":true},"OptionValue":{"type":"object","properties":{"id":{"type":"string"},"option_type_id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"color_code":{"type":"string","nullable":true},"option_type_name":{"type":"string"},"option_type_label":{"type":"string"},"image_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_type":{"$ref":"#/components/schemas/OptionType"}},"required":["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":true},"OrderRoutingRule":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"channel_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Order":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"number":{"type":"string"},"email":{"type":"string"},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"coupon_code":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true},"payment_status":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"item_total":{"type":"string"},"display_item_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"gift_card_total":{"type":"string"},"display_gift_card_total":{"type":"string"},"amount_due":{"type":"string"},"display_amount_due":{"type":"string"},"delivery_total":{"type":"string"},"display_delivery_total":{"type":"string"},"fee_total":{"type":"string"},"display_fee_total":{"type":"string"},"store_credit_total":{"type":"string"},"display_store_credit_total":{"type":"string"},"covered_by_store_credit":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"fulfillments":{"type":"array","items":{"$ref":"#/components/schemas/Fulfillment"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"gift_card":{"allOf":[{"$ref":"#/components/schemas/GiftCard"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"status":{"type":"string"},"last_ip_address":{"type":"string","nullable":true},"considered_risky":{"type":"boolean"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"payment_total":{"type":"string"},"display_payment_total":{"type":"string"},"metadata":{"type":"object"},"canceled_at":{"type":"string","nullable":true},"approved_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferred_stock_location_id":{"type":"string","nullable":true},"company_location_id":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"internal_note_html":{"type":"string","nullable":true},"approver_id":{"type":"string","nullable":true},"canceler_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}},"cart":{"$ref":"#/components/schemas/Cart"},"channel":{"$ref":"#/components/schemas/Channel"},"preferred_stock_location":{"$ref":"#/components/schemas/StockLocation"},"payment_methods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"customer":{"$ref":"#/components/schemas/Customer"},"approver":{"$ref":"#/components/schemas/Customer"},"canceler":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/Customer"},"returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"exchanges":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}}},"required":["id","market_id","cart_id","channel_id","number","email","customer_note","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","company_location_id","company_id","tags","internal_note","internal_note_html","approver_id","canceler_id","created_by_id","customer_id"],"x-typelizer":true},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"session_required":{"type":"boolean"},"source_required":{"type":"boolean"},"metadata":{"type":"object"},"active":{"type":"boolean"},"auto_capture":{"type":"boolean","nullable":true},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"nullable":true},"resolved_capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"]},"storefront_visible":{"type":"boolean"},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","description","type","session_required","source_required","metadata","active","auto_capture","capture_method","resolved_capture_method","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":true},"Payment":{"type":"object","properties":{"id":{"type":"string"},"payment_method_id":{"type":"string"},"response_code":{"type":"string","nullable":true},"number":{"type":"string"},"amount":{"type":"string"},"display_amount":{"type":"string"},"status":{"type":"string"},"source_type":{"type":"string","nullable":true,"enum":["credit_card","store_credit","payment_source"]},"source_id":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/CreditCard"},{"$ref":"#/components/schemas/StoreCredit"},{"$ref":"#/components/schemas/PaymentSource"}],"nullable":true},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"metadata":{"type":"object"},"avs_response":{"type":"string","nullable":true},"cvv_response_code":{"type":"string","nullable":true},"cvv_response_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"captured_amount":{"type":"string"},"order_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","payment_method_id","response_code","number","amount","display_amount","status","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":true},"PaymentSource":{"type":"object","properties":{"id":{"type":"string"},"gateway_payment_profile_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":true},"Permission":{"type":"object","properties":{"key":{"type":"string"},"resource":{"type":"string"},"kind":{"type":"string"},"group":{"type":"string"},"group_label":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","resource","kind","group","group_label","label","description"],"x-typelizer":true},"PriceHistory":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_in_cents":{"type":"number"},"currency":{"type":"string"},"display_amount":{"type":"string"},"recorded_at":{"type":"string"},"variant_id":{"type":"string"},"price_id":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":true},"PriceList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string"},"position":{"type":"number"},"match_policy":{"type":"string"},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"currently_active":{"type":"boolean"},"products_count":{"type":"number"},"prices_count":{"type":"number"},"product_ids":{"type":"array","items":{"type":"string"}},"price_rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceRule"}}},"required":["id","name","description","status","position","match_policy","starts_at","ends_at","deleted_at","created_at","updated_at","currently_active","products_count","prices_count","product_ids"],"x-typelizer":true},"PriceRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"price_list_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"description":{"type":"string","nullable":true},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","created_at","updated_at","type","price_list_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Price":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string","nullable":true},"amount_in_cents":{"type":"number","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"compare_at_amount_in_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"display_amount":{"type":"string","nullable":true},"display_compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","variant_id","created_at","updated_at"],"x-typelizer":true},"ProductPublication":{"type":"object","properties":{"id":{"type":"string"},"published_at":{"type":"string","nullable":true},"unpublished_at":{"type":"string","nullable":true},"product_id":{"type":"string"},"channel_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":true},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"variant_count":{"type":"number"},"available_on":{"type":"string","nullable":true},"preorder_ships_at":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"preorder":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"available":{"type":"boolean"},"description":{"type":"string","nullable":true},"description_html":{"type":"string","nullable":true},"default_variant_id":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"default_variant":{"$ref":"#/components/schemas/Variant"},"option_types":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"translations":{"type":"object"},"status":{"type":"string"},"metadata":{"type":"object"},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"product_type_id":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"collections":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"product_publications":{"type":"array","items":{"$ref":"#/components/schemas/ProductPublication"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"product_type":{"$ref":"#/components/schemas/ProductType"}},"required":["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","thumbnail_url","tags","price","original_price","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","product_type_id","tax_category_id"],"x-typelizer":true},"ProductTypeCustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"namespace":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"required":{"type":"boolean"},"sort_order":{"type":"number"}},"required":["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":true},"ProductType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"translations":{"type":"object"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"$ref":"#/components/schemas/ProductTypeCustomFieldDefinition"}}},"required":["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":true},"PromotionAction":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculator"}],"nullable":true},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItem"},"nullable":true}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","calculator","line_items"],"x-typelizer":true},"PromotionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"product_ids":{"type":"array","items":{"type":"string"},"nullable":true},"category_ids":{"type":"array","items":{"type":"string"},"nullable":true},"customer_ids":{"type":"array","items":{"type":"string"},"nullable":true},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","product_ids","category_ids","customer_ids"],"x-typelizer":true},"Promotion":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"usage_limit":{"type":"number","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"path":{"type":"string","nullable":true},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"number","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"action_ids":{"type":"array","items":{"type":"string"}},"rule_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":true},"RefundReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Refund":{"type":"object","properties":{"id":{"type":"string"},"transaction_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"payment_id":{"type":"string","nullable":true},"refund_reason_id":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true},"originator_type":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at"],"x-typelizer":true},"ReturnLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"line_item":{"$ref":"#/components/schemas/LineItem"}},"required":["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"ReturnReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Return":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"refunded_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"return_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ReturnLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"refunded_total":{"type":"string"},"refundable_total":{"type":"string"},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","refund_total","display_refund_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","refunded_total","refundable_total"],"x-typelizer":true},"Role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"mutable":{"type":"boolean"},"users_count":{"type":"number"}},"required":["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":true},"SetupTask":{"type":"object","properties":{"name":{"type":"string"},"done":{"type":"boolean"}},"required":["name","done"],"x-typelizer":true},"State":{"type":"object","properties":{"abbr":{"type":"string"},"name":{"type":"string"}},"required":["abbr","name"],"x-typelizer":true},"StockItem":{"type":"object","properties":{"id":{"type":"string"},"count_on_hand":{"type":"number"},"backorderable":{"type":"boolean"},"stock_location_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"allocated_count":{"type":"number"},"available_count":{"type":"number"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","count_on_hand","backorderable","stock_location_id","variant_id","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":true},"StockLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"address1":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_text":{"type":"string","nullable":true},"pickup_ready_in_minutes":{"type":"number","nullable":true},"pickup_instructions":{"type":"string","nullable":true},"admin_name":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"propagate_all_variants":{"type":"boolean"},"kind":{"type":"string"},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","created_at","updated_at"],"x-typelizer":true},"StockReservation":{"type":"object","properties":{"id":{"type":"string"},"stock_item_id":{"type":"string"},"line_item_id":{"type":"string"},"order_id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"quantity":{"type":"number"},"expires_at":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","stock_item_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":true},"StockTransfer":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source_location_id":{"type":"string","nullable":true},"destination_location_id":{"type":"string","nullable":true},"source_location":{"$ref":"#/components/schemas/StockLocation"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","reference","metadata","created_at","updated_at","source_location_id","destination_location_id"],"x-typelizer":true},"StoreCreditCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"non_expiring":{"type":"boolean"}},"required":["id","name","created_at","updated_at","non_expiring"],"x-typelizer":true},"StoreCredit":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"currency":{"type":"string"},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","nullable":true}},"required":["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","customer_id","created_by_id","category_id","category_name"],"x-typelizer":true},"Store":{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object"},"name":{"type":"string"},"code":{"type":"string"},"preferred_storefront_url":{"type":"string","nullable":true},"default_currency":{"type":"string"},"default_locale":{"type":"string"},"mail_from_address":{"type":"string","nullable":true},"customer_support_email":{"type":"string","nullable":true},"new_order_notifications_email":{"type":"string","nullable":true},"preferred_send_consumer_transactional_emails":{"type":"boolean"},"preferred_admin_locale":{"type":"string","nullable":true},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_default_package_weight":{"type":"number"},"preferred_default_package_length":{"type":"number"},"preferred_default_package_width":{"type":"number"},"preferred_default_package_height":{"type":"number"},"preferred_unit_system":{"type":"string"},"preferred_storefront_access":{"type":"string"},"preferred_guest_checkout":{"type":"boolean"},"preferred_company_field_enabled":{"type":"boolean"},"preferred_address_requires_company":{"type":"boolean"},"preferred_address_requires_phone":{"type":"boolean"},"preferred_capture_method":{"type":"string"},"preferred_track_inventory_levels":{"type":"boolean"},"preferred_stock_reservations_enabled":{"type":"boolean"},"preferred_track_price_history":{"type":"boolean"},"preferred_show_products_without_price":{"type":"boolean"},"preferred_disable_sku_validation":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string"},"preferred_document_number_format":{"type":"string"},"preferred_order_number_prefix":{"type":"string"},"preferred_order_number_suffix":{"type":"string"},"preferred_order_number_sequence_start":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_number_sequence_started":{"type":"boolean"},"url":{"type":"string"},"api_url":{"type":"string"},"setup_tasks":{"type":"array","items":{"$ref":"#/components/schemas/SetupTask"}},"supported_currencies":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"available_locales":{"type":"array","items":{"type":"string"}},"logo_url":{"type":"string","nullable":true},"mailer_logo_url":{"type":"string","nullable":true}},"required":["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_default_package_weight","preferred_default_package_length","preferred_default_package_width","preferred_default_package_height","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_order_routing_strategy","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","created_at","updated_at","order_number_sequence_started","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":true},"TaxCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tax_code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":true},"TaxExemptionCertificate":{"type":"object","properties":{"id":{"type":"string"},"certificate_number":{"type":"string"},"reason_code":{"type":"string"},"status":{"type":"string"},"issuing_authority":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"verified_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_id":{"type":"string"},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"active":{"type":"boolean"},"lapsed":{"type":"boolean"},"can_be_deleted":{"type":"boolean"},"document_filename":{"type":"string","nullable":true},"document_byte_size":{"type":"number","nullable":true},"document_url":{"type":"string","nullable":true}},"required":["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":true},"TaxIdentifier":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"value":{"type":"string"},"validation_status":{"type":"string","nullable":true},"validation_evidence":{"type":"object","nullable":true},"source":{"type":"string","nullable":true},"validated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"validatable":{"type":"boolean"},"customer_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true}},"required":["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"x-typelizer":true},"TaxLine":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"included":{"type":"boolean"},"rate":{"type":"string"},"tax_rate_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"fee_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"provider_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"taxability_reason":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"data":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","included","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","amount","display_amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at"],"x-typelizer":true},"TaxRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"amount":{"type":"string"},"amount_percentage":{"type":"number","nullable":true},"tax_category_id":{"type":"string","nullable":true},"store_id":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true}},"required":["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"x-typelizer":true},"Variant":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"sku":{"type":"string","nullable":true},"options_text":{"type":"string"},"track_inventory":{"type":"boolean"},"media_count":{"type":"number"},"preorder_ships_at":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"preorder":{"type":"boolean"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"price":{"$ref":"#/components/schemas/Price"},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"metadata":{"type":"object"},"position":{"type":"number"},"cost_price":{"type":"string","nullable":true},"cost_currency":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"weight_unit":{"type":"string","nullable":true},"dimensions_unit":{"type":"string","nullable":true},"backorder_limit":{"type":"number","nullable":true},"hs_code":{"type":"string","nullable":true},"country_of_origin":{"type":"string","nullable":true},"customs_description":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preorderable":{"type":"boolean"},"tax_category_id":{"type":"string","nullable":true},"available_stock":{"type":"number","nullable":true},"reserved_quantity":{"type":"number"},"total_on_hand":{"type":"number","nullable":true},"product_name":{"type":"string"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"stock_items":{"type":"array","items":{"$ref":"#/components/schemas/StockItem"}}},"required":["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","price","original_price","option_values","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","backorder_limit","hs_code","country_of_origin","customs_description","deleted_at","created_at","updated_at","preorderable","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name"],"x-typelizer":true},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_name":{"type":"string"},"event_id":{"type":"string","nullable":true},"response_code":{"type":"number","nullable":true},"execution_time":{"type":"number","nullable":true},"error_type":{"type":"string","nullable":true},"request_errors":{"type":"string","nullable":true},"response_body":{"type":"string","nullable":true},"success":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivered_at":{"type":"string","nullable":true},"payload":{"type":"object"},"webhook_endpoint_id":{"type":"string"},"webhook_endpoint_url":{"type":"string"}},"required":["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":true},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}},"disabled_reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"disabled_at":{"type":"string","nullable":true},"secret_key":{"type":"string","nullable":true},"last_delivery_at":{"type":"string","nullable":true},"recent_delivery_count":{"type":"number"},"recent_failure_count":{"type":"number"},"total_delivery_count":{"type":"number"},"successful_delivery_count":{"type":"number"},"failed_delivery_count":{"type":"number"}},"required":["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":true}}}}\ No newline at end of file+{"info":{"title":"Admin API","contact":{"name":"Spree Commerce","url":"https://spreecommerce.org","email":"[email protected]"},"description":"Spree Admin API v3 - Administrative API for managing products, orders, and store settings.\n\n## Authentication\n\nThe Admin API requires a secret API key passed in the `x-spree-api-key` header.\nSecret API keys can be generated in the Spree admin dashboard.\n\n## Response Format\n\nAll responses are JSON. List endpoints return paginated responses with `data` and `meta` keys.\nSingle resource endpoints return a flat JSON object.\n\n## Resource IDs\n\nEvery resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,\n`variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,\nrequest bodies, and Ransack filters all accept them directly.\n\n## Error Handling\n\nErrors return a consistent format:\n```json\n{\n \"error\": {\n \"code\": \"validation_error\",\n \"message\": \"Validation failed\",\n \"details\": { \"name\": [\"can't be blank\"] }\n }\n}\n```\n","version":"v3"},"paths":{"/api/v3/admin/auth/login":{"post":{"summary":"Login","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Authenticates an admin user and returns a short-lived JWT access token.\nThe rotatable refresh token is set in an HttpOnly cookie — it is not\nincluded in the response body.\n\nThe `provider` field selects the authentication method. When omitted it\ndefaults to `email`, the built-in email/password login.\n\nTo authenticate against a third-party identity provider (Okta, Azure AD,\nGoogle Workspace SSO, a custom JWT issuer, SAML, etc.), send\n`{ \"provider\": \"<your_key>\", ... }` with the fields that provider\nrequires. The endpoint returns the same JWT regardless of which provider\nauthenticated the request. See\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication)\nfor the list of configured providers and their required fields.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"title":"EmailPasswordLogin","description":"Built-in email/password authentication (default when `provider` is omitted).","type":"object","properties":{"provider":{"type":"string","enum":["email"],"default":"email"},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"]},{"title":"ProviderLogin","description":"Provider-dispatched login. The `provider` key selects a configured\nauthentication provider; the remaining fields are forwarded to it.\nRequired fields depend on the provider — see\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication).\n","type":"object","properties":{"provider":{"type":"string","description":"Registered provider key (anything other than `email`).","not":{"enum":["email"]}}},"required":["provider"],"additionalProperties":true}]}}}}}},"/api/v3/admin/auth/refresh":{"post":{"summary":"Refresh token","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Exchanges the HttpOnly refresh-token cookie for a new access JWT and a\nrotated refresh token cookie. No request body or Authorization header\nis required — the cookie alone authenticates the call.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"refresh successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"missing or invalid refresh-token cookie","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/auth/logout":{"post":{"summary":"Logout","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Revokes the refresh-token cookie, effectively logging the admin out.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"logout successful"}}}},"/api/v3/admin/me":{"get":{"summary":"Get current admin user and permissions","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current admin user profile and a serialized list of permissions (CanCanCan rules). The SPA uses these to drive UI permission checks.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current admin user and permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current admin profile","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Self-service update of the signed-in admin's own profile, such as their admin UI display language (`selected_locale`).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"profile updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selected_locale":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}}},"/api/v3/admin/auth/password_resets":{"post":{"summary":"Request password reset","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Requests a password reset email for an admin user. Always returns `202`\nwhether or not the email matches an account, to prevent enumeration.\n\n`redirect_url` is where the emailed link should point (the reset token\nis appended as a `token` query param). It must match one of the store's\nallowed origins — otherwise it is silently ignored and the server-side\ndefault is used. The email is delivered by Spree itself via the\n`admin_user.password_reset_requested` event; this event is never\nforwarded to webhook endpoints.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"reset requested","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"redirect_url":{"type":"string","description":"Must match an allowed origin of the store; ignored otherwise."}},"required":["email"]}}}}}},"/api/v3/admin/auth/password_resets/{id}":{"patch":{"summary":"Reset password","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Consumes a password reset token (the `token` query param from the\nemailed link), sets the new password, and signs the admin in: the\nresponse carries a JWT access token and the rotatable refresh token is\nset in an HttpOnly cookie. The token is single-use — it invalidates as\nsoon as the password changes.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The reset token from the emailed link","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"password reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"invalid or expired token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"password_confirmation":{"type":"string"}},"required":["password","password_confirmation"]}}}}}},"/api/v3/admin/auth/setup":{"get":{"summary":"Check first-run setup availability","tags":["Authentication"],"description":"Reports whether first-run setup is still available — true only while\nthe installation has no admin user. Unauthenticated; the dashboard\nlogin page uses it to offer the setup screen.\n","responses":{"200":{"description":"setup status","content":{"application/json":{}}}}},"post":{"summary":"Complete first-run setup","tags":["Authentication"],"description":"Creates the first admin account and adopts the seeded store, authorized\nby the one-time setup token printed at install time (rotate it with\n`bin/rails spree:setup:token`). Issues a JWT access token and a\nrefresh-token cookie exactly like login. Returns 404 once any admin\nuser exists — the flow is closed permanently after setup.\n","parameters":[],"responses":{"200":{"description":"setup completed","content":{"application/json":{}}},"404":{"description":"setup not available","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["setup_token","email","password","country_code"],"properties":{"setup_token":{"type":"string","description":"One-time token from the install output."},"email":{"type":"string","format":"email"},"password":{"type":"string"},"password_confirmation":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"store_name":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country the store sells from. Determines the default market, the warehouse, the delivery zones and the currency."},"locale":{"type":"string","description":"Storefront locale. Defaults to the country's own language."},"currency":{"type":"string","description":"ISO 4217 currency. Defaults to the country's own currency — pass one only when the store prices in something else."}}}}}}}},"/api/v3/admin/auth/setup/countries":{"get":{"summary":"List countries for first-run setup","tags":["Authentication"],"description":"Countries the store can be set up in, each with the currency and\nofficial languages derived from it. Unauthenticated, because the setup\nscreen runs before any credential exists. Returns 404 once any admin\nuser exists.\n","responses":{"200":{"description":"countries","content":{"application/json":{}}}}}},"/api/v3/admin/allowed_origins":{"get":{"summary":"List allowed origins","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the CORS allowlist for the current store. Each entry is a\nbare `scheme://host[:port]` permitted to call the admin API from a\nbrowser. Backs the `Rack::Cors` allowlist and the CSRF boundary of\nthe admin cookie session (see\n`docs/plans/5.5-admin-auth-cookie-refresh.md`).\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[origin_cont]","in":"query","required":false,"description":"Filter by origin (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origins found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AllowedOrigin"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds an origin to the admin CORS allowlist. The value must be a bare\n`scheme://host[:port]` (no path, query, or fragment) and use `http` or\n`https`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"allowed origin created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}},"required":["origin"]}}}}}},"/api/v3/admin/allowed_origins/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Allowed origin ID","schema":{"type":"string"}}],"get":{"summary":"Get an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single allowed origin by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"404":{"description":"allowed origin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing allowed origin.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}}}}}}},"delete":{"summary":"Delete an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an origin from the admin CORS allowlist. After deletion the\nadmin SPA running at that origin will no longer be able to call the\nadmin API from a browser.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"allowed origin deleted"}}}},"/api/v3/admin/api_keys":{"get":{"summary":"List API keys","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns publishable and secret API keys for the current store. Secret keys are listed by `token_prefix` only — the plaintext token is delivered exactly once on create.\n\n**Required scope:** `read_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API keys found","content":{"application/json":{}}}}},"post":{"summary":"Create an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a publishable or secret API key. The plaintext token is included in the response **once** for secret keys; publishable keys expose their token on every read since they are intended for client-side use.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"secret key created — plaintext token returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","key_type"],"properties":{"name":{"type":"string"},"key_type":{"type":"string","enum":["publishable","secret"]},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/api_keys/{id}":{"get":{"summary":"Show an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key found","content":{"application/json":{}}}}},"patch":{"summary":"Update an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a key. `key_type` and `scopes` are fixed at creation — to change a key's authority, create a new key and revoke the old one.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key renamed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}}},"delete":{"summary":"Delete an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"API key deleted"}}}},"/api/v3/admin/api_keys/current":{"get":{"summary":"Describe the current API key","tags":["API Keys"],"security":[{"api_key":[]}],"description":"Returns the secret key that authenticated this request, including its live scopes. Useful to confirm a key's real, current authority. Only secret-key principals have a single key to describe.\n\n**Required scope:** none — any key can describe itself (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"current API key","content":{"application/json":{}}}}}},"/api/v3/admin/api_keys/{id}/revoke":{"patch":{"summary":"Revoke an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key revoked","content":{"application/json":{}}}}}},"/api/v3/admin/categories":{"get":{"summary":"List categories","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's categories (manual hierarchical taxons; rule-based collections are excluded).\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a category. Nests under the parent when parent_id is given, otherwise creates a top-level category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"category created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}},"required":["name"]}}}}}},"/api/v3/admin/categories/{id}":{"get":{"summary":"Get a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single category by ID.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"404":{"description":"category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}}}}}}},"delete":{"summary":"Delete a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a category and its descendants.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"204":{"description":"category deleted"}}}},"/api/v3/admin/categories/{id}/reposition":{"patch":{"summary":"Reposition a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a category to a new parent and/or index within the tree.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category repositioned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_parent_id":{"type":"string","description":"Prefixed ID of the new parent (omit for top level)"},"new_position":{"type":"integer","description":"0-based index among the new parent's children"}},"required":["new_position"]}}}}}},"/api/v3/admin/categories/{category_id}/products":{"get":{"summary":"List category products","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products classified under the category, ordered by their classification position.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Classifies a product under the category (appended to the end).\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/categories/{category_id}/products/{id}":{"delete":{"summary":"Remove a product from a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the category's manual classification.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/categories/{category_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a category product","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the category's products.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the category's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/channels":{"get":{"summary":"List channels","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channels configured for the current store.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"channels found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new channel on the current store. `code` is normalized to a\nURL-safe slug (`Point of Sale` → `point-of-sale`); when omitted it's\nderived from `name`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"channel created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string","description":"Slug — auto-derived from `name` when blank."},"active":{"type":"boolean","default":true},"default":{"type":"boolean","default":false},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}}},"/api/v3/admin/channels/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel found","content":{"application/json":{}}}}},"patch":{"summary":"Update a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}},"delete":{"summary":"Delete a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"channel deleted"}}}},"/api/v3/admin/channels/{id}/add_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Publish products on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the listed products on this channel. Idempotent — re-publishing\nan already-published product updates its publication window. Products from\nsibling stores are silently dropped.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}},"published_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications go live. `null` means immediately."},"unpublished_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications come down. `null` means never."}}}}}}}},"/api/v3/admin/channels/{id}/remove_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Unpublish products from a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes the listed products from this channel.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List order routing rules for a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channel's routing rules in priority order. The rules engine walks them top-down; see the Order Routing guide.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create an order routing rule on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a rule to the channel's routing list. The `type` is the wire shorthand from `GET /order_routing_rules/types` (e.g. `preferred_location`). Omitting `position` appends the rule at the end of the list. Each rule kind can appear at most once per channel — a duplicate `type` is rejected with a validation error.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"rule created","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules/{id}":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a rule's `active` flag, `position` (the list reorders around it), or `preferences`. The rule kind cannot be changed — delete and re-create instead.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/order_routing_rules/types":{"get":{"summary":"List available order routing rule types","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels, descriptions and preference schemas — drives the \"Add rule\" picker in the admin dashboard. Plugins extend the list by registering `Spree::OrderRoutingRule` subclasses via `Spree.order_routing.rules`.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/custom_field_definitions":{"get":{"summary":"List custom field definitions","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all defined custom fields. Filter by `?q[resource_type_eq]=Spree::Product` to narrow to one parent type.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definitions returned","content":{"application/json":{}}}}},"post":{"summary":"Create a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"definition created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["key","field_type","resource_type"],"properties":{"namespace":{"type":"string","description":"Defaults to `custom`"},"key":{"type":"string"},"label":{"type":"string","description":"Human-readable name; defaults to titleized `key`"},"field_type":{"type":"string","description":"Custom field type identifier (one of the registered field-type class names)."},"resource_type":{"type":"string","description":"Owner class, e.g. `Spree::Product`"},"storefront_visible":{"type":"boolean","description":"When false, the definition is admin-only and never exposed in the Store API"},"searchable":{"type":"boolean","description":"When true, values are included in storefront product text search"},"sortable":{"type":"boolean","description":"When true, storefront product listings can sort by this field"}}}}}}}},"/api/v3/admin/custom_field_definitions/{id}":{"get":{"summary":"Show a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definition found","content":{"application/json":{}}}}},"patch":{"summary":"Update a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"definition updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the definition and cascades to all custom field values referencing it.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"definition deleted"}}}},"/api/v3/admin/customer_groups":{"get":{"summary":"List customer groups","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer groups configured for the current store. Groups\nsegment customers for targeted promotions (see the `customer_group`\npromotion rule) and reporting. The list endpoint never embeds the\nmember list — fetch a single group with `?expand=customers` if you\nneed them inline, or query `/admin/customers?customer_group_id_in=…`\nfor paginated membership.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer group in the current store. `customer_ids` is\noptional; when present, customers are attached at create time.\nPass prefixed IDs (e.g. `cus_…`) — the server decodes them\nautomatically.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"customer group created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customer_groups/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer group prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single customer group. Pass `?expand=customers` to embed\nthe full member list inline (recommended only for single-record\nreads — embed cost scales with membership size).\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `customers`.","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer group with embedded customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"404":{"description":"customer group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, description, or membership. `customer_ids` is a\nfull-set replacement — the server reconciles the membership to\nmatch the array, adding new IDs and removing ones not present.\nSend `customer_ids: []` to clear all members.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer group updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the group. Member users are not deleted; their `customer_group_users` rows are dropped.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer group deleted"}}}},"/api/v3/admin/customers/{customer_id}/addresses":{"get":{"summary":"List customer addresses","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved addresses.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., country, state). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., first_name,last_name,address1,city). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"addresses found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new address to the customer's address book. Pass `is_default_billing: true` or `is_default_shipping: true` to set as the default — the previous default loses its flag in the same transaction.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"address created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string","description":"ISO-2 country code (e.g. US)"},"state_code":{"type":"string","description":"State/province abbreviation (e.g. NY)"},"phone":{"type":"string"},"company":{"type":"string"},"label":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}}},"/api/v3/admin/customers/{customer_id}/addresses/{id}":{"patch":{"summary":"Update a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a customer address.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"address updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"city":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the address. If it was a default, the customer loses that default (no auto-promotion).\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"address deleted"}}}},"/api/v3/admin/customers/{customer_id}/credit_cards":{"get":{"summary":"List customer credit cards","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved credit cards. Useful for off-session admin charges via `POST /admin/orders/:id/payments { source_id }`.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit cards found","content":{"application/json":{}}}}}},"/api/v3/admin/customers/{customer_id}/credit_cards/{id}":{"get":{"summary":"Show a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a saved credit card by ID.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit card found","content":{"application/json":{}}}}},"delete":{"summary":"Delete a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a saved credit card.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"credit card deleted"}}}},"/api/v3/admin/customers/{customer_id}/store_credits":{"get":{"summary":"List customer store credits","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns store credits issued to the customer.\n\n**Required scope:** `read_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., category, store, created_by). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,amount_used,memo,currency). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credits found","content":{"application/json":{}}}}},"post":{"summary":"Issue a store credit to a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"`created_by` is set automatically from the authenticated admin.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"store credit created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount","currency","category_id"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"},"category_id":{"type":"string","description":"StoreCreditCategory ID"},"memo":{"type":"string"}}}}}}}},"/api/v3/admin/customers/{customer_id}/store_credits/{id}":{"patch":{"summary":"Update a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Update memo / category / amount. The amount can only be changed if `amount_used == 0`.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"store credit updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"category_id":{"type":"string"},"memo":{"type":"string"}}}}}}},"delete":{"summary":"Delete a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused store credit (amount_used == 0). Returns 422 otherwise.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"store credit deleted"}}}},"/api/v3/admin/customers":{"get":{"summary":"List customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of customers. Supports Ransack search/filters.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[search]","in":"query","required":false,"description":"Email + name full-text-ish search","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., addresses, store_credits). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customers found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer. No welcome email is sent automatically.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"customer created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}}},"/api/v3/admin/customers/{id}":{"get":{"summary":"Show a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full customer details including computed order stats (orders_count, total_spent, last_order_completed_at).\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Customer ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations: addresses, orders, store_credits, default_billing_address, default_shipping_address","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer found","content":{"application/json":{}}}}},"patch":{"summary":"Update a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates customer attributes. `tags` replaces the full set.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}},"delete":{"summary":"Delete a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a customer. Returns 422 if the customer has any orders.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer deleted"}}}},"/api/v3/admin/customers/bulk_add_to_groups":{"post":{"summary":"Bulk-add customers to groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each customer in `ids` to every group in `customer_group_ids`.\nIdempotent — customers already in a group are skipped server-side.\nGroups from sibling stores are silently ignored. Returns counts of\ncustomers and groups that were processed (post store-scoping).\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers added to groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_from_groups":{"post":{"summary":"Bulk-remove customers from groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each customer in `ids` from every group in `customer_group_ids`.\nNo-op for non-members. Groups from sibling stores are silently ignored.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers removed from groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_add_tags":{"post":{"summary":"Bulk-add tags to customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every customer in `ids`. Tags are\nupserted by name; re-adding an existing tag is a no-op.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag name in `tags` from every customer in `ids`. No-op\nfor customers that don't carry the tag.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/exports":{"get":{"summary":"List exports","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV exports queued or completed for the current store. Polled by the admin SPA to detect when an export finishes (`done: true`).\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"exports found","content":{"application/json":{}}}}},"post":{"summary":"Create an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV export. The `type` selects the dataset; `search_params` is an\noptional Ransack query (same shape used by the `q[...]` params on list endpoints)\nthat filters which records are exported. Pass `record_selection: \"all\"` to\nclear the filter server-side and export everything in scope.\n\nGeneration is asynchronous. Poll `GET /admin/exports/{id}` until `done` is `true`,\nthen redirect the browser to `download_url` to fetch the file.\n\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"export queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["products","orders","customers","product_translations","gift_cards","coupon_codes","newsletter_subscribers"]},"record_selection":{"type":"string","enum":["filtered","all"],"description":"Set to \"all\" to ignore search_params and export everything in scope."},"search_params":{"type":"object","description":"Ransack query hash. Same predicates accepted by the list endpoint.","additionalProperties":true},"results_url":{"type":"string","description":"Absolute URL of your admin exports view; the export-done email uses it as the download button target. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/exports/{id}":{"get":{"summary":"Show an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns export status. While `done` is `false`, the SPA continues polling.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"export found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the export and purges its attachment.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"export deleted"}}}},"/api/v3/admin/exports/{id}/download":{"get":{"summary":"Download an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the exported CSV with `Content-Disposition: attachment`. Returns 422 with `code: export_not_ready` while `done` is still `false`. The endpoint is JWT/API-key protected, so SPA clients must fetch it (with `Authorization` header) and trigger the browser download via a Blob URL — a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments":{"get":{"summary":"List fulfillments","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all shipments for an order.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillments found","content":{"application/json":{}}}}},"post":{"summary":"Create a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually creates a fulfillment on a completed order, bypassing order routing — for example to mirror a shipment handled by an external carrier or 3PL. Moves the requested line item quantities out of their current fulfillments; when `items` is omitted, every not-yet-shipped unit is moved. Pass `status: 'shipped'` to register an already-shipped fulfillment (fires shipped webhooks and freezes cost/carrier). When `delivery_method_id` is omitted, the fulfillment inherits the delivery method and cost of the source fulfillment(s) it fully drains — keeping the order total unchanged; partially drained splits get no carrier when shipped, and pending fulfillments are otherwise (re)priced by the standard rate engine, which selects the lowest-cost available rate. Pass `cost` to set an explicit shipping cost instead (e.g. the 3PL price) — note this changes the order total and payment state, and is guaranteed to persist only with `status: 'shipped'` (pending fulfillments are re-priced by the rate engine).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fulfillment created","content":{"application/json":{}}},"422":{"description":"order not completed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stock_location_id"],"properties":{"stock_location_id":{"type":"string","description":"Stock location the fulfillment ships from"},"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link — a full URL is served back as tracking_url unchanged instead of being templated into the delivery method tracking URL"},"delivery_method_id":{"type":"string","description":"Delivery method (carrier) to attach as the selected rate. Defaults to the delivery method of the fully drained source fulfillment(s)"},"cost":{"type":"string","description":"Explicit shipping cost. Defaults to the summed cost of the fully drained source fulfillment(s), which keeps the order total unchanged; an explicit cost changes the order total and payment state. Guaranteed to persist only with status: 'shipped' — pending fulfillments are re-priced by the rate engine"},"status":{"type":"string","enum":["shipped"],"description":"Pass 'shipped' to register the fulfillment as already shipped"},"items":{"type":"array","description":"Line item quantities to fulfill. Omit to fulfill every not-yet-shipped unit.","items":{"type":"object","required":["item_id","quantity"],"properties":{"item_id":{"type":"string","description":"Line item ID"},"quantity":{"type":"integer"}}}},"metadata":{"type":"object","additionalProperties":true}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}":{"get":{"summary":"Show a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific shipment.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment found","content":{"application/json":{}}}}},"patch":{"summary":"Update a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a fulfillment (tracking, delivery rate).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link served back as tracking_url unchanged"},"selected_delivery_rate_id":{"type":"string","description":"Delivery rate ID (dr_...) to select"}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill":{"patch":{"summary":"Fulfill a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks a fulfillment as fulfilled.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment fulfilled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/purchase_label":{"patch":{"summary":"Buy the shipping label","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Buys the shipping label for a parcel that has not shipped yet — print it, pack the box, then mark the fulfillment fulfilled. Only delivery methods whose provider produces labels accept this.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"label purchased","content":{"application/json":{}}},"422":{"description":"provider does not produce labels","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/mark_delivered":{"patch":{"summary":"Mark a fulfillment delivered","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records that the customer received the goods. Only a fulfilled shipment can be marked delivered.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment delivered","content":{"application/json":{}}},"422":{"description":"fulfillment has not shipped","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When the goods arrived. Defaults to now."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification. Defaults to true."}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":{"patch":{"summary":"Cancel a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment canceled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":{"patch":{"summary":"Resume a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a canceled fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":{"patch":{"summary":"Split a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Transfers items from this shipment to a new shipment at a different stock location.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment split","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"stock_location_id":{"type":"string","description":"Target stock location ID"}}}}}}}},"/api/v3/admin/gift_card_batches":{"get":{"summary":"List gift card batches","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift card batches issued by the current store. Each batch\ngroups the cards generated together for a campaign or bulk-issuance\n— the cards themselves live under `/admin/gift_cards` and reference\nthe batch via `gift_card_batch_id`.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page","schema":{"type":"integer"}},{"name":"q[prefix_cont]","in":"query","required":false,"description":"Filter by prefix (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batches found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardBatch"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a batch of gift cards in a single call. The server generates\n`codes_count` cards inline for small batches (configurable via\n`Spree.config.gift_card_batch_web_limit`, default 500) or enqueues\na background job for larger ones. Each card's code is the batch\n`prefix` followed by random hex.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"gift card batch created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prefix","amount","codes_count"],"properties":{"prefix":{"type":"string","description":"Lowercased and prepended to every generated code."},"amount":{"type":"string","description":"Decimal amount per card, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"codes_count":{"type":"integer","description":"Number of cards to generate. Capped at `gift_card_batch_limit`."},"expires_at":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/gift_card_batches/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card batch prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single batch.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batch found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"404":{"description":"gift card batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/gift_cards":{"get":{"summary":"List gift cards","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift cards issued by the current store. Filter by\n`q[code_cont]` for code search, `q[user_id_eq]` for cards issued\nto a specific customer, or `q[state_eq]` for status filtering.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[code_cont]","in":"query","required":false,"description":"Filter by gift card code (contains)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by status (active, redeemed, partially_redeemed, canceled)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift cards found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a gift card scoped to the current store. The code is\nauto-generated when omitted. `currency` defaults to the store's\nconfigured currency. Pass `user_id` (prefixed ID) to attach the\ncard to a specific customer.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"gift card created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","description":"Decimal amount, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"code":{"type":"string","description":"Optional caller-supplied code. Auto-generated when omitted."},"expires_at":{"type":"string","description":"ISO 8601 date.","nullable":true},"user_id":{"type":"string","description":"Optional customer prefixed ID.","nullable":true}}}}}}}},"/api/v3/admin/gift_cards/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single gift card.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"404":{"description":"gift card not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an active gift card's editable attributes. Redeemed or\npartially-redeemed cards cannot be edited.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"expires_at":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused gift card. Cards that have been redeemed or\npartially redeemed cannot be deleted and return 422.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"gift card deleted"},"422":{"description":"redeemed gift card cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/imports":{"get":{"summary":"List imports","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV imports queued or completed for the current store.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"imports found","content":{"application/json":{}}}}},"post":{"summary":"Create an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV import. Upload the file first via `POST /api/v3/admin/direct_uploads`\nand pass the returned `signed_id` as `attachment`. On success the import is in the\n`mapping` state and the response carries the mapping payload: `schema_fields`\n(the canonical columns for the type), `csv_headers`, a `sample_row`, and the\nauto-assigned `mappings`.\n\nAdjust mappings if needed, then call `PATCH /admin/imports/{id}/complete_mapping`\nto start processing. Poll `GET /admin/imports/{id}` while `status` is\n`completed_mapping`/`processing`; terminal statuses are `completed` and `failed`.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"import created in mapping state","content":{"application/json":{}}},"422":{"description":"unknown import type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type","attachment"],"properties":{"type":{"type":"string","enum":["products","customers","product_translations"]},"attachment":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."},"preferred_delimiter":{"type":"string","enum":[",",";","|","\t"],"description":"CSV column separator. Defaults to a comma."},"results_url":{"type":"string","description":"Absolute URL of your admin imports view; the import-done email links back to it with `?import=<id>` appended. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/imports/template":{"get":{"summary":"Download an import template","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a CSV header row for the given import type, including the custom field columns available for the model.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"200":{"description":"CSV template","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/example":{"get":{"summary":"Download an example import file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Redirects to a populated example CSV for the given import type — the same sample data `rake spree:load_sample_data` uses, pinned to the installed Spree version. Returns 404 for a type that ships no example file.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to the example CSV"}}}},"/api/v3/admin/imports/{id}":{"get":{"summary":"Show an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns import status and row counters. The admin dashboard polls this endpoint while `status` is `completed_mapping` or `processing`; `rows_count`, `completed_rows_count` and `failed_rows_count` drive the progress bar. The mapping payload (`csv_headers`, `sample_row`) is only present while `status` is `mapping`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"import found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the import, its rows and the uploaded file. Returns 422 while the import is being processed.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"import deleted"}}}},"/api/v3/admin/imports/{id}/download":{"get":{"summary":"Download the originally uploaded file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the CSV exactly as it was uploaded — the audit trail for what was imported. JWT/API-key protected; SPA clients fetch it with the Authorization header and trigger the browser download via a Blob URL.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/{id}/complete_mapping":{"patch":{"summary":"Complete mapping and start processing","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the submitted column mappings, then starts row processing. Omit `mappings`\nto accept the auto-assigned ones from the create response. Returns 422 when a\nrequired schema field is left unmapped (`details.missing_required_fields`) or a\nfile column is assigned twice.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"mapping completed, processing queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"array","description":"Column assignments to apply before starting. `file_column: null` unmaps a field.","items":{"type":"object","required":["schema_field"],"properties":{"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/imports/{id}/retry_failed_rows":{"patch":{"summary":"Retry failed rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-processes the rows that failed. The import re-enters `processing`; poll `GET /admin/imports/{id}` until it completes again. Returns 422 when the import is not `completed` or has no failed rows.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"retry queued","content":{"application/json":{}}}}}},"/api/v3/admin/imports/{import_id}/rows":{"get":{"summary":"List import rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Paginated rows of an import — the failure report. Filter with `q[status_eq]=failed` to list only rows that could not be imported; each row carries the raw CSV `data` and its `validation_errors`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter rows by status: pending, processing, completed, failed.","schema":{"type":"string"}}],"responses":{"200":{"description":"rows found","content":{"application/json":{}}}}}},"/api/v3/admin/markets":{"get":{"summary":"List markets","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `countries`.","schema":{"type":"string"}}],"responses":{"200":{"description":"markets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new market for the current store.\n\n- `country_codes` 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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"market created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code."},"default_locale":{"type":"string","description":"IETF locale tag used as the market default."},"supported_locales":{"type":"array","items":{"type":"string"},"description":"Locale codes available in this market. The default is always implicitly included."},"tax_inclusive":{"type":"boolean","default":false,"description":"Display prices with tax included."},"default":{"type":"boolean","default":false,"description":"Setting to true demotes the previous default."},"position":{"type":"integer","description":"Sort order within the store; lower = first."},"country_codes":{"type":"array","items":{"type":"string"},"description":"2-letter ISO country codes assigned to this market. At least one is required."}},"required":["name","currency","default_locale","country_codes"]}}}}}},"/api/v3/admin/markets/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"market found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"404":{"description":"market not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing market. Pass `country_codes` 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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"market updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"supported_locales":{"type":"array","items":{"type":"string"}},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer"},"country_codes":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"market deleted"},"422":{"description":"cannot delete default or last market","content":{"application/json":{}}}}}},"/api/v3/admin/option_types":{"get":{"summary":"List option types","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of option types.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new option type. Supports nested option values.\n\nOption values can be provided inline and will be created or updated by name.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"option type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}},"required":["name","label"]}}}}}},"/api/v3/admin/option_types/{id}":{"get":{"summary":"Get an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single option type by ID, including its option values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"404":{"description":"option type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an option type. Supports updating nested option values.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"200":{"description":"option type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Existing option value ID to update"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an option type.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"204":{"description":"option type deleted"}}}},"/api/v3/admin/orders/{order_id}/tax_lines":{"get":{"summary":"List tax lines","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed tax rows on the order. Read-only — written exclusively by the tax provider.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"tax lines found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/discounts":{"get":{"summary":"List discounts","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed discount rows (promotion-sourced and manual) on the order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"discounts found","content":{"application/json":{}}}}},"post":{"summary":"Create manual discount","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual discount. With line_item_id a single row is created; without it the amount is distributed across line items (largest remainder). This is the sanctioned post-placement discount path and works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"discount created","content":{"application/json":{}}},"422":{"description":"invalid discount","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"},"value_type":{"type":"string","enum":["flat","percent"]},"line_item_id":{"type":"string","nullable":true,"description":"Target line item; omit to distribute order-level"}},"required":["label","value"]}}}}}},"/api/v3/admin/orders/{order_id}/fees":{"post":{"summary":"Create fee","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a fee (surcharge, handling, gift wrap, COD, payment fee). Order-level when no target is given. Works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fee created","content":{"application/json":{}}},"422":{"description":"invalid fee","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty"],"description":"Defaults to 'surcharge'"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true}},"required":["label","amount"]}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards":{"post":{"summary":"Apply a gift card to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"gift card applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Gift card code"}}}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards/{id}":{"delete":{"summary":"Remove a gift card from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Gift card ID","schema":{"type":"string"}}],"responses":{"204":{"description":"gift card removed"}}}},"/api/v3/admin/orders/{order_id}/items":{"get":{"summary":"List order items","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"items found","content":{"application/json":{}}}}},"post":{"summary":"Add an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"item added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Prefixed variant ID"},"quantity":{"type":"integer","default":1}}}}}}}},"/api/v3/admin/orders/{order_id}/items/{id}":{"get":{"summary":"Show an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"item found","content":{"application/json":{}}}}},"patch":{"summary":"Update an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"200":{"description":"item updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer"}}}}}}},"delete":{"summary":"Remove an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"204":{"description":"line item removed"}}}},"/api/v3/admin/orders/{order_id}/store_credits":{"post":{"summary":"Apply customer's store credit to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"store credit applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","description":"Optional explicit amount; defaults to order outstanding balance"}}}}}}},"delete":{"summary":"Remove store credit from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"store credit removed"}}}},"/api/v3/admin/orders":{"get":{"summary":"List orders","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., created_at, -created_at, completed_at)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by state (cart, address, delivery, payment, confirm, complete, canceled)","schema":{"type":"string"}},{"name":"q[email_cont]","in":"query","required":false,"description":"Filter by email (contains)","schema":{"type":"string"}},{"name":"q[number_eq]","in":"query","required":false,"description":"Filter by order number","schema":{"type":"string"}},{"name":"q[completed_at_gt]","in":"query","required":false,"description":"Filter by completed after date","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"orders found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft order in one shot. Customer, items, addresses, currency,\nmarket, channel, locale, notes, metadata, and a coupon code can all be\nprovided inline.\n\nSetting `preferred_stock_location_id` pins the order's preferred fulfillment\nlocation — Order Routing's built-in `PreferredLocation` rule consumes it\nwhen picking which stock location ships each shipment.\n\nInvalid coupon codes are non-fatal — the order is created and the failure\nis reported on the service result (not in the API response body for now).\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"order created with preferred_stock_location_id","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_id":{"type":"string","description":"Customer ID. Alias: user_id (legacy)."},"use_customer_default_address":{"type":"boolean","description":"When true with customer_id, copies the customer's saved billing/shipping addresses onto the order."},"currency":{"type":"string"},"market_id":{"type":"string","description":"Market ID"},"channel_id":{"type":"string","description":"Channel ID. Defaults to the store primary channel when omitted."},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Order Routing's built-in PreferredLocation rule reads this and ranks the location first; routing falls back to the next rule when the preferred location can't cover the cart."},"locale":{"type":"string"},"customer_note":{"type":"string","description":"Public, customer-visible note"},"internal_note":{"type":"string","description":"Staff-only note"},"metadata":{"type":"object","description":"Arbitrary key/value metadata"},"shipping_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"shipping_address_id":{"type":"string","description":"Existing customer address ID"},"billing_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"billing_address_id":{"type":"string","description":"Existing customer address ID"},"items":{"type":"array","items":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}},"coupon_code":{"type":"string","description":"Optional. Applied non-fatally; invalid codes do not block creation."}}}}}}}},"/api/v3/admin/orders/{id}":{"get":{"summary":"Show an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID (e.g., or_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"order found","content":{"application/json":{}}},"404":{"description":"order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_note":{"type":"string"},"internal_note":{"type":"string"},"channel_id":{"type":"string","description":"Channel ID"},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Re-runs Order Routing's PreferredLocation rule on subsequent shipment rebuilds."},"ship_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"bill_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}}}}}}}},"delete":{"summary":"Delete a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"order deleted"}}}},"/api/v3/admin/orders/{id}/complete":{"patch":{"summary":"Complete an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Completes an order in the `confirm` state, marking it as placed.\n\nSet `notify_customer: true` to send the order confirmation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order completed","content":{"application/json":{}}},"422":{"description":"order cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{"patch":{"summary":"Cancel an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a completed order.\n\nSet `notify_customer: true` to send the order cancellation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order canceled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order cancellation email after canceling."}}}}}}}},"/api/v3/admin/orders/{id}/approve":{"patch":{"summary":"Approve an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order approved","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resume":{"patch":{"summary":"Resume a canceled order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resend_confirmation":{"post":{"summary":"Resend confirmation email","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"confirmation resent","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods":{"get":{"summary":"List payment methods","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment methods found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/types":{"get":{"summary":"List available payment provider types","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a \"Provider\" dropdown in admin UIs.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"provider types found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/{id}":{"get":{"summary":"Show a payment method","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a payment method by ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment method found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments":{"get":{"summary":"List payments","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all payments for an order.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payments found","content":{"application/json":{}}}}},"post":{"summary":"Create a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new payment for the order.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"payment created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_method_id"],"properties":{"payment_method_id":{"type":"string","description":"Payment method ID"},"amount":{"type":"string"},"source_id":{"type":"string","description":"Payment source ID"}}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}":{"get":{"summary":"Show a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific payment.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/capture":{"patch":{"summary":"Capture a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Captures a pending payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment captured","content":{"application/json":{}}},"422":{"description":"capture failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/void":{"patch":{"summary":"Void a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Voids a payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment voided","content":{"application/json":{}}}}}},"/api/v3/admin/price_lists":{"get":{"summary":"List price lists","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `price_rules`.","schema":{"type":"string"}}],"responses":{"200":{"description":"price lists found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceList"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft price list.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"price list created (server-to-server — rules + prices, no product_ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids to seed the list with."},"rules":{"type":"array","description":"STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Server-to-server alternative to `product_ids`: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)`. Mix-and-match with `product_ids` is supported but typically unnecessary — `prices` alone tells the server which variants belong to the list and what the override amount is.","items":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/price_lists/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"404":{"description":"price list not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list updated with nested rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids — reconciles list membership (adds + removes)."},"rules":{"type":"array","items":{"type":"object","required":["type"],"properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Individual price overrides (the spreadsheet payload). Each row updates by `id` if shipped, otherwise upserts on the unique key `(variant_id, currency, price_list_id)`.","items":{"type":"object","oneOf":[{"required":["id"]},{"required":["variant_id","currency"]}],"properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}},"delete":{"summary":"Delete a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price list. Associated prices are removed asynchronously.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price list deleted"}}}},"/api/v3/admin/price_lists/{id}/activate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Activate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/price_lists/{id}/deactivate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Deactivate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/prices":{"get":{"summary":"List prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[price_list_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[price_list_id_null]","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q[currency_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[variant_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`.","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `variant`.","schema":{"type":"string"}}],"responses":{"200":{"description":"prices found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"price created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/prices/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"404":{"description":"price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price (acts_as_paranoid).\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price deleted"}}}},"/api/v3/admin/prices/bulk_upsert":{"post":{"summary":"Bulk-upsert prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices upserted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}},"422":{"description":"missing prices key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"type":"array","items":{"type":"object","required":["variant_id","currency"],"properties":{"id":{"type":"string","nullable":true},"variant_id":{"type":"string"},"currency":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/prices/bulk_destroy":{"delete":{"summary":"Bulk-delete prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each price in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices deleted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields":{"get":{"summary":"List product custom fields","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the product's custom field values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom fields found","content":{"application/json":{}}}}},"post":{"summary":"Create a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"custom field created","content":{"application/json":{}}},"422":{"description":"duplicate definition for the same product","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["custom_field_definition_id","value"],"properties":{"custom_field_definition_id":{"type":"string","description":"Prefixed `cfdef_…` id"},"value":{"description":"Value matching the definition's `field_type`"}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields/{id}":{"get":{"summary":"Show a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom field found","content":{"application/json":{}}}}},"patch":{"summary":"Update a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"custom field updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"New value"}}}}}}},"delete":{"summary":"Delete a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"custom field deleted"}}}},"/api/v3/admin/products/{product_id}/translations":{"get":{"summary":"List product translations","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the full translation matrix for the product: the source value and content type per translatable field, plus the translated value for every supported locale.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations found","content":{"application/json":{}}}}}},"/api/v3/admin/products":{"get":{"summary":"List products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of products for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., name, -name, price, -price, best_selling)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new product. Supports nested variants with prices and option types.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}},"required":["name"]}}}}}},"/api/v3/admin/products/{id}":{"get":{"summary":"Get a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID (e.g., prod_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"product found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"404":{"description":"product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"200":{"description":"product updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}}}},"delete":{"summary":"Delete a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a product.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product deleted"},"422":{"description":"deletion refused by a store rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/products/bulk_status_update":{"post":{"summary":"Bulk-update product status","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets `status` on each product in `ids`. Reindexes the affected products\nfor search. Cross-store IDs are silently dropped. Returns counts.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"cross-store products silently dropped","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"status":{"type":"string"}}}}}},"422":{"description":"invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","active","archived"]}}}}}}}},"/api/v3/admin/products/bulk_add_to_categories":{"post":{"summary":"Bulk-add products to categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every category (category) in `category_ids`.\nCategories from sibling stores are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to categories","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"category_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_categories":{"post":{"summary":"Bulk-remove products from categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every category in `category_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from categories","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_collections":{"post":{"summary":"Bulk-add products to collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every manual collection in `collection_ids`.\nAutomatic (rule-based) and sibling-store collections are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to collections","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"collection_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_collections":{"post":{"summary":"Bulk-remove products from collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every collection in `collection_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from collections","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_channels":{"post":{"summary":"Bulk-add products to channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes each product in `ids` on every channel in `channel_ids`. Idempotent —\nre-publishing on an existing channel is a no-op. Channels from sibling stores\nare silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published on channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_channels":{"post":{"summary":"Bulk-remove products from channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes each product in `ids` from every channel in `channel_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished from channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"},"removed":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_tags":{"post":{"summary":"Bulk-add tags to products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag in `tags` from every product in `ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_destroy":{"delete":{"summary":"Bulk-delete products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each product in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products deleted","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/promotions/{promotion_id}/coupon_codes":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List coupon codes for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"coupon codes found","content":{"application/json":{}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List actions for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"actions found","content":{"application/json":{}}}}},"post":{"summary":"Create an action on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"action created","content":{"application/json":{}}},"422":{"description":"unknown action type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Delete an action from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"action deleted"}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List rules for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create a rule on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"rule created with preferences","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a rule's preferences","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete a rule from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/promotions":{"get":{"summary":"List promotions","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotions found","content":{"application/json":{}}}}},"post":{"summary":"Create a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"promotion created with rules and actions","content":{"application/json":{}}},"422":{"description":"invalid params","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"integer","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}},"required":["name"]}}}}}},"/api/v3/admin/promotions/{id}":{"get":{"summary":"Show a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotion found","content":{"application/json":{}}}}},"patch":{"summary":"Update a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules and actions cleared with empty arrays","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"Pass to update an existing rule; omit to build a new one"},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}}}}}}},"delete":{"summary":"Delete a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"promotion deleted"}}}},"/api/v3/admin/promotion_actions/types":{"get":{"summary":"List available promotion action types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"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).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"action types found","content":{"application/json":{}}}}}},"/api/v3/admin/promotion_rules/types":{"get":{"summary":"List available promotion rule types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule types found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/refunds":{"get":{"summary":"List refunds","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all refunds for an order.\n\n**Required scope:** `read_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment, refund_reason). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,reason,transaction_id). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"refunds found","content":{"application/json":{}}}}},"post":{"summary":"Create a refund","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.\n\n**Required scope:** `write_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"refund created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_id","amount"],"properties":{"payment_id":{"type":"string","description":"Payment ID"},"amount":{"type":"string"},"refund_reason_id":{"type":"string","description":"Refund reason ID"}}}}}}}},"/api/v3/admin/locales":{"get":{"summary":"List supported locales","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the locales a merchant can translate content into for the current store, with the default and right-to-left flags.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"locales found","content":{"application/json":{}}}}}},"/api/v3/admin/store_credit_categories":{"get":{"summary":"List store credit categories","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured store credit categories. Categories classify\nstore credits (e.g., \"Goodwill\", \"Gift Card\", \"Refund\") and surface\nin the admin UI as a dropdown when issuing or editing a store\ncredit. Category names matching `Spree::Config[:non_expiring_credit_types]`\nare flagged via `non_expiring: true`.\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCreditCategory"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credit_categories/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Store credit category ID","schema":{"type":"string"}}],"get":{"summary":"Get a store credit category","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single store credit category by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCreditCategory"}}}},"404":{"description":"store credit category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store":{"get":{"summary":"Get the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current store configuration. The store is resolved from the request context (host or admin selection); there is no `id` parameter.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the current store configuration.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"store updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"preferred_admin_locale":{"type":"string"},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_unit_system":{"type":"string"}}}}}}}},"/api/v3/admin/tags":{"get":{"summary":"List tags","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns tag names for a given taggable type. Used for autocomplete in tag inputs on products, orders, and customers.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"taggable_type","in":"query","required":true,"description":"Taggable type (`Spree::Product`, `Spree::Order`, or `Spree::User`)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Optional case-insensitive substring filter","schema":{"type":"string"}}],"responses":{"200":{"description":"tags found","content":{"application/json":{}}},"422":{"description":"invalid taggable type","content":{"application/json":{}}}}}},"/api/v3/admin/tax_rates":{"get":{"summary":"List tax rates","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's tax rates. Rates are the entire configuration of\nthe built-in tax provider: each pairs a tax category with a jurisdiction\n(a country, optionally narrowed to one state) and a percentage, and\ndecides whether the tax is already included in the product price\n(VAT-style) or added on top (US-style).\n\nMarkets using an external tax provider ignore these rows — that\nprovider carries its own jurisdiction data.\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[included_in_price_true]","in":"query","required":false,"description":"Only rates included in the product price","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rates found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a tax rate for the current store. Give either `amount` as a\ndecimal (`0.19`) or `amount_percentage` as a percentage (`19`).\n\nName the jurisdiction with `country_code` (and `state_code` for a\nstate-level rate). Omitting the country makes the rate apply everywhere.\n\nSet `included_in_price` for VAT-style pricing, where the rate is backed\nout of the displayed price rather than added to it.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"tax rate created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Customer-facing rate name, e.g. \"VAT\""},"amount":{"type":"string","description":"Rate as a decimal, e.g. \"0.19\""},"amount_percentage":{"type":"number","description":"Rate as a percentage, e.g. 19"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string","description":"ISO code, e.g. \"DE\". Omit for every country."},"state_code":{"type":"string","description":"State abbreviation within that country, e.g. \"CA\"."}},"required":["name","tax_category_id"]}}},"required":true}}},"/api/v3/admin/tax_rates/{id}":{"parameters":[{"name":"id","in":"path","description":"Tax rate ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}}},"patch":{"summary":"Update a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"amount":{"type":"string"},"amount_percentage":{"type":"number"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"}}}}},"required":true}},"delete":{"summary":"Delete a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the rate. Tax lines it already produced keep their own rate snapshot.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"tax rate deleted"}}}},"/api/v3/admin/translatable_resources":{"get":{"summary":"List translatable resources","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every translatable resource type and its translatable fields (key + content type), so clients can render translation editors generically.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translatable resources found","content":{"application/json":{}}}}}},"/api/v3/admin/translations/batch":{"post":{"summary":"Batch upsert translations","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Atomically upserts translations across many records of (possibly) different translatable resource types in one request — e.g. an option type and all its option values in one save. A flat list of independent registry writes; all entries succeed or none do.\n\n**Required scope:** `write_<resource>` for every resource type in the batch (for API-key authentication) (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations upserted","content":{"application/json":{}}},"422":{"description":"unsupported locale rolls back the whole batch","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["translations"],"properties":{"translations":{"type":"array","items":{"type":"object","required":["resource_type","resource_id","values"],"properties":{"resource_type":{"type":"string","description":"Translatable resource type token, e.g. `option_type`"},"resource_id":{"type":"string","description":"Prefixed id of the record"},"values":{"type":"object","description":"Map of locale code to { field: value }","additionalProperties":{"type":"object","additionalProperties":true}}}}}}}}}}}},"/api/v3/admin/admin_users":{"get":{"summary":"List staff","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns admin users with at least one role assignment on the current store.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff found","content":{"application/json":{}}}}}},"/api/v3/admin/admin_users/{id}":{"get":{"summary":"Show a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member found","content":{"application/json":{}}}}},"patch":{"summary":"Update a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name fields and reassigns roles for the current store. `role_ids` is a complete replacement — roles not in the array are removed for this store.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"role_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Remove a staff member from this store","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the user's role assignments on the current store. The account is preserved — the user keeps access to any other stores.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"staff removed from store"}}}},"/api/v3/admin/invitations":{"get":{"summary":"List invitations","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns invitations for the current store, including pending and accepted.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitations found","content":{"application/json":{}}}}},"post":{"summary":"Create an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Invites a teammate by email. The invitation is scoped to the current store and carries the chosen role; on accept, a `RoleUser` is created via the invitation's `after_accept` callback.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"invitation created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","role_id"],"properties":{"email":{"type":"string"},"role_id":{"type":"string"}}}}}}}},"/api/v3/admin/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"invitation revoked"}}}},"/api/v3/admin/invitations/{id}/resend":{"patch":{"summary":"Resend an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a fresh token and dispatches the invitation email again.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitation resent","content":{"application/json":{}}}}}},"/api/v3/admin/permissions":{"get":{"summary":"List the permission catalog","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the permission catalog — the grant vocabulary shared by staff role permissions and secret API key scopes. Entries are grouped for permission pickers; labels and descriptions are localized. Readable by any authenticated admin credential.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"catalog returned","content":{"application/json":{}}}}}},"/api/v3/admin/roles":{"get":{"summary":"List roles","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns staff roles with their catalog permissions. Roles are global, not per-store; `mutable: false` marks the protected admin role and host-locked rows.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"roles found","content":{"application/json":{}}}}},"post":{"summary":"Create a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a staff role. `permissions` holds catalog keys (see GET /admin/permissions); a caller may only grant keys they effectively hold.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"role created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}}}},"/api/v3/admin/roles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a role name, description or permissions. The admin role and host-locked roles (`mutable: false`) reject changes.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"role updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a role. Fails with 422 while the role is protected or still referenced by staff members or pending invitations.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"role deleted"},"422":{"description":"role cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/stock_locations":{"get":{"summary":"List stock locations","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured stock locations. Stock locations are global\n(shared across stores). Filter with Ransack predicates such as\n`q[active_eq]`, `q[kind_eq]`, `q[pickup_enabled_eq]`, or\n`q[name_cont]`.\n\nPickup-related attributes (`kind`, `pickup_enabled`,\n`pickup_stock_policy`, `pickup_ready_in_minutes`,\n`pickup_instructions`) drive merchant pickup support at checkout —\ncustomers can collect orders from any active location with\n`pickup_enabled: true`.\n\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[active_eq]","in":"query","required":false,"description":"Filter by active status","schema":{"type":"boolean"}},{"name":"q[kind_eq]","in":"query","required":false,"description":"Filter by kind (built-in: 'warehouse', 'store', 'fulfillment_center')","schema":{"type":"string"}},{"name":"q[pickup_enabled_eq]","in":"query","required":false,"description":"Filter by pickup-enabled flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock locations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLocation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new stock location.\n\nSetting `default: true` automatically demotes the previous default\nlocation.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"stock location created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true,"description":"Internal name shown only in the admin"},"active":{"type":"boolean"},"default":{"type":"boolean","description":"Setting to true demotes the previous default."},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"],"description":"Categorizes the location."},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true,"description":"ISO-3166 alpha-2 country code (e.g. \"US\")."},"state_code":{"type":"string","nullable":true,"description":"State / province abbreviation (e.g. \"NY\"). Resolved against the selected country."},"state_name":{"type":"string","nullable":true,"description":"Free-text state for countries without a states list."},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"],"description":"'local' = items at this location only; 'any' = transfer-eligible (ship-to-store)."},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/stock_locations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock location ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single stock location by prefixed ID.\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"404":{"description":"stock location not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing stock location. Same address-field conventions as\nthe create endpoint.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"]},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"]},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the stock location (sets `deleted_at`). Existing\nfulfillments that referenced it keep the historical record via\n`Spree::StockLocation.with_deleted`.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"stock location deleted"}}}},"/api/v3/admin/products/{product_id}/variants":{"get":{"summary":"List product variants","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of variants for a product, including the default variant.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variants found","content":{"application/json":{}}}}},"post":{"summary":"Create a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new variant for a product. Supports nested prices and stock items.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"201":{"description":"variant created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"A variant on a product with option types should declare its option pairs (e.g. size + color) — one per option type it participates in. Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}},"/api/v3/admin/products/{product_id}/variants/{id}":{"get":{"summary":"Get a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single variant by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variant found","content":{"application/json":{}}},"404":{"description":"variant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a variant. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"200":{"description":"variant updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}},"delete":{"summary":"Delete a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a variant.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"204":{"description":"variant deleted"}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"List webhook deliveries","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns delivery attempts for the given endpoint, most recent first.\nEach row carries the original request payload, the response code\n(when the receiver replied), the execution time, and any transport\nerror — everything needed to audit failures and decide whether to\nredeliver.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[event_name_eq]","in":"query","required":false,"description":"Filter by event name (exact)","schema":{"type":"string"}},{"name":"q[success_eq]","in":"query","required":false,"description":"Filter by success flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-delivered_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}},"404":{"description":"parent webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single delivery attempt with the full request payload and\nthe response body the receiver returned. Use this for ad-hoc debug\nof failed deliveries.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery found","content":{"application/json":{}}},"404":{"description":"delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}/redeliver":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID to redeliver","schema":{"type":"string"}}],"post":{"summary":"Redeliver a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new delivery row with the same payload + event_name and\nqueues it. The original row is preserved for audit history.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"redelivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints":{"get":{"summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns outbound webhook subscriptions for the current store. Each\nendpoint receives a signed POST when any subscribed event fires.\n`secret_key` is `null` on list reads — the plaintext is delivered\nexactly once on create.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[url_cont]","in":"query","required":false,"description":"Filter by URL (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoints found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new outbound webhook subscription. The plaintext\n`secret_key` is returned **once** in this response — persist it\nimmediately to verify incoming webhook signatures. Subsequent reads\nreturn `null` for the secret. Pass an empty `subscriptions` array or\nomit it to receive every event.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"webhook endpoint created — secret_key returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/webhook_endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single webhook endpoint by prefixed ID.\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint found","content":{"application/json":{}}},"404":{"description":"webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, URL, active flag, or the event subscription list.\nToggling `active` here is equivalent to calling `disable`/`enable`\nwithout an audit reason.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint updated","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the endpoint and stops future deliveries.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"webhook endpoint deleted"}}}},"/api/v3/admin/webhook_endpoints/{id}/send_test":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"post":{"summary":"Send a test delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a `webhook.test` delivery record and queues it. Use this to\nverify the endpoint is reachable and your signature verification\naccepts Spree's payloads.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"test delivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/enable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Re-enable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-enables an endpoint that was manually or automatically disabled.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint enabled","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/disable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Disable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually pauses an endpoint. Unlike auto-disable (triggered after\nrepeated delivery failures), no notification email is sent.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint disabled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/collections":{"get":{"summary":"List collections","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's collections.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collections found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual or automatic (rule-based) collection. For automatic collections, send the full desired rule set under `rules`.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"collection created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"sort_order":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"rules":{"type":"array","description":"Full desired rule set. Entries with an id update, id-less entries create, omitted rules are removed.","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}},"required":["name"]}}}}}},"/api/v3/admin/collections/{id}":{"get":{"summary":"Get a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single collection by ID, including its rules.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collection found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"404":{"description":"collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a collection. Send `position` to reorder it within the flat list; send the full `rules` set to sync automatic rules.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"collection updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"sort_order":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer","description":"Reorders the collection within the flat list (acts_as_list)"},"rules":{"type":"array","description":"Full desired rule set (see create).","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}}}}}}},"delete":{"summary":"Delete a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a collection.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"204":{"description":"collection deleted"}}}},"/api/v3/admin/collections/{collection_id}/products":{"get":{"summary":"List collection products","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products curated in the collection, ordered by their membership position.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Curates a product into the collection (appended to the end).\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/collections/{collection_id}/products/{id}":{"delete":{"summary":"Remove a product from a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the collection's manual curation.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/collections/{collection_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a collection product","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the collection's products.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the collection's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/collection_rules/types":{"get":{"summary":"List available collection rule types","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels and descriptions — drives the rule picker on an automatic collection. Plugins extend the list by registering `Spree::CollectionRule` subclasses via `config.spree.collection_rules`. The `type` returned here is the wire shorthand accepted when writing a collection's `rules`.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/locations":{"get":{"summary":"List company locations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the branches of a business customer. Each branch owns its own addresses and the buyers authorised to purchase for it.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"locations found","content":{"application/json":{}}}}},"post":{"summary":"Create a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a branch. Addresses are supplied inline and belong to the branch, so editing one later changes the branch's own record rather than an address the buyer also uses.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"location created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"external_id":{"type":"string","nullable":true},"billing_address":{"type":"object","description":"Created inline and owned by the branch.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_code":{"type":"string"}}}},"required":["name"]}}}}}},"/api/v3/admin/company_locations/{id}":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Branches are addressed by their own id once you hold one — the company id is not needed.\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"location found","content":{"application/json":{}}}}},"patch":{"summary":"Update a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Address fields sent here edit the branch's existing address in place; send only what changes.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"200":{"description":"location updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"billing_address":{"type":"object","properties":{"city":{"type":"string"}}}}}}}}},"delete":{"summary":"Delete a company location","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the branch, its buyers and the addresses it owned.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"204":{"description":"location deleted"}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List tax exemption certificates","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a business's exemption evidence. `active` is the field that decides whether a certificate\nexempts a sale: a verified certificate stops counting once its expiry date passes, so the status\nalone does not answer it.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"certificates found","content":{"application/json":{}}}}},"post":{"summary":"Create a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records exemption evidence against a business. Certificates start `pending` and exempt nothing\nuntil verified.\n\n`country_code` and `state_code` say where the certificate holds — omit both for one valid\neverywhere, give only the country for one valid throughout it. `document` takes an ActiveStorage\nsigned blob id obtained from `POST /api/v3/admin/direct_uploads`.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"certificate created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"certificate_number":{"type":"string"},"reason_code":{"type":"string","description":"Becomes the tax provider's entity use code."},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"issuing_authority":{"type":"string","nullable":true},"document":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."}},"required":["certificate_number","reason_code"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/verify":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Verify a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Accepts the certificate as evidence, which is what makes it exempt sales. Only a pending\ncertificate can be accepted — re-accepting a revoked one would restore evidence that was\ndeliberately withdrawn. An installation that checks numbers against a registry, or requires a\nsecond approval, can refuse here, and the refusal is returned as a validation error.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate verified","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/revoke":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Revoke a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws accepted evidence. A verified certificate cannot be deleted — how a sale was taxed has to remain explainable — so revoking is the way out.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate revoked","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/download":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Download a certificate document","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the uploaded document. Deliberately not a storage link: the bytes come through the API so\nthe same credentials apply to every read of a confidential document. Requires only read access.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"document streamed","content":{"application/json":{}}},"422":{"description":"no document attached","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company tax registrations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business's tax registrations, one per kind. A business registration takes precedence\nover the buyer's own when a sale is for that business, because the invoice is addressed to the\nentity rather than the person who placed the order.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"registrations found","content":{"application/json":{}}}}},"post":{"summary":"Create a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registers a tax number against the business. Verification against the relevant registry runs in\nthe background where a validator is installed for the kind; a stock installation registers none,\nleaving the status unattempted.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"registration created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","description":"The regime the number belongs to."},"value":{"type":"string"}},"required":["kind","value"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers/{id}/validate":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Re-check a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Asks the registry again. Manual because a registry answers only \"valid now\" — a number verified\nlast year may have been deregistered since — and because a check that came back unavailable\ncannot otherwise be retried without editing the number.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"422":{"description":"no validator installed for this kind","content":{"application/json":{}}}}}},"/api/v3/admin/companies":{"get":{"summary":"List companies","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business customers of the current store.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"companies found","content":{"application/json":{}}}}},"post":{"summary":"Create a company","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a business customer. Exemption certificates and tax registrations hang off it.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"company created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"external_id":{"type":"string","nullable":true,"description":"Your own reference for this business, unique within the store."}},"required":["name"]}}}}}},"/api/v3/admin/company_locations/{company_location_id}/contacts":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_location_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company contacts","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customers authorised to purchase for a branch. A customer may act for more than one branch.\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"contacts found","content":{"application/json":{}}}}},"post":{"summary":"Create a company contact","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Authorises a customer to purchase for a branch. A customer who acts for exactly one branch has\ntheir orders attributed to it automatically; one who acts for several needs the branch set on\nthe order, because guessing would invoice the wrong business.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"contact created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_id":{"type":"string"},"role":{"type":"string","description":"Free-form label; carries no permissions in 6.0."}},"required":["customer_id"]}}}}}},"/api/v3/admin/company_contacts/{id}":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a company contact","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"contact found","content":{"application/json":{}}}}},"delete":{"summary":"Delete a company contact","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws the customer's authority to purchase for the branch. The customer account itself is untouched.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"204":{"description":"contact deleted"}}}},"/api/v3/admin/delivery_profiles":{"get":{"summary":"List delivery profiles","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Fulfillment profiles group products with the stock locations, delivery zones and delivery methods that fulfill them. Every store has exactly one default profile.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery profiles found","content":{"application/json":{}}}}},"post":{"summary":"Create a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery profile. `kind` selects the registered profile kind (shipping, digital, extension kinds); `stock_location_ids` limits fulfillment to those locations — empty means every store location.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"delivery profile created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","description":"Registered profile kind; defaults to shipping."},"default":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Empty means every store location."}},"required":["name"]}}}}}},"/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups":{"parameters":[{"name":"delivery_profile_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Create an origin group","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Origin groups partition a profile's fulfillment origins: zones and methods belong to a group, so the same products can quote different rate tables per warehouse. `stock_location_ids` replaces the full membership; empty means every store location.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"origin group created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Empty means every store location."}}}}}}}},"/api/v3/admin/delivery_profiles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery profile updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"default":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The default profile and profiles still referenced by products cannot be deleted.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"delivery profile deleted"}}}},"/api/v3/admin/delivery_methods":{"get":{"summary":"List delivery methods","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all delivery methods with calculator and zone configuration.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery methods found","content":{"application/json":{}}}}},"post":{"summary":"Create delivery method","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery method inside a delivery profile (defaults to the store default profile). Delivery behavior comes from the fulfillment provider.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"delivery method created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"integer","nullable":true},"estimated_transit_business_days_max":{"type":"integer","nullable":true},"tax_category_id":{"type":"string","nullable":true},"calculator_type":{"type":"string"},"calculator_preferences":{"type":"object"},"delivery_zone_id":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/delivery_methods/calculators":{"get":{"summary":"List delivery calculators","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registered delivery calculator classes with preference schemas for building configuration forms.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"calculators found","content":{"application/json":{}}}}}},"/api/v3/admin/delivery_zones":{"post":{"summary":"Create delivery zone","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery zone with typed members: country, state, or postal_code (prefix or from/to range).\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed, e.g. `members`","schema":{"type":"string"}}],"responses":{"201":{"description":"delivery zone created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"type":"object","properties":{"member_type":{"type":"string","enum":["country","state","postal_code"]},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true}},"required":["member_type"]}}},"required":["name"]}}}}}},"/api/v3/admin/integrations":{"get":{"summary":"List integrations","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the integrations connected to the current store. Secret preference values are masked.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integrations found","content":{"application/json":{}}}}},"post":{"summary":"Connect integration","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Connects an integration type to the current store. Setting active: true verifies the connection and fails with 422 when it cannot connect. Submitting a masked secret value back keeps the stored secret.\n\n**Required scope:** `write_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"integration connected","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand from GET /integrations/types"},"active":{"type":"boolean"},"preferences":{"type":"object"}},"required":["type"]}}}}}},"/api/v3/admin/integrations/types":{"get":{"summary":"List integration types","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every registered integration type with its gallery metadata and configuration schema. Pure registry discovery — read live connection state from GET /integrations.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integration types found","content":{"application/json":{}}}}}},"/api/v3/admin/integrations/{id}/test":{"post":{"summary":"Test integration connection","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Runs a live connection check against the provider. Nothing is persisted; a failed check reports the vendor error message.\n\n**Required scope:** `write_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"connection checked","content":{"application/json":{}}}}}},"/api/v3/admin/product_types":{"get":{"summary":"List product types","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of product types.\n\nA product type is a back-office template: it seeds option types and\ncategories onto products created with it, and defines which custom\nfields those products' forms show. It is not exposed on the Store API.\n\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}}],"responses":{"200":{"description":"product types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a product type.\n\n`option_type_ids` and `category_ids` seed products created with this\ntype. `custom_field_definitions` is a replace-set of the definitions the\nproduct form renders, in `sort_order`. `required` is advisory — the\ndashboard marks the field, but a blank value is never rejected.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"422":{"description":"unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true,"description":"Fulfillment profile stamped onto products created with this type. Null leaves new products on the store default profile."},"option_type_ids":{"type":"array","items":{"type":"string"},"description":"Option types seeded onto products created with this type."},"category_ids":{"type":"array","items":{"type":"string"},"description":"Categories seeded onto products created with this type."},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Prefixed custom field definition id."},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}},"required":["name"]}}}}}},"/api/v3/admin/product_types/{id}":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Retrieve a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product type with its option types, categories and custom fields.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"404":{"description":"product type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product type.\n\nChanges never modify products that already carry the type — use\n`apply_to_products` to backfill those.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a product type. Types still used by products cannot be deleted.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"product type deleted"}}}},"/api/v3/admin/product_types/{id}/apply_to_products":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"post":{"summary":"Apply a product type to its existing products","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Backfills the type's option types and categories onto the products that\nalready carry it. Additive and idempotent — nothing is removed, and\nre-running is safe.\n\nRuns in the background; the response reports how many products the type\ncurrently has.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"202":{"description":"backfill accepted","content":{"application/json":{"schema":{"type":"object","properties":{"products_count":{"type":"integer"}}}}}}}}},"/api/v3/admin/vendors":{"get":{"summary":"List vendors","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the sellers on this marketplace. `status` says where each one\nis in its life on the marketplace, and `sellable` answers the question\nthe status alone cannot: an approved vendor who is away cannot be\nbought from either.\n\n\n**Required scope:** `read_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"vendors found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Opens a seller record. The vendor starts as `pending` and has no team\nyet — invite someone to run it with the `invite` action below.\n\n`status` is deliberately not writable here or on update: every move\nthrough the lifecycle is its own action, because each one does more\nthan set a column.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"vendor created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"slug":{"type":"string","description":"Derived from the name when omitted."},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"about":{"type":"string","nullable":true},"tax_remittance":{"type":"string","enum":["vendor","platform"]},"payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"],"nullable":true},"minimum_payout_amount":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/vendors/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Vendor prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single vendor, including its settlement and tax configuration.\n\n**Required scope:** `read_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"vendor found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}},"404":{"description":"vendor not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the vendor's profile and the settlement configuration the\noperator owns. A `status` sent here is ignored — use the lifecycle\nactions.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"vendor address written inline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"billing_email":{"type":"string","nullable":true},"payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"],"nullable":true},"minimum_payout_amount":{"type":"string","nullable":true},"holiday_mode_until":{"type":"string","format":"date-time","nullable":true},"logo":{"type":"string","nullable":true,"description":"ActiveStorage signed id of a direct-uploaded file. Send `null` to remove the attachment, or omit the key to leave it alone. Same for `square_logo` and `cover_photo`."},"square_logo":{"type":"string","nullable":true},"cover_photo":{"type":"string","nullable":true},"billing_address":{"type":"object","description":"The vendor's own address, written inline. There is no `billing_address_id` — an address belongs to whoever it was created for, so it is never referenced by id here.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}},"returns_address":{"type":"object","description":"The vendor's own address, written inline. There is no `billing_address_id` — an address belongs to whoever it was created for, so it is never referenced by id here.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}}}}}}}},"delete":{"summary":"Delete a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the vendor. Their products are kept and left without a\nseller rather than deleted — what happens to a departed seller's\ncatalog is the operator's decision.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"vendor deleted"}}}},"/api/v3/admin/vendors/{id}/invite":{"parameters":[{"name":"id","in":"path","required":true,"description":"Vendor prefixed ID","schema":{"type":"string"}}],"post":{"summary":"Invite someone to run a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sends an invitation to the vendor's own team and moves the vendor to\n`invited`. The person becomes a member when they accept, and can then\nsign in to the vendor panel.\n\n`role_id` must name a role this vendor owns; omit it for the vendor's\nown admin role. Re-inviting is allowed — an invitation expires, or the\nfirst one goes to the wrong address.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"invitation sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"role_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/vendors/{id}/approve":{"parameters":[{"name":"id","in":"path","required":true,"description":"Vendor prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Approve a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lets the vendor sell. This is also the way back for one that was\nsuspended or turned down, and it clears any holiday along with the\nsuspension.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"vendor approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}},"422":{"description":"vendor cannot be approved from its current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/vendors/{id}/suspend":{"parameters":[{"name":"id","in":"path","required":true,"description":"Vendor prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Suspend a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stops a trading vendor from selling. Their catalog and history stay,\nand approving reinstates them. Use this rather than `reject` for a\nvendor already on the marketplace — it says something different, and\nit can be undone.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"vendor suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/vendors/{id}/reject":{"parameters":[{"name":"id","in":"path","required":true,"description":"Vendor prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Reject a vendor","tags":["Vendors"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Turns down an applicant who never traded. A vendor already selling is\nsuspended instead; rejecting one is refused.\n\n\n**Required scope:** `write_vendors` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"vendor rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}}},"components":{"schemas":{"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"count":{"type":"integer","description":"Total number of records"},"pages":{"type":"integer","description":"Total number of pages"},"from":{"type":"integer","description":"Index of first record on this page"},"to":{"type":"integer","description":"Index of last record on this page"},"in":{"type":"integer","description":"Number of records on this page"},"previous":{"type":"integer","nullable":true,"description":"Previous page number"},"next":{"type":"integer","nullable":true,"description":"Next page number"}},"required":["page","limit","count","pages","from","to","in"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","description":"Field-specific validation errors","nullable":true}},"required":["code","message"]}},"required":["error"]},"AuthResponse":{"type":"object","properties":{"token":{"type":"string","description":"JWT access token"},"user":{"$ref":"#/components/schemas/AdminUser"}},"required":["token","user"]},"PermissionRule":{"type":"object","description":"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.","properties":{"allow":{"type":"boolean","description":"true for `can`, false for `cannot`"},"actions":{"type":"array","items":{"type":"string"},"description":"Action names, e.g. [\"read\", \"update\"] or [\"manage\"]"},"subjects":{"type":"array","items":{"type":"string"},"description":"Subject class names, e.g. [\"Spree::Product\"] or [\"all\"]"},"has_conditions":{"type":"boolean","description":"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},"required":["allow","actions","subjects","has_conditions"]},"MeResponse":{"type":"object","description":"Current admin user profile and serialized permissions","properties":{"user":{"$ref":"#/components/schemas/AdminUser"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionRule"}}},"required":["user","permissions"]},"ImportSchemaField":{"type":"object","description":"A canonical column of an import type, including per-store custom field columns","properties":{"name":{"type":"string","description":"Canonical field name used in mappings"},"label":{"type":"string","description":"Human-readable label"},"required":{"type":"boolean","description":"Whether the field must be mapped before processing"}},"required":["name","label","required"]},"CheckoutRequirement":{"type":"object","properties":{"step":{"type":"string","description":"Checkout step this requirement belongs to"},"field":{"type":"string","description":"Field that needs to be satisfied"},"message":{"type":"string","description":"Human-readable requirement message"}},"required":["step","field","message"]},"CartWarning":{"type":"object","description":"A warning about a cart issue (e.g., item removed due to stock change)","properties":{"code":{"type":"string","description":"Machine-readable warning code"},"message":{"type":"string","description":"Human-readable warning message"},"line_item_id":{"type":"string","nullable":true,"description":"Prefixed line item ID (when applicable)"},"variant_id":{"type":"string","nullable":true,"description":"Prefixed variant ID (when applicable)"},"item_index":{"type":"integer","nullable":true,"description":"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},"required":["code","message"]},"FulfillmentManifestItem":{"type":"object","description":"An item within a fulfillment — which line item and how many units are in this fulfillment","properties":{"item_id":{"type":"string","description":"Line item ID"},"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer","description":"Quantity in this fulfillment"}},"required":["item_id","variant_id","quantity"]},"AdminUserRoleAssignment":{"type":"object","description":"A role assignment for the current store on a staff member","properties":{"id":{"type":"string","description":"Prefixed role ID"},"name":{"type":"string","description":"Role name"}},"required":["id","name"]},"AdminUserStore":{"type":"object","description":"A store the staff member can access through a role assignment","properties":{"id":{"type":"string","description":"Prefixed store ID"},"name":{"type":"string","description":"Store name"},"code":{"type":"string","description":"Store code"}},"required":["id","name","code"]},"PreferenceField":{"type":"object","description":"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.","properties":{"key":{"type":"string"},"type":{"type":"string","description":"string | text | password | integer | decimal | boolean | array | hash"},"default":{"description":"Default value (any JSON type), null when there is no default","nullable":true}},"required":["key","type"]},"PromotionActionCalculator":{"type":"object","description":"The action's nested calculator (when the action carries one — null for actions like `free_shipping`)","properties":{"type":{"type":"string","description":"Wire shorthand for the calculator subclass"},"label":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}}},"required":["type","label","preferences","preference_schema"]},"PromotionActionLineItem":{"type":"object","description":"One row in a `create_line_items` action — the variant added to the order and how many","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_id","quantity"]},"Address":{"type":"object","properties":{"id":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_name":{"type":"string"},"country_code":{"type":"string"},"state_text":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"},"state_abbr":{"type":"string","nullable":true},"country_iso":{"type":"string"},"state_name":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true}},"required":["id","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","label","metadata","created_at","updated_at","customer_id"],"x-typelizer":true},"AdminUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string","nullable":true},"selected_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"avatar_url":{"type":"string","nullable":true},"roles":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserRoleAssignment"}},"stores":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserStore"}}},"required":["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":true},"AllowedOrigin":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","origin","created_at","updated_at"],"x-typelizer":true},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key_type":{"type":"string"},"token_prefix":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"revoked_at":{"type":"string","nullable":true},"last_used_at":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"plaintext_token":{"type":"string","nullable":true},"created_by_email":{"type":"string","nullable":true}},"required":["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email"],"x-typelizer":true},"AppliedPromotion":{"type":"object","properties":{"id":{"type":"string"},"promotion_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":true},"Cart":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"preferred_stock_location_id":{"type":"string","nullable":true},"number":{"type":"string"},"token":{"type":"string"},"email":{"type":"string","nullable":true},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/CartWarning"}},"coupon_code":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"display_item_total":{"type":"string","nullable":true},"adjustment_total":{"type":"string","nullable":true},"display_adjustment_total":{"type":"string","nullable":true},"discount_total":{"type":"string","nullable":true},"display_discount_total":{"type":"string","nullable":true},"tax_total":{"type":"string","nullable":true},"display_tax_total":{"type":"string","nullable":true},"included_tax_total":{"type":"string","nullable":true},"display_included_tax_total":{"type":"string","nullable":true},"additional_tax_total":{"type":"string","nullable":true},"display_additional_tax_total":{"type":"string","nullable":true},"total":{"type":"string","nullable":true},"display_total":{"type":"string","nullable":true},"gift_card_total":{"type":"string","nullable":true},"display_gift_card_total":{"type":"string","nullable":true},"amount_due":{"type":"string","nullable":true},"display_amount_due":{"type":"string","nullable":true},"delivery_total":{"type":"string","nullable":true},"display_delivery_total":{"type":"string","nullable":true},"fee_total":{"type":"string","nullable":true},"display_fee_total":{"type":"string","nullable":true},"store_credit_total":{"type":"string","nullable":true},"display_store_credit_total":{"type":"string","nullable":true},"covered_by_store_credit":{"type":"boolean"},"current_step":{"type":"string"},"completed_steps":{"type":"array","items":{"type":"string"}},"requirements":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutRequirement"}},"shipping_eq_billing_address":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"completed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}}},"required":["id","market_id","channel_id","preferred_stock_location_id","number","token","email","customer_note","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":true},"Category":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"depth":{"type":"number"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"children_count":{"type":"number"},"parent_id":{"type":"string","nullable":true},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"is_root":{"type":"boolean"},"is_child":{"type":"boolean"},"is_leaf":{"type":"boolean"},"parent":{"$ref":"#/components/schemas/Category"},"children":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"ancestors":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"metadata":{"type":"object"},"pretty_name":{"type":"string"},"lft":{"type":"number"},"rgt":{"type":"number"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":true},"Channel":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"storefront_access":{"type":"string"},"guest_checkout":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true},"preferred_storefront_access":{"type":"string","nullable":true},"preferred_guest_checkout":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","code","active","default","storefront_access","guest_checkout","preferred_order_routing_strategy","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","stock_location_ids"],"x-typelizer":true},"ClaimLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"send_replacement":{"type":"boolean"},"description":{"type":"string","nullable":true},"refund_amount":{"type":"string"},"paid_amount":{"type":"string"},"display_refund_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"replacement_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"replacement_variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","quantity","send_replacement","description","refund_amount","paid_amount","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":true},"ClaimReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Claim":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"resolution":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"denied_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ClaimReason"},"claim_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ClaimLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id"],"x-typelizer":true},"CollectionRule":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string","nullable":true},"match_policy":{"type":"string"}},"required":["id","type","value","match_policy"],"x-typelizer":true},"Collection":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"sort_order":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"products_count":{"type":"number"},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRule"}}},"required":["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":true},"CompanyContact":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_location_id":{"type":"string"},"customer_id":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["id","role","created_at","updated_at","company_location_id","customer_id","email"],"x-typelizer":true},"CompanyLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_id":{"type":"string"},"contacts_count":{"type":"number"},"billing_address":{"$ref":"#/components/schemas/Address"},"shipping_address":{"$ref":"#/components/schemas/Address"},"company_contacts":{"type":"array","items":{"$ref":"#/components/schemas/CompanyContact"}}},"required":["id","name","external_id","metadata","created_at","updated_at","company_id","contacts_count","billing_address","shipping_address"],"x-typelizer":true},"Company":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"locations_count":{"type":"number"},"company_locations":{"type":"array","items":{"$ref":"#/components/schemas/CompanyLocation"}}},"required":["id","name","external_id","metadata","created_at","updated_at","locations_count"],"x-typelizer":true},"Country":{"type":"object","properties":{"iso":{"type":"string"},"iso3":{"type":"string"},"name":{"type":"string"},"states_required":{"type":"boolean"},"zipcode_required":{"type":"boolean"},"states":{"type":"array","items":{"$ref":"#/components/schemas/State"}},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true}},"required":["iso","iso3","name","states_required","zipcode_required"],"x-typelizer":true},"CouponCode":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"state":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"promotion_id":{"type":"string"},"order_id":{"type":"string","nullable":true}},"required":["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":true},"CreditCard":{"type":"object","properties":{"id":{"type":"string"},"brand":{"type":"string"},"last4":{"type":"string"},"month":{"type":"number"},"year":{"type":"number"},"name":{"type":"string","nullable":true},"default":{"type":"boolean"},"gateway_payment_profile_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"payment_method_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":true},"CustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"namespace":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"resource_type":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"},"filter_key":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","namespace","key","label","field_type","resource_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at"],"x-typelizer":true},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","deprecated":true},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"key":{"type":"string"},"value":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"storefront_visible":{"type":"boolean"},"custom_field_definition_id":{"type":"string"}},"required":["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":true},"CustomerGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"customers_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":true},"Customer":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"accepts_email_marketing":{"type":"boolean"},"full_name":{"type":"string"},"available_store_credit_total":{"type":"string"},"display_available_store_credit_total":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"default_billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"default_shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"newsletter_subscriber":{"allOf":[{"$ref":"#/components/schemas/NewsletterSubscriber"}],"nullable":true},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"failed_attempts":{"type":"number"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"internal_note_html":{"type":"string","nullable":true},"default_billing_address_id":{"type":"string","nullable":true},"default_shipping_address_id":{"type":"string","nullable":true},"orders_count":{"type":"number"},"total_spent":{"type":"string"},"display_total_spent":{"type":"string"},"last_order_completed_at":{"type":"string","nullable":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"store_credits":{"type":"array","items":{"$ref":"#/components/schemas/StoreCredit"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}},"required":["id","email","first_name","last_name","phone","accepts_email_marketing","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","created_at","updated_at","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":true},"DeliveryMethodRule":{"type":"object","properties":{"id":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","active","created_at","updated_at","type","name","description","preferences","preference_schema","product_ids"],"x-typelizer":true},"DeliveryMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"number","nullable":true},"estimated_transit_business_days_max":{"type":"number","nullable":true},"digital":{"type":"boolean"},"pickup":{"type":"boolean"},"pickup_point":{"type":"boolean"},"admin_name":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string"},"pickup_point_provider":{"type":"string","nullable":true},"rate_provider":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"},"services":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodService"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodRule"}},"tax_category_id":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string"},"delivery_origin_group_id":{"type":"string","nullable":true},"delivery_zone_id":{"type":"string","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"}},"calculator_type":{"type":"string","nullable":true},"calculator_preferences":{"type":"object","nullable":true}},"required":["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","fulfillment_provider","pickup_point_provider","rate_provider","storefront_visible","tracking_url","markup_flat","markup_percent","created_at","updated_at","deleted_at","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","calculator_type","calculator_preferences"],"x-typelizer":true},"DeliveryMethodService":{"type":"object","properties":{"id":{"type":"string"},"carrier":{"type":"string"},"service":{"type":"string"},"label":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"position":{"type":"number"}},"required":["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":true},"DeliveryOriginGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"position":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"delivery_zones_count":{"type":"number"},"delivery_methods_count":{"type":"number"}},"required":["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":true},"DeliveryProfile":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"default":{"type":"boolean"},"position":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"kind":{"type":"string"},"digital":{"type":"boolean"},"offers_pickup":{"type":"boolean"},"offers_shipping":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"origin_groups":{"type":"object"},"products_count":{"type":"number"},"delivery_methods_count":{"type":"number"},"delivery_zones_count":{"type":"number"}},"required":["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":true},"DeliveryRate":{"type":"object","properties":{"id":{"type":"string"},"delivery_method_id":{"type":"string"},"name":{"type":"string"},"selected":{"type":"boolean"},"cost":{"type":"string"},"total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"carrier":{"type":"string","nullable":true},"service_level":{"type":"string","nullable":true},"estimated_delivery_date":{"type":"string","nullable":true},"display_cost":{"type":"string"},"display_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":true},"DeliveryZoneMember":{"type":"object","properties":{"id":{"type":"string"},"member_type":{"type":"string"},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","state_name","created_at","updated_at"],"x-typelizer":true},"DeliveryZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZoneMember"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string"},"delivery_origin_group_id":{"type":"string","nullable":true},"delivery_method_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":true},"DigitalLink":{"type":"object","properties":{"id":{"type":"string"},"access_counter":{"type":"number"},"filename":{"type":"string"},"content_type":{"type":"string"},"download_url":{"type":"string"},"authorizable":{"type":"boolean"},"expired":{"type":"boolean"},"access_limit_exceeded":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","access_counter","filename","content_type","download_url","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":true},"Discount":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"code":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"value":{"type":"string","nullable":true},"promotion_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"ExchangeLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"original_price":{"type":"string"},"new_variant_price":{"type":"string"},"price_difference":{"type":"string"},"original_variant_id":{"type":"string","nullable":true},"new_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"original_variant":{"$ref":"#/components/schemas/Variant"},"new_variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"Exchange":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"price_difference":{"type":"string"},"display_price_difference":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"fulfilled_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"exchange_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id"],"x-typelizer":true},"Export":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"format":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"done":{"type":"boolean"},"filename":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"download_url":{"type":"string","nullable":true}},"required":["id","number","format","created_at","updated_at","type","user_id","done","filename","byte_size","download_url"],"x-typelizer":true},"Fee":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"FulfillmentItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"status":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":true},"Fulfillment":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"tracking":{"type":"string","nullable":true},"tracking_url":{"type":"string","nullable":true},"tracking_carrier":{"type":"string","nullable":true},"tracking_carrier_name":{"type":"string","nullable":true},"pickup_point_data":{"type":"object","nullable":true},"selected_delivery_rate_id":{"type":"string","nullable":true},"cost":{"type":"string"},"display_cost":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"status":{"type":"string"},"fulfillment_type":{"type":"string"},"fulfilled_at":{"type":"string","nullable":true},"tracking_status":{"type":"string","nullable":true},"estimated_delivery_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentManifestItem"}},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"delivery_rates":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryRate"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"metadata":{"type":"object"},"tracking_details":{"type":"object","nullable":true},"adjustment_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"documents":{"type":"object"},"provider_generates_labels":{"type":"boolean"},"fulfillment_items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentItem"}},"order":{"$ref":"#/components/schemas/Order"}},"required":["id","number","tracking","tracking_url","tracking_carrier","tracking_carrier_name","pickup_point_data","selected_delivery_rate_id","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","tracking_status","estimated_delivery_at","delivered_at","items","metadata","tracking_details","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","provider_generates_labels"],"x-typelizer":true},"GiftCardBatch":{"type":"object","properties":{"id":{"type":"string"},"codes_count":{"type":"number"},"currency":{"type":"string","nullable":true},"prefix":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true}},"required":["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":true},"GiftCard":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_authorized":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"expires_at":{"type":"string","nullable":true},"redeemed_at":{"type":"string","nullable":true},"expired":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/AdminUser"},"gift_card_batch":{"$ref":"#/components/schemas/GiftCardBatch"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}},"required":["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":true},"ImportMapping":{"type":"object","properties":{"id":{"type":"string"},"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true},"required":{"type":"boolean"}},"required":["id","schema_field","file_column","required"],"x-typelizer":true},"ImportRow":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"number"},"status":{"type":"string"},"validation_errors":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"import_id":{"type":"string","nullable":true},"item_type":{"type":"string","nullable":true},"item_id":{"type":"string","nullable":true},"data":{"type":"object"}},"required":["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":true},"Import":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"rows_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"status":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"processing_errors":{"type":"string","nullable":true},"preferred_delimiter":{"type":"string"},"original_filename":{"type":"string","nullable":true},"original_byte_size":{"type":"number","nullable":true},"original_file_url":{"type":"string","nullable":true},"completed_rows_count":{"type":"number"},"failed_rows_count":{"type":"number"},"schema_fields":{"type":"array","items":{"$ref":"#/components/schemas/ImportSchemaField"}},"csv_headers":{"type":"array","items":{"type":"string"}},"sample_row":{"type":"object"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ImportMapping"}}},"required":["id","number","rows_count","created_at","updated_at","type","status","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":true},"Integration":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"group":{"type":"string","nullable":true},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":true},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expires_at":{"type":"string"},"role_id":{"type":"string"},"role_name":{"type":"string"},"inviter_email":{"type":"string"},"acceptance_url":{"type":"string"},"invitee_exists":{"type":"boolean"},"store":{"type":"object"}},"required":["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":true},"LineItem":{"type":"object","properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"preorder":{"type":"boolean"},"preorder_ships_at":{"type":"string","nullable":true},"quantity":{"type":"number"},"currency":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"options_text":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"discounted_amount":{"type":"string"},"display_discounted_amount":{"type":"string"},"display_compare_at_amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"digital_links":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost_price":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"tax_category":{"$ref":"#/components/schemas/TaxCategory"}},"required":["id","variant_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","created_at","updated_at","cost_price","tax_category_id"],"x-typelizer":true},"Market":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"country_codes":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"tax_provider":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_codes","supported_locales","tax_provider","created_at","updated_at"],"x-typelizer":true},"Media":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string","nullable":true},"variant_ids":{"type":"array","items":{"type":"string"}},"position":{"type":"number"},"alt":{"type":"string","nullable":true},"media_type":{"type":"string"},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"external_video_url":{"type":"string","nullable":true},"original_url":{"type":"string","nullable":true},"mini_url":{"type":"string","nullable":true},"small_url":{"type":"string","nullable":true},"medium_url":{"type":"string","nullable":true},"large_url":{"type":"string","nullable":true},"xlarge_url":{"type":"string","nullable":true},"og_image_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"viewable_id":{"type":"string"},"download_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"viewable_type":{"type":"string"}},"required":["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","created_at","updated_at","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":true},"NewsletterSubscriber":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"verified":{"type":"boolean"},"verified_at":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true}},"required":["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":true},"OptionType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"kind":{"type":"string"},"translations":{"type":"object"},"metadata":{"type":"object"},"filterable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}}},"required":["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":true},"OptionValue":{"type":"object","properties":{"id":{"type":"string"},"option_type_id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"color_code":{"type":"string","nullable":true},"option_type_name":{"type":"string"},"option_type_label":{"type":"string"},"image_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_type":{"$ref":"#/components/schemas/OptionType"}},"required":["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":true},"OrderRoutingRule":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"channel_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Order":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"number":{"type":"string"},"email":{"type":"string"},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"coupon_code":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true},"payment_status":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"item_total":{"type":"string"},"display_item_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"gift_card_total":{"type":"string"},"display_gift_card_total":{"type":"string"},"amount_due":{"type":"string"},"display_amount_due":{"type":"string"},"delivery_total":{"type":"string"},"display_delivery_total":{"type":"string"},"fee_total":{"type":"string"},"display_fee_total":{"type":"string"},"store_credit_total":{"type":"string"},"display_store_credit_total":{"type":"string"},"covered_by_store_credit":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"fulfillments":{"type":"array","items":{"$ref":"#/components/schemas/Fulfillment"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"gift_card":{"allOf":[{"$ref":"#/components/schemas/GiftCard"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"status":{"type":"string"},"last_ip_address":{"type":"string","nullable":true},"considered_risky":{"type":"boolean"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"payment_total":{"type":"string"},"display_payment_total":{"type":"string"},"metadata":{"type":"object"},"canceled_at":{"type":"string","nullable":true},"approved_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferred_stock_location_id":{"type":"string","nullable":true},"company_location_id":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"internal_note_html":{"type":"string","nullable":true},"approver_id":{"type":"string","nullable":true},"canceler_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}},"cart":{"$ref":"#/components/schemas/Cart"},"channel":{"$ref":"#/components/schemas/Channel"},"preferred_stock_location":{"$ref":"#/components/schemas/StockLocation"},"payment_methods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"customer":{"$ref":"#/components/schemas/Customer"},"approver":{"$ref":"#/components/schemas/Customer"},"canceler":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/Customer"},"returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"exchanges":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}}},"required":["id","market_id","cart_id","channel_id","number","email","customer_note","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","company_location_id","company_id","tags","internal_note","internal_note_html","approver_id","canceler_id","created_by_id","customer_id"],"x-typelizer":true},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"session_required":{"type":"boolean"},"source_required":{"type":"boolean"},"metadata":{"type":"object"},"active":{"type":"boolean"},"auto_capture":{"type":"boolean","nullable":true},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"nullable":true},"resolved_capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"]},"storefront_visible":{"type":"boolean"},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","description","type","session_required","source_required","metadata","active","auto_capture","capture_method","resolved_capture_method","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":true},"Payment":{"type":"object","properties":{"id":{"type":"string"},"payment_method_id":{"type":"string"},"response_code":{"type":"string","nullable":true},"number":{"type":"string"},"amount":{"type":"string"},"display_amount":{"type":"string"},"status":{"type":"string"},"source_type":{"type":"string","nullable":true,"enum":["credit_card","store_credit","payment_source"]},"source_id":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/CreditCard"},{"$ref":"#/components/schemas/StoreCredit"},{"$ref":"#/components/schemas/PaymentSource"}],"nullable":true},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"metadata":{"type":"object"},"avs_response":{"type":"string","nullable":true},"cvv_response_code":{"type":"string","nullable":true},"cvv_response_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"captured_amount":{"type":"string"},"order_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","payment_method_id","response_code","number","amount","display_amount","status","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":true},"PaymentSource":{"type":"object","properties":{"id":{"type":"string"},"gateway_payment_profile_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":true},"Permission":{"type":"object","properties":{"key":{"type":"string"},"resource":{"type":"string"},"kind":{"type":"string"},"group":{"type":"string"},"group_label":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","resource","kind","group","group_label","label","description"],"x-typelizer":true},"PriceHistory":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_in_cents":{"type":"number"},"currency":{"type":"string"},"display_amount":{"type":"string"},"recorded_at":{"type":"string"},"variant_id":{"type":"string"},"price_id":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":true},"PriceList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string"},"position":{"type":"number"},"match_policy":{"type":"string"},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"currently_active":{"type":"boolean"},"products_count":{"type":"number"},"prices_count":{"type":"number"},"product_ids":{"type":"array","items":{"type":"string"}},"price_rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceRule"}}},"required":["id","name","description","status","position","match_policy","starts_at","ends_at","deleted_at","created_at","updated_at","currently_active","products_count","prices_count","product_ids"],"x-typelizer":true},"PriceRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"price_list_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"description":{"type":"string","nullable":true},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","created_at","updated_at","type","price_list_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Price":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string","nullable":true},"amount_in_cents":{"type":"number","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"compare_at_amount_in_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"display_amount":{"type":"string","nullable":true},"display_compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","variant_id","created_at","updated_at"],"x-typelizer":true},"ProductPublication":{"type":"object","properties":{"id":{"type":"string"},"published_at":{"type":"string","nullable":true},"unpublished_at":{"type":"string","nullable":true},"product_id":{"type":"string"},"channel_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":true},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"variant_count":{"type":"number"},"available_on":{"type":"string","nullable":true},"preorder_ships_at":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"preorder":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"available":{"type":"boolean"},"description":{"type":"string","nullable":true},"description_html":{"type":"string","nullable":true},"default_variant_id":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"default_variant":{"$ref":"#/components/schemas/Variant"},"option_types":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"translations":{"type":"object"},"status":{"type":"string"},"metadata":{"type":"object"},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"product_type_id":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"collections":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"product_publications":{"type":"array","items":{"$ref":"#/components/schemas/ProductPublication"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"product_type":{"$ref":"#/components/schemas/ProductType"}},"required":["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","thumbnail_url","tags","price","original_price","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","product_type_id","tax_category_id"],"x-typelizer":true},"ProductTypeCustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"namespace":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"required":{"type":"boolean"},"sort_order":{"type":"number"}},"required":["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":true},"ProductType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"translations":{"type":"object"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"$ref":"#/components/schemas/ProductTypeCustomFieldDefinition"}}},"required":["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":true},"PromotionAction":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculator"}],"nullable":true},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItem"},"nullable":true}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","calculator","line_items"],"x-typelizer":true},"PromotionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"product_ids":{"type":"array","items":{"type":"string"},"nullable":true},"category_ids":{"type":"array","items":{"type":"string"},"nullable":true},"customer_ids":{"type":"array","items":{"type":"string"},"nullable":true},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","product_ids","category_ids","customer_ids"],"x-typelizer":true},"Promotion":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"usage_limit":{"type":"number","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"path":{"type":"string","nullable":true},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"number","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"action_ids":{"type":"array","items":{"type":"string"}},"rule_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":true},"RefundReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Refund":{"type":"object","properties":{"id":{"type":"string"},"transaction_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"payment_id":{"type":"string","nullable":true},"refund_reason_id":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true},"originator_type":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at"],"x-typelizer":true},"ReturnLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"line_item":{"$ref":"#/components/schemas/LineItem"}},"required":["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"ReturnReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Return":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"refunded_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"return_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ReturnLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"refunded_total":{"type":"string"},"refundable_total":{"type":"string"},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","refund_total","display_refund_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","refunded_total","refundable_total"],"x-typelizer":true},"Role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"mutable":{"type":"boolean"},"users_count":{"type":"number"}},"required":["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":true},"SetupTask":{"type":"object","properties":{"name":{"type":"string"},"done":{"type":"boolean"}},"required":["name","done"],"x-typelizer":true},"State":{"type":"object","properties":{"abbr":{"type":"string"},"name":{"type":"string"}},"required":["abbr","name"],"x-typelizer":true},"StockItem":{"type":"object","properties":{"id":{"type":"string"},"count_on_hand":{"type":"number"},"backorderable":{"type":"boolean"},"stock_location_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"allocated_count":{"type":"number"},"available_count":{"type":"number"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","count_on_hand","backorderable","stock_location_id","variant_id","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":true},"StockLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"address1":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_text":{"type":"string","nullable":true},"pickup_ready_in_minutes":{"type":"number","nullable":true},"pickup_instructions":{"type":"string","nullable":true},"admin_name":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"propagate_all_variants":{"type":"boolean"},"kind":{"type":"string"},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","created_at","updated_at"],"x-typelizer":true},"StockReservation":{"type":"object","properties":{"id":{"type":"string"},"stock_item_id":{"type":"string"},"line_item_id":{"type":"string"},"order_id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"quantity":{"type":"number"},"expires_at":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","stock_item_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":true},"StockTransfer":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source_location_id":{"type":"string","nullable":true},"destination_location_id":{"type":"string","nullable":true},"source_location":{"$ref":"#/components/schemas/StockLocation"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","reference","metadata","created_at","updated_at","source_location_id","destination_location_id"],"x-typelizer":true},"StoreCreditCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"non_expiring":{"type":"boolean"}},"required":["id","name","created_at","updated_at","non_expiring"],"x-typelizer":true},"StoreCredit":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"currency":{"type":"string"},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","nullable":true}},"required":["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","customer_id","created_by_id","category_id","category_name"],"x-typelizer":true},"Store":{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object"},"name":{"type":"string"},"code":{"type":"string"},"preferred_storefront_url":{"type":"string","nullable":true},"default_currency":{"type":"string"},"default_locale":{"type":"string"},"mail_from_address":{"type":"string","nullable":true},"customer_support_email":{"type":"string","nullable":true},"new_order_notifications_email":{"type":"string","nullable":true},"preferred_send_consumer_transactional_emails":{"type":"boolean"},"preferred_admin_locale":{"type":"string","nullable":true},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_default_package_weight":{"type":"number"},"preferred_default_package_length":{"type":"number"},"preferred_default_package_width":{"type":"number"},"preferred_default_package_height":{"type":"number"},"preferred_unit_system":{"type":"string"},"preferred_storefront_access":{"type":"string"},"preferred_guest_checkout":{"type":"boolean"},"preferred_company_field_enabled":{"type":"boolean"},"preferred_address_requires_company":{"type":"boolean"},"preferred_address_requires_phone":{"type":"boolean"},"preferred_capture_method":{"type":"string"},"preferred_track_inventory_levels":{"type":"boolean"},"preferred_stock_reservations_enabled":{"type":"boolean"},"preferred_track_price_history":{"type":"boolean"},"preferred_show_products_without_price":{"type":"boolean"},"preferred_disable_sku_validation":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string"},"preferred_document_number_format":{"type":"string"},"preferred_order_number_prefix":{"type":"string"},"preferred_order_number_suffix":{"type":"string"},"preferred_order_number_sequence_start":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_number_sequence_started":{"type":"boolean"},"url":{"type":"string"},"api_url":{"type":"string"},"setup_tasks":{"type":"array","items":{"$ref":"#/components/schemas/SetupTask"}},"supported_currencies":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"available_locales":{"type":"array","items":{"type":"string"}},"logo_url":{"type":"string","nullable":true},"mailer_logo_url":{"type":"string","nullable":true}},"required":["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_default_package_weight","preferred_default_package_length","preferred_default_package_width","preferred_default_package_height","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_order_routing_strategy","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","created_at","updated_at","order_number_sequence_started","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":true},"TaxCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tax_code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":true},"TaxExemptionCertificate":{"type":"object","properties":{"id":{"type":"string"},"certificate_number":{"type":"string"},"reason_code":{"type":"string"},"status":{"type":"string"},"issuing_authority":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"verified_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_id":{"type":"string"},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"active":{"type":"boolean"},"lapsed":{"type":"boolean"},"can_be_deleted":{"type":"boolean"},"document_filename":{"type":"string","nullable":true},"document_byte_size":{"type":"number","nullable":true},"document_url":{"type":"string","nullable":true}},"required":["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":true},"TaxIdentifier":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"value":{"type":"string"},"validation_status":{"type":"string","nullable":true},"validation_evidence":{"type":"object","nullable":true},"source":{"type":"string","nullable":true},"validated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"validatable":{"type":"boolean"},"customer_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true}},"required":["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"x-typelizer":true},"TaxLine":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"included":{"type":"boolean"},"rate":{"type":"string"},"tax_rate_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"fee_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"provider_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"taxability_reason":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"data":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","included","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","amount","display_amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at"],"x-typelizer":true},"TaxRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"amount":{"type":"string"},"amount_percentage":{"type":"number","nullable":true},"tax_category_id":{"type":"string","nullable":true},"store_id":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true}},"required":["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"x-typelizer":true},"Variant":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"sku":{"type":"string","nullable":true},"options_text":{"type":"string"},"track_inventory":{"type":"boolean"},"media_count":{"type":"number"},"preorder_ships_at":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"preorder":{"type":"boolean"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"price":{"$ref":"#/components/schemas/Price"},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"metadata":{"type":"object"},"position":{"type":"number"},"cost_price":{"type":"string","nullable":true},"cost_currency":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"weight_unit":{"type":"string","nullable":true},"dimensions_unit":{"type":"string","nullable":true},"backorder_limit":{"type":"number","nullable":true},"hs_code":{"type":"string","nullable":true},"country_of_origin":{"type":"string","nullable":true},"customs_description":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preorderable":{"type":"boolean"},"tax_category_id":{"type":"string","nullable":true},"available_stock":{"type":"number","nullable":true},"reserved_quantity":{"type":"number"},"total_on_hand":{"type":"number","nullable":true},"product_name":{"type":"string"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"stock_items":{"type":"array","items":{"$ref":"#/components/schemas/StockItem"}}},"required":["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","price","original_price","option_values","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","backorder_limit","hs_code","country_of_origin","customs_description","deleted_at","created_at","updated_at","preorderable","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name"],"x-typelizer":true},"Vendor":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"tax_remittance":{"type":"string"},"payouts_schedule_interval":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"holiday_mode_until":{"type":"string","nullable":true},"terms_accepted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"minimum_payout_amount":{"type":"string","nullable":true},"about":{"type":"string"},"about_html":{"type":"string"},"logo_url":{"type":"string","nullable":true},"square_logo_url":{"type":"string","nullable":true},"cover_photo_url":{"type":"string","nullable":true},"on_holiday":{"type":"boolean"},"sellable":{"type":"boolean"},"products_count":{"type":"number"},"users_count":{"type":"number"},"billing_address":{"$ref":"#/components/schemas/Address"},"returns_address":{"$ref":"#/components/schemas/Address"}},"required":["id","name","slug","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","about","about_html","logo_url","square_logo_url","cover_photo_url","on_holiday","sellable","products_count","users_count"],"x-typelizer":true},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_name":{"type":"string"},"event_id":{"type":"string","nullable":true},"response_code":{"type":"number","nullable":true},"execution_time":{"type":"number","nullable":true},"error_type":{"type":"string","nullable":true},"request_errors":{"type":"string","nullable":true},"response_body":{"type":"string","nullable":true},"success":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivered_at":{"type":"string","nullable":true},"payload":{"type":"object"},"webhook_endpoint_id":{"type":"string"},"webhook_endpoint_url":{"type":"string"}},"required":["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":true},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}},"disabled_reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"disabled_at":{"type":"string","nullable":true},"secret_key":{"type":"string","nullable":true},"last_delivery_at":{"type":"string","nullable":true},"recent_delivery_count":{"type":"number"},"recent_failure_count":{"type":"number"},"total_delivery_count":{"type":"number"},"successful_delivery_count":{"type":"number"},"failed_delivery_count":{"type":"number"}},"required":["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":true}}}}\ No newline at end of filediff --git a/packages/cli/src/generated/resource-paths.json b/packages/cli/src/generated/resource-paths.jsonindex dcea9fcecf..69d890f7d2 100644--- a/packages/cli/src/generated/resource-paths.json+++ b/packages/cli/src/generated/resource-paths.json@@ -1 +1 @@-["/admin_users","/allowed_origins","/api_keys","/auth","/categories","/channels","/collection_rules","/collections","/companies","/company_contacts","/company_locations","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/option_types","/order_routing_rules","/orders","/payment_methods","/permissions","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/roles","/stock_locations","/store","/store_credit_categories","/tags","/tax_rates","/translatable_resources","/translations","/webhook_endpoints"]\ No newline at end of file+["/admin_users","/allowed_origins","/api_keys","/auth","/categories","/channels","/collection_rules","/collections","/companies","/company_contacts","/company_locations","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/option_types","/order_routing_rules","/orders","/payment_methods","/permissions","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/roles","/stock_locations","/store","/store_credit_categories","/tags","/tax_rates","/translatable_resources","/translations","/vendors","/webhook_endpoints"]\ No newline at end of filediff --git a/packages/dashboard-core/src/lib/permissions.ts b/packages/dashboard-core/src/lib/permissions.tsindex 248116249c..d7c06c7430 100644--- a/packages/dashboard-core/src/lib/permissions.ts+++ b/packages/dashboard-core/src/lib/permissions.ts@@ -58,6 +58,7 @@ export const Subject = {WebhookEndpoint: 'Spree::WebhookEndpoint',WebhookDelivery: 'Spree::WebhookDelivery',Wishlist: 'Spree::Wishlist',+ Vendor: 'Spree::Vendor',} as constexport type SubjectName = (typeof Subject)[keyof typeof Subject] | stringdiff --git a/packages/dashboard-core/src/locales/ar.json b/packages/dashboard-core/src/locales/ar.jsonindex f2dd551bf6..307a20db96 100644--- a/packages/dashboard-core/src/locales/ar.json+++ b/packages/dashboard-core/src/locales/ar.json@@ -365,6 +365,9 @@},"number": {"label": "الرقم"+ },+ "contact_email": {+ "label": "البريد الإلكتروني للتواصل"}},"components": {diff --git a/packages/dashboard-core/src/locales/de.json b/packages/dashboard-core/src/locales/de.jsonindex dad13ff496..1d5b73d5c9 100644--- a/packages/dashboard-core/src/locales/de.json+++ b/packages/dashboard-core/src/locales/de.json@@ -365,6 +365,9 @@},"number": {"label": "Nummer"+ },+ "contact_email": {+ "label": "Kontakt-E-Mail"}},"components": {diff --git a/packages/dashboard-core/src/locales/en.json b/packages/dashboard-core/src/locales/en.jsonindex daba533a51..baf5bbdcf6 100644--- a/packages/dashboard-core/src/locales/en.json+++ b/packages/dashboard-core/src/locales/en.json@@ -365,6 +365,9 @@},"number": {"label": "Number"+ },+ "contact_email": {+ "label": "Contact email"}},"components": {diff --git a/packages/dashboard-core/src/locales/fr.json b/packages/dashboard-core/src/locales/fr.jsonindex c496e2fa79..5c457308d0 100644--- a/packages/dashboard-core/src/locales/fr.json+++ b/packages/dashboard-core/src/locales/fr.json@@ -365,6 +365,9 @@},"number": {"label": "Numéro"+ },+ "contact_email": {+ "label": "E-mail de contact"}},"components": {diff --git a/packages/dashboard-core/src/locales/pl.json b/packages/dashboard-core/src/locales/pl.jsonindex c7de2b3152..7bbe3a0873 100644--- a/packages/dashboard-core/src/locales/pl.json+++ b/packages/dashboard-core/src/locales/pl.json@@ -365,6 +365,9 @@},"number": {"label": "Numer"+ },+ "contact_email": {+ "label": "E-mail kontaktowy"}},"components": {diff --git a/packages/dashboard-core/src/locales/zh-CN.json b/packages/dashboard-core/src/locales/zh-CN.jsonindex e44b4d588f..de681b51ae 100644--- a/packages/dashboard-core/src/locales/zh-CN.json+++ b/packages/dashboard-core/src/locales/zh-CN.json@@ -365,6 +365,9 @@},"number": {"label": "编号"+ },+ "contact_email": {+ "label": "联系邮箱"}},"components": {diff --git a/packages/dashboard-starter/src/routeTree.gen.ts b/packages/dashboard-starter/src/routeTree.gen.tsindex 743953fe57..5cd10791dd 100644--- a/packages/dashboard-starter/src/routeTree.gen.ts+++ b/packages/dashboard-starter/src/routeTree.gen.ts@@ -24,6 +24,7 @@ import { Route as GettingStartedRouteImport } from './../../dashboard/src/routesimport { Route as ExchangesRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/exchanges'import { Route as ClaimsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/claims'import { Route as SplatRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/$'+import { Route as VendorsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/vendors/index'import { Route as SettingsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/index'import { Route as PromotionsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/promotions/index'import { Route as ProductsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/index'@@ -31,6 +32,7 @@ import { Route as OrdersIndexRouteImport } from './../../dashboard/src/routes/_aimport { Route as CustomersIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/customers/index'import { Route as CompaniesIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/companies/index'import { Route as BrandsDotindexRouteImport } from './../../dashboard-plugin-example/src/routes/brands.index'+import { Route as VendorsVendorIdRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/vendors/$vendorId'import { Route as SettingsTaxRatesRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/tax-rates'import { Route as SettingsTaxCategoriesRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/tax-categories'import { Route as SettingsStoreRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/store'@@ -155,6 +157,11 @@ const SplatRoute = SplatRouteImport.update({path: '/$',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const VendorsIndexRoute = VendorsIndexRouteImport.update({+ id: '/vendors/',+ path: '/vendors/',+ getParentRoute: () => authenticatedStoreIdRoute,+} as any)const SettingsIndexRoute = SettingsIndexRouteImport.update({id: '/',path: '/',@@ -190,6 +197,11 @@ const BrandsDotindexRoute = BrandsDotindexRouteImport.update({path: '/brands/',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const VendorsVendorIdRoute = VendorsVendorIdRouteImport.update({+ id: '/vendors/$vendorId',+ path: '/vendors/$vendorId',+ getParentRoute: () => authenticatedStoreIdRoute,+} as any)const SettingsTaxRatesRoute = SettingsTaxRatesRouteImport.update({id: '/tax-rates',path: '/tax-rates',@@ -486,6 +498,7 @@ export interface FileRoutesByFullPath {'/$storeId/settings/store': typeof SettingsStoreRoute'/$storeId/settings/tax-categories': typeof SettingsTaxCategoriesRoute'/$storeId/settings/tax-rates': typeof SettingsTaxRatesRoute+ '/$storeId/vendors/$vendorId': typeof VendorsVendorIdRoute'/$storeId/brands/': typeof BrandsDotindexRoute'/$storeId/companies/': typeof CompaniesIndexRoute'/$storeId/customers/': typeof CustomersIndexRoute@@ -493,6 +506,7 @@ export interface FileRoutesByFullPath {'/$storeId/products/': typeof ProductsIndexRoute'/$storeId/promotions/': typeof PromotionsIndexRoute'/$storeId/settings/': typeof SettingsIndexRoute+ '/$storeId/vendors/': typeof VendorsIndexRoute'/$storeId/companies/locations/$locationId': typeof CompaniesLocationsDotlocationIdRoute'/$storeId/orders/$orderId/edit': typeof OrdersOrderIdEditRoute'/$storeId/products/categories/$categoryId': typeof ProductsCategoriesCategoryIdRoute@@ -555,6 +569,7 @@ export interface FileRoutesByTo {'/$storeId/settings/store': typeof SettingsStoreRoute'/$storeId/settings/tax-categories': typeof SettingsTaxCategoriesRoute'/$storeId/settings/tax-rates': typeof SettingsTaxRatesRoute+ '/$storeId/vendors/$vendorId': typeof VendorsVendorIdRoute'/$storeId/brands': typeof BrandsDotindexRoute'/$storeId/companies': typeof CompaniesIndexRoute'/$storeId/customers': typeof CustomersIndexRoute@@ -562,6 +577,7 @@ export interface FileRoutesByTo {'/$storeId/products': typeof ProductsIndexRoute'/$storeId/promotions': typeof PromotionsIndexRoute'/$storeId/settings': typeof SettingsIndexRoute+ '/$storeId/vendors': typeof VendorsIndexRoute'/$storeId/companies/locations/$locationId': typeof CompaniesLocationsDotlocationIdRoute'/$storeId/orders/$orderId/edit': typeof OrdersOrderIdEditRoute'/$storeId/products/categories/$categoryId': typeof ProductsCategoriesCategoryIdRoute@@ -628,6 +644,7 @@ export interface FileRoutesById {'/_authenticated/$storeId/settings/store': typeof SettingsStoreRoute'/_authenticated/$storeId/settings/tax-categories': typeof SettingsTaxCategoriesRoute'/_authenticated/$storeId/settings/tax-rates': typeof SettingsTaxRatesRoute+ '/_authenticated/$storeId/vendors/$vendorId': typeof VendorsVendorIdRoute'/_authenticated/$storeId/brands/': typeof BrandsDotindexRoute'/_authenticated/$storeId/companies/': typeof CompaniesIndexRoute'/_authenticated/$storeId/customers/': typeof CustomersIndexRoute@@ -635,6 +652,7 @@ export interface FileRoutesById {'/_authenticated/$storeId/products/': typeof ProductsIndexRoute'/_authenticated/$storeId/promotions/': typeof PromotionsIndexRoute'/_authenticated/$storeId/settings/': typeof SettingsIndexRoute+ '/_authenticated/$storeId/vendors/': typeof VendorsIndexRoute'/_authenticated/$storeId/companies/locations/$locationId': typeof CompaniesLocationsDotlocationIdRoute'/_authenticated/$storeId/orders/$orderId/edit': typeof OrdersOrderIdEditRoute'/_authenticated/$storeId/products/categories/$categoryId': typeof ProductsCategoriesCategoryIdRoute@@ -701,6 +719,7 @@ export interface FileRouteTypes {| '/$storeId/settings/store'| '/$storeId/settings/tax-categories'| '/$storeId/settings/tax-rates'+ | '/$storeId/vendors/$vendorId'| '/$storeId/brands/'| '/$storeId/companies/'| '/$storeId/customers/'@@ -708,6 +727,7 @@ export interface FileRouteTypes {| '/$storeId/products/'| '/$storeId/promotions/'| '/$storeId/settings/'+ | '/$storeId/vendors/'| '/$storeId/companies/locations/$locationId'| '/$storeId/orders/$orderId/edit'| '/$storeId/products/categories/$categoryId'@@ -770,6 +790,7 @@ export interface FileRouteTypes {| '/$storeId/settings/store'| '/$storeId/settings/tax-categories'| '/$storeId/settings/tax-rates'+ | '/$storeId/vendors/$vendorId'| '/$storeId/brands'| '/$storeId/companies'| '/$storeId/customers'@@ -777,6 +798,7 @@ export interface FileRouteTypes {| '/$storeId/products'| '/$storeId/promotions'| '/$storeId/settings'+ | '/$storeId/vendors'| '/$storeId/companies/locations/$locationId'| '/$storeId/orders/$orderId/edit'| '/$storeId/products/categories/$categoryId'@@ -842,6 +864,7 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/settings/store'| '/_authenticated/$storeId/settings/tax-categories'| '/_authenticated/$storeId/settings/tax-rates'+ | '/_authenticated/$storeId/vendors/$vendorId'| '/_authenticated/$storeId/brands/'| '/_authenticated/$storeId/companies/'| '/_authenticated/$storeId/customers/'@@ -849,6 +872,7 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/products/'| '/_authenticated/$storeId/promotions/'| '/_authenticated/$storeId/settings/'+ | '/_authenticated/$storeId/vendors/'| '/_authenticated/$storeId/companies/locations/$locationId'| '/_authenticated/$storeId/orders/$orderId/edit'| '/_authenticated/$storeId/products/categories/$categoryId'@@ -986,6 +1010,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof SplatRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/vendors/': {+ id: '/_authenticated/$storeId/vendors/'+ path: '/vendors'+ fullPath: '/$storeId/vendors/'+ preLoaderRoute: typeof VendorsIndexRouteImport+ parentRoute: typeof authenticatedStoreIdRoute+ }'/_authenticated/$storeId/settings/': {id: '/_authenticated/$storeId/settings/'path: '/'@@ -1035,6 +1066,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof BrandsDotindexRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/vendors/$vendorId': {+ id: '/_authenticated/$storeId/vendors/$vendorId'+ path: '/vendors/$vendorId'+ fullPath: '/$storeId/vendors/$vendorId'+ preLoaderRoute: typeof VendorsVendorIdRouteImport+ parentRoute: typeof authenticatedStoreIdRoute+ }'/_authenticated/$storeId/settings/tax-rates': {id: '/_authenticated/$storeId/settings/tax-rates'path: '/tax-rates'@@ -1457,12 +1495,14 @@ interface authenticatedStoreIdRouteChildren {PromotionsPromotionIdRoute: typeof PromotionsPromotionIdRoutePromotionsGiftCardsRoute: typeof PromotionsGiftCardsRoutePromotionsNewRoute: typeof PromotionsNewRoute+ VendorsVendorIdRoute: typeof VendorsVendorIdRouteBrandsDotindexRoute: typeof BrandsDotindexRouteCompaniesIndexRoute: typeof CompaniesIndexRouteCustomersIndexRoute: typeof CustomersIndexRouteOrdersIndexRoute: typeof OrdersIndexRouteProductsIndexRoute: typeof ProductsIndexRoutePromotionsIndexRoute: typeof PromotionsIndexRoute+ VendorsIndexRoute: typeof VendorsIndexRouteCompaniesLocationsDotlocationIdRoute: typeof CompaniesLocationsDotlocationIdRouteOrdersOrderIdEditRoute: typeof OrdersOrderIdEditRouteProductsCategoriesCategoryIdRoute: typeof ProductsCategoriesCategoryIdRoute@@ -1498,12 +1538,14 @@ const authenticatedStoreIdRouteChildren: authenticatedStoreIdRouteChildren = {PromotionsPromotionIdRoute: PromotionsPromotionIdRoute,PromotionsGiftCardsRoute: PromotionsGiftCardsRoute,PromotionsNewRoute: PromotionsNewRoute,+ VendorsVendorIdRoute: VendorsVendorIdRoute,BrandsDotindexRoute: BrandsDotindexRoute,CompaniesIndexRoute: CompaniesIndexRoute,CustomersIndexRoute: CustomersIndexRoute,OrdersIndexRoute: OrdersIndexRoute,ProductsIndexRoute: ProductsIndexRoute,PromotionsIndexRoute: PromotionsIndexRoute,+ VendorsIndexRoute: VendorsIndexRoute,CompaniesLocationsDotlocationIdRoute: CompaniesLocationsDotlocationIdRoute,OrdersOrderIdEditRoute: OrdersOrderIdEditRoute,ProductsCategoriesCategoryIdRoute: ProductsCategoriesCategoryIdRoute,diff --git a/packages/dashboard-ui/src/ui/badge.tsx b/packages/dashboard-ui/src/ui/badge.tsxindex 292343d6b9..8c4e75d144 100644--- a/packages/dashboard-ui/src/ui/badge.tsx+++ b/packages/dashboard-ui/src/ui/badge.tsx@@ -96,6 +96,10 @@ const statusVariantMap: Record<string, VariantProps<typeof badgeVariants>['variabalance_due: 'warning',credit_owed: 'warning',canceled: 'destructive',+ suspended: 'destructive',+ invited: 'info',+ onboarding: 'warning',+ ready_for_review: 'warning',failed: 'destructive',void: 'destructive',error: 'destructive',diff --git a/packages/dashboard/e2e/vendors.spec.ts b/packages/dashboard/e2e/vendors.spec.tsnew file mode 100644index 0000000000..43e2ccf108--- /dev/null+++ b/packages/dashboard/e2e/vendors.spec.ts@@ -0,0 +1,175 @@+import { expect, type Page, test } from '@playwright/test'+import { escapeRegex, gotoIndex, login, openRowMenu } from './helpers'++const VENDORS_PATH = (storeId: string) => `/${storeId}/vendors`+const CTA = /add vendor/i++/** The vendor name cell is a link to the detail page, not a sheet trigger. */+function rowLink(page: Page, name: string) {+ return page.getByRole('link', { name: new RegExp(`^${escapeRegex(name)}$`) })+}++/** Scopes an Edit button to its own card — the page has more than one. */+function cardEdit(page: Page, title: RegExp) {+ return page+ .locator('[data-slot="card"]')+ .filter({ has: page.getByText(title) })+ .getByRole('button', { name: /^edit$/i })+}++/** Creating a vendor lands on its profile page. */+async function createVendor(page: Page, name: string) {+ await page.getByRole('button', { name: CTA }).click()+ await expect(page.getByRole('heading', { name: /new vendor/i })).toBeVisible()++ await page.locator('#name').fill(name)+ await page.getByRole('button', { name: /create vendor/i }).click()++ await expect(page.getByRole('heading', { name })).toBeVisible({ timeout: 15_000 })+}++test.describe('vendors', () => {+ test('lists vendors', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)+ })++ // The page is a profile you read, not a form you land in.+ test('shows the profile without dropping into an edit form', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ const name = `E2E Vendor ${Date.now()}`+ await createVendor(page, name)++ await expect(page.getByText(/^pending$/i).first()).toBeVisible()+ await expect(page.getByText(/at a glance/i)).toBeVisible()+ // Nothing is editable until an Edit button is pressed.+ await expect(page.locator('#vendor-name')).toHaveCount(0)+ await expect(page.locator('#minimum_payout_amount')).toHaveCount(0)++ // Nobody has been invited yet, so inviting is the only move offered.+ await expect(page.getByRole('button', { name: /^invite$/i })).toBeVisible()+ await expect(page.getByRole('button', { name: /^approve$/i })).toHaveCount(0)+ })++ test('shows placeholders for details the vendor has not filled in', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ await createVendor(page, `E2E Blank Vendor ${Date.now()}`)++ await expect(page.getByText(/has not written a description/i)).toBeVisible()+ await expect(page.getByText(/not provided/i).first()).toBeVisible()+ })++ test('invites someone to run the vendor', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ const name = `E2E Invite Vendor ${Date.now()}`+ await createVendor(page, name)++ await page.getByRole('button', { name: /^invite$/i }).click()+ await expect(page.getByRole('heading', { name: /invite vendor/i })).toBeVisible()++ await page.locator('#invite-email').fill(`seller-${Date.now()}@example.com`)+ await page.getByRole('button', { name: /send invitation/i }).click()++ await expect(page.getByText(/^invited$/i).first()).toBeVisible({ timeout: 15_000 })+ // Re-inviting stays available; a vendor waiting to accept can be chased.+ await expect(page.getByRole('button', { name: /send again/i })).toBeVisible()+ })++ test('edits the profile through its sheet', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ const name = `E2E Profile Vendor ${Date.now()}`+ await createVendor(page, name)++ await page+ .getByRole('button', { name: /^edit$/i })+ .first()+ .click()+ await expect(page.getByRole('heading', { name: /edit profile/i })).toBeVisible()++ await page.locator('#vendor-contact-email').fill('[email protected]')+ await page.getByRole('button', { name: /^save$/i }).click()++ // Back to the read view, showing the new value.+ await expect(page.getByRole('heading', { name: /edit profile/i })).toHaveCount(0, {+ timeout: 15_000,+ })+ await expect(page.getByText('[email protected]').first()).toBeVisible({ timeout: 15_000 })+ })++ test('edits the payout settings through their own sheet', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ const name = `E2E Payout Vendor ${Date.now()}`+ await createVendor(page, name)++ await cardEdit(page, /payouts and tax/i).click()+ await expect(page.getByRole('heading', { name: /edit payouts and tax/i })).toBeVisible()++ await page.locator('#payouts_schedule_interval').click()+ await page.getByRole('option', { name: /^weekly$/i }).click()+ await page.locator('#minimum_payout_amount').fill('25.0')+ await page.getByRole('button', { name: /^save$/i }).click()++ await expect(page.getByRole('heading', { name: /edit payouts and tax/i })).toHaveCount(0, {+ timeout: 15_000,+ })+ await expect(page.getByText(/^weekly$/i).first()).toBeVisible({ timeout: 15_000 })+ await expect(page.getByText('25.0')).toBeVisible()+ })++ // Each sheet sends only its own fields, so saving one must not roll back+ // what the other just wrote.+ test('saving the profile leaves the payout settings alone', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ const name = `E2E Isolation Vendor ${Date.now()}`+ await createVendor(page, name)++ await cardEdit(page, /payouts and tax/i).click()+ await page.locator('#minimum_payout_amount').fill('40.0')+ await page.getByRole('button', { name: /^save$/i }).click()+ await expect(page.getByText('40.0')).toBeVisible({ timeout: 15_000 })++ await page+ .getByRole('button', { name: /^edit$/i })+ .first()+ .click()+ await page.locator('#vendor-billing-email').fill('[email protected]')+ await page.getByRole('button', { name: /^save$/i }).click()++ await page.reload()+ await expect(page.getByText('[email protected]').first()).toBeVisible({ timeout: 15_000 })+ await expect(page.getByText('40.0')).toBeVisible()+ })++ test('deletes a vendor from the list', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, VENDORS_PATH(creds.store_id), CTA)++ const name = `E2E Delete Vendor ${Date.now()}`+ await createVendor(page, name)++ await page.goto(VENDORS_PATH(creds.store_id))+ await expect(rowLink(page, name)).toBeVisible({ timeout: 15_000 })++ await openRowMenu(page, name)+ await page.getByRole('menuitem', { name: /^delete$/i }).click()+ await expect(page.getByRole('heading', { name: /delete vendor\?/i })).toBeVisible()+ await page+ .getByRole('dialog')+ .getByRole('button', { name: /^delete$/i })+ .click()++ await expect(rowLink(page, name)).toHaveCount(0, { timeout: 15_000 })+ })+})diff --git a/packages/dashboard/src/components/spree/resource-image-field.tsx b/packages/dashboard/src/components/spree/resource-image-field.tsxindex 523efa13cd..aef9af19d1 100644--- a/packages/dashboard/src/components/spree/resource-image-field.tsx+++ b/packages/dashboard/src/components/spree/resource-image-field.tsx@@ -5,59 +5,85 @@ import { useTranslation } from 'react-i18next'/*** The form fields backing one image: a freshly direct-uploaded blob- * (`*_signed_id`), a transient object URL for the just-picked file- * (`*_preview_url`), and a flag marking the persisted attachment for removal- * (`*_cleared`). Together they form the three-state machine the API expects —- * see the `imageParam` mapper in the schema files.+ * (`<name>_signed_id`), a transient object URL for the just-picked file+ * (`<name>_preview_url`), and a flag marking the persisted attachment for+ * removal (`<name>_cleared`). Together they form the three-state machine the+ * API expects — see the `imageParam` mapper in the schema files.+ *+ * The triple is keyed by the attachment's own name, so a resource carrying+ * `logo`/`cover_photo` composes exactly like one carrying `image`.*/-export interface ImageFieldsShape {+export type ImageFieldsFor<Name extends string> = {+ [K in `${Name}_signed_id` | `${Name}_preview_url`]: K extends `${string}_signed_id`+ ? string | null+ : string | null+} & { [K in `${Name}_cleared`]: boolean }++/** The pair categories and collections carry. */+export type ImageFieldsShape = ImageFieldsFor<'image'> & ImageFieldsFor<'square_image'>++/**+ * Erased shape used inside the adapter only. The public API stays generic over+ * the attachment name; this is what the three field paths are resolved against.+ */+interface ConcreteImageFields {image_signed_id: string | nullimage_preview_url: string | nullimage_cleared: boolean- square_image_signed_id: string | null- square_image_preview_url: string | null- square_image_cleared: boolean}-type ImageKind = 'image' | 'square_image'-/*** Form adapter over the reusable {@link ImageUploadField}, shared by every- * resource whose form carries the {@link ImageFieldsShape} triple (categories,- * collections). Maps the triple onto the generic controlled `ImageUploadValue`+ * resource whose form carries the image triple (categories, collections,+ * vendors). Maps the triple onto the generic controlled `ImageUploadValue`* and resolves labels from the owning resource's locale namespace.*/-export function ResourceImageField<T extends ImageFieldsShape>({+export function ResourceImageField<Name extends string, T extends ImageFieldsFor<Name>>({form,kind,serverUrl,square = false,translationNamespace,+ labelKey,+ helpKey,}: {form: UseFormReturn<T>- kind: ImageKind+ /** The attachment's name on the model, e.g. `image`, `logo`, `cover_photo`. */+ kind: NameserverUrl: string | nullsquare?: boolean/** Locale namespace holding the `images.*` copy, e.g. `admin.collections`. */translationNamespace: string+ /**+ * Copy keys within `<translationNamespace>.images`. Default to the legacy+ * `label`/`square_label` pair the two-image resources use; a resource with+ * more than two attachments names them per field instead.+ */+ labelKey?: string+ helpKey?: string}) {const { t } = useTranslation()- // The adapter only ever touches the image triple; narrow to the shared shape- // so the field-path operations type-check regardless of the concrete form `T`- // (`UseFormReturn` is invariant in its field-values type).- const imageForm = useMemo(() => form as unknown as UseFormReturn<ImageFieldsShape>, [form])+ // The adapter only ever touches this one image triple, and always by the+ // three names derived from `kind`. Narrow to a concrete triple so the+ // field-path operations type-check: RHF's `Path<T>` cannot resolve a+ // template-literal key against a generic mapped type, and `UseFormReturn`+ // is invariant in its field-values type either way.+ const imageForm = useMemo(() => form as unknown as UseFormReturn<ConcreteImageFields>, [form])++ const signedIdField = `${kind}_signed_id` as 'image_signed_id'+ const previewField = `${kind}_preview_url` as 'image_preview_url'+ const clearedField = `${kind}_cleared` as 'image_cleared'- const signedIdField = `${kind}_signed_id` as const- const previewField = `${kind}_preview_url` as const- const clearedField = `${kind}_cleared` as const+ const resolvedLabelKey = labelKey ?? (square ? 'square_label' : 'label')+ const resolvedHelpKey = helpKey ?? (square ? 'square_help' : 'help')return (<ImageUploadFieldsquare={square}serverUrl={serverUrl}- label={t(`${translationNamespace}.images.${square ? 'square_label' : 'label'}`)}- help={t(`${translationNamespace}.images.${square ? 'square_help' : 'help'}`)}+ label={t(`${translationNamespace}.images.${resolvedLabelKey}`)}+ help={t(`${translationNamespace}.images.${resolvedHelpKey}`)}value={{signedId: imageForm.watch(signedIdField),previewUrl: imageForm.watch(previewField),diff --git a/packages/dashboard/src/hooks/use-vendors.ts b/packages/dashboard/src/hooks/use-vendors.tsnew file mode 100644index 0000000000..b0afeaa7fb--- /dev/null+++ b/packages/dashboard/src/hooks/use-vendors.ts@@ -0,0 +1,102 @@+import type {+ ListParams,+ Vendor,+ VendorCreateParams,+ VendorInviteParams,+ VendorRejectParams,+ VendorSuspendParams,+ VendorUpdateParams,+} from '@spree/admin-sdk'+import {+ adminClient,+ useResourceKey,+ useResourceKeyBuilder,+ useResourceMutation,+} from '@spree/dashboard-core'+import { useQuery, useQueryClient } from '@tanstack/react-query'+import i18n from 'i18next'++export function useVendors(params?: ListParams & Record<string, unknown>) {+ return useQuery({+ queryKey: useResourceKey('vendors', params ? JSON.stringify(params) : 'all'),+ queryFn: () => adminClient.vendors.list(params),+ })+}++export function useVendor(id: string | undefined) {+ const key = useResourceKey('vendors', id ?? 'noop')+ return useQuery({+ queryKey: key,+ queryFn: () => adminClient.vendors.get(id as string),+ enabled: !!id,+ })+}++export function useCreateVendor() {+ return useResourceMutation<Vendor, Error, VendorCreateParams>({+ mutationFn: (params) => adminClient.vendors.create(params),+ invalidate: [['vendors']],+ successMessage: i18n.t('admin.vendors.messages.created'),+ errorMessage: i18n.t('admin.vendors.messages.create_failed'),+ })+}++export function useUpdateVendor(id: string) {+ return useResourceMutation<Vendor, Error, VendorUpdateParams>({+ mutationFn: (params) => adminClient.vendors.update(id, params),+ invalidate: [['vendors'], ['vendors', id]],+ successMessage: i18n.t('admin.vendors.messages.updated'),+ errorMessage: i18n.t('admin.vendors.messages.update_failed'),+ })+}++export function useDeleteVendor() {+ const queryClient = useQueryClient()+ const buildKey = useResourceKeyBuilder()++ return useResourceMutation<void, Error, string>({+ mutationFn: (id) => adminClient.vendors.delete(id),+ invalidate: [['vendors']],+ successMessage: i18n.t('admin.vendors.messages.deleted'),+ errorMessage: i18n.t('admin.vendors.messages.delete_failed'),+ onSuccess: (_data, id) => {+ queryClient.removeQueries({ queryKey: buildKey('vendors', id) })+ },+ })+}++export function useInviteVendor(id: string) {+ return useResourceMutation<Vendor, Error, VendorInviteParams>({+ mutationFn: (params) => adminClient.vendors.invite(id, params),+ invalidate: [['vendors'], ['vendors', id]],+ successMessage: i18n.t('admin.vendors.messages.invited'),+ errorMessage: i18n.t('admin.vendors.messages.invite_failed'),+ })+}++export function useApproveVendor(id: string) {+ return useResourceMutation<Vendor, Error, void>({+ mutationFn: () => adminClient.vendors.approve(id),+ invalidate: [['vendors'], ['vendors', id]],+ successMessage: i18n.t('admin.vendors.messages.approved'),+ errorMessage: i18n.t('admin.vendors.messages.approve_failed'),+ })+}++export function useSuspendVendor(id: string) {+ return useResourceMutation<Vendor, Error, VendorSuspendParams | undefined>({+ mutationFn: (params) => adminClient.vendors.suspend(id, params ?? undefined),+ invalidate: [['vendors'], ['vendors', id]],+ successMessage: i18n.t('admin.vendors.messages.suspended'),+ errorMessage: i18n.t('admin.vendors.messages.suspend_failed'),+ })+}++export function useRejectVendor(id: string) {+ return useResourceMutation<Vendor, Error, VendorRejectParams | undefined>({+ mutationFn: (params) => adminClient.vendors.reject(id, params ?? undefined),+ invalidate: [['vendors'], ['vendors', id]],+ successMessage: i18n.t('admin.vendors.messages.rejected'),+ errorMessage: i18n.t('admin.vendors.messages.reject_failed'),+ })+}diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex f0810d5d07..1df13fe849 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -1622,6 +1622,43 @@"expires_at": {"help": "اتركه فارغاً لشهادة بلا تاريخ انتهاء."}+ },+ "vendor": {+ "name": {+ "placeholder": "Sparks Audio"+ },+ "slug": {+ "help": "يُستخدم في عنوان متجر البائع. يُشتق من الاسم إذا تُرك فارغاً."+ },+ "contact_email": {+ "placeholder": "[email protected]",+ "help": "تصل إليه الدعوات وإشعارات السوق."+ },+ "billing_email": {+ "label": "بريد الفوترة",+ "help": "تصل إليه فواتير العمولة وإشعارات الدفع إن اختلف."+ },+ "about": {+ "label": "نبذة",+ "help": "تظهر في ملف البائع بالمتجر."+ },+ "tax_remittance": {+ "label": "الضريبة يورّدها",+ "help": "من يتولى توريد ضريبة الاستهلاك على مبيعات هذا البائع."+ },+ "payouts_schedule_interval": {+ "label": "جدول الدفعات",+ "help": "كم مرة يتقاضى هذا البائع مستحقاته."+ },+ "minimum_payout_amount": {+ "label": "الحد الأدنى للدفعة",+ "help": "تُرحّل الأرصدة الأقل من ذلك إلى الدفعة التالية."+ },+ "holiday_mode_until": {+ "label": "غائب حتى",+ "placeholder": "اختر تاريخاً",+ "help": "يبقى الكتالوج ظاهراً لكن لا يمكن الشراء حتى ذلك الحين."+ }}},"delivery_profiles": {@@ -1893,7 +1930,8 @@"reports": "التقارير","returns": "المرتجعات","settings": "الإعدادات",- "transfers": "التحويلات"+ "transfers": "التحويلات",+ "vendors": "البائعون"},"option_types": {"columns": {@@ -4087,6 +4125,113 @@},"enterprise": {"learn_more": "تعرّف على Spree Enterprise"+ },+ "vendors": {+ "add_cta": "إضافة بائع",+ "add_sheet_title": "بائع جديد",+ "create_description": "أنشئ سجل البائع أولاً، ثم ادعُه ووافق عليه واضبط الدفعات من صفحته.",+ "create_label": "إنشاء البائع",+ "search_placeholder": "ابحث عن بائعين",+ "empty": "لا يوجد بائعون بعد",+ "products_column": "المنتجات",+ "team_column": "الفريق",+ "on_holiday_notice": "هذا البائع في إجازة. تبقى منتجاته ظاهرة لكن لا يمكن شراء أي منها.",+ "delete_confirm": {+ "title": "حذف البائع؟",+ "message": "سيؤدي هذا إلى إزالة {{name}} من السوق. تبقى منتجاته في الكتالوج بلا بائع. لا يمكن التراجع عن ذلك."+ },+ "suspend_confirm": {+ "title": "تعليق البائع؟",+ "message": "سيتوقف {{name}} عن البيع فوراً. يبقى الكتالوج والسجل، ويمكنك إعادته لاحقاً."+ },+ "reject_confirm": {+ "title": "رفض البائع؟",+ "message": "لن يُقبل {{name}} في السوق. يمكنك الموافقة عليه لاحقاً إذا لزم الأمر."+ },+ "invite_sheet": {+ "title": "دعوة بائع",+ "description": "ينضم الشخص إلى فريق البائع عند قبول الدعوة، ويمكنه بعدها الدخول إلى لوحته الخاصة.",+ "email_help": "سترسل الدعوة إلى هذا العنوان."+ },+ "actions": {+ "invite": "دعوة",+ "reinvite": "إعادة الإرسال",+ "send_invitation": "إرسال الدعوة",+ "approve": "الموافقة",+ "reinstate": "إعادة التفعيل",+ "suspend": "تعليق",+ "reject": "رفض"+ },+ "detail": {+ "load_error": "تعذّر تحميل هذا البائع",+ "delete_label": "حذف البائع",+ "status": "الحالة",+ "settlement": "الدفعات والضرائب",+ "at_a_glance": "لمحة سريعة",+ "contact": "التواصل",+ "edit_profile": "تعديل الملف",+ "edit_profile_description": "يحرّر البائع هذه البيانات من لوحته الخاصة، وما تعدّله هنا يجري نيابةً عنه.",+ "edit_settlement": "تعديل الدفعات والضرائب",+ "edit_settlement_description": "أنت وحدك من يرى هذه الإعدادات ويغيّرها، ولا يحرّرها البائع.",+ "no_about": "لم يكتب هذا البائع نبذة بعد."+ },+ "status": {+ "pending": "قيد الانتظار",+ "invited": "مدعو",+ "onboarding": "قيد الإعداد",+ "ready_for_review": "جاهز للمراجعة",+ "approved": "معتمد",+ "suspended": "معلّق",+ "rejected": "مرفوض",+ "canceled": "ملغى"+ },+ "status_help": {+ "pending": "تم الإنشاء، ولم تُرسل أي دعوة بعد.",+ "invited": "في انتظار قبول الدعوة.",+ "onboarding": "يستكمل بياناته.",+ "ready_for_review": "في انتظار موافقتك.",+ "approved": "يبيع في السوق.",+ "suspended": "موقوف عن البيع. أعد تفعيله ليتاجر من جديد.",+ "rejected": "غير مقبول في السوق.",+ "canceled": "انسحب قبل الانضمام."+ },+ "tax_remittance": {+ "vendor": "البائع يورّد الضريبة",+ "platform": "السوق يورّد الضريبة"+ },+ "payout_interval": {+ "inherit": "الإعداد الافتراضي للمتجر",+ "daily": "يومياً",+ "weekly": "أسبوعياً",+ "biweekly": "كل أسبوعين",+ "monthly": "شهرياً",+ "manual": "يدوي"+ },+ "messages": {+ "created": "تم إنشاء البائع",+ "create_failed": "تعذّر إنشاء البائع",+ "updated": "تم تحديث البائع",+ "update_failed": "تعذّر تحديث البائع",+ "deleted": "تم حذف البائع",+ "delete_failed": "تعذّر حذف البائع",+ "invited": "تم إرسال الدعوة",+ "invite_failed": "تعذّر إرسال الدعوة",+ "approved": "تمت الموافقة على البائع",+ "approve_failed": "تعذّرت الموافقة على البائع",+ "suspended": "تم تعليق البائع",+ "suspend_failed": "تعذّر تعليق البائع",+ "rejected": "تم رفض البائع",+ "reject_failed": "تعذّر رفض البائع"+ },+ "not_provided": "غير محدد",+ "images": {+ "logo_label": "الشعار",+ "logo_help": "يُفضَّل الشكل المربّع. يظهر بجوار البائع في كل مكان يرد فيه.",+ "square_logo_label": "شعار مربّع",+ "square_logo_help": "للمواضع التي تتطلب مربّعاً دقيقاً، مثل الصورة الرمزية.",+ "cover_photo_label": "صورة الغلاف",+ "cover_photo_help": "لافتة عريضة أعلى ملف البائع."+ }}}}diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex 515d546ce4..dc1b0e21f9 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -1611,6 +1611,43 @@"expires_at": {"help": "Leer lassen für eine Bescheinigung ohne Ablaufdatum."}+ },+ "vendor": {+ "name": {+ "placeholder": "Sparks Audio"+ },+ "slug": {+ "help": "Teil der Storefront-Adresse des Verkäufers. Wird aus dem Namen abgeleitet, wenn leer."+ },+ "contact_email": {+ "placeholder": "[email protected]",+ "help": "Hierhin gehen Einladungen und Mitteilungen des Marktplatzes."+ },+ "billing_email": {+ "label": "Rechnungs-E-Mail",+ "help": "Hierhin gehen Provisionsrechnungen und Auszahlungsmitteilungen, falls abweichend."+ },+ "about": {+ "label": "Über",+ "help": "Wird im Storefront-Profil des Verkäufers angezeigt."+ },+ "tax_remittance": {+ "label": "Steuer abgeführt von",+ "help": "Wer die Verbrauchsteuer auf die Verkäufe dieses Verkäufers abführt."+ },+ "payouts_schedule_interval": {+ "label": "Auszahlungsrhythmus",+ "help": "Wie oft dieser Verkäufer ausgezahlt wird."+ },+ "minimum_payout_amount": {+ "label": "Mindestauszahlung",+ "help": "Kleinere Beträge werden auf die nächste Auszahlung übertragen."+ },+ "holiday_mode_until": {+ "label": "Abwesend bis",+ "placeholder": "Datum wählen",+ "help": "Der Katalog bleibt sichtbar, es kann bis dahin aber nichts gekauft werden."+ }}},"delivery_profiles": {@@ -1882,7 +1919,8 @@"reports": "Berichte","returns": "Retouren","settings": "Einstellungen",- "transfers": "Umlagerungen"+ "transfers": "Umlagerungen",+ "vendors": "Verkäufer"},"option_types": {"columns": {@@ -4067,6 +4105,113 @@},"enterprise": {"learn_more": "Mehr über Spree Enterprise erfahren"+ },+ "vendors": {+ "add_cta": "Verkäufer hinzufügen",+ "add_sheet_title": "Neuer Verkäufer",+ "create_description": "Legen Sie zuerst den Verkäufer an. Einladung, Freigabe und Auszahlungen richten Sie danach auf seiner Seite ein.",+ "create_label": "Verkäufer anlegen",+ "search_placeholder": "Verkäufer suchen",+ "empty": "Noch keine Verkäufer",+ "products_column": "Produkte",+ "team_column": "Team",+ "on_holiday_notice": "Dieser Verkäufer ist abwesend. Sein Katalog bleibt sichtbar, es kann aber nichts gekauft werden.",+ "delete_confirm": {+ "title": "Verkäufer löschen?",+ "message": "Damit wird {{name}} vom Marktplatz entfernt. Die Produkte bleiben ohne Verkäufer im Katalog. Das lässt sich nicht rückgängig machen."+ },+ "suspend_confirm": {+ "title": "Verkäufer sperren?",+ "message": "{{name}} kann sofort nicht mehr verkaufen. Katalog und Historie bleiben erhalten, und Sie können die Sperre später aufheben."+ },+ "reject_confirm": {+ "title": "Verkäufer ablehnen?",+ "message": "{{name}} wird nicht zum Marktplatz zugelassen. Sie können ihn später trotzdem freigeben."+ },+ "invite_sheet": {+ "title": "Verkäufer einladen",+ "description": "Mit der Annahme tritt die Person dem Verkäuferteam bei und kann sich in ihrem eigenen Bereich anmelden.",+ "email_help": "Die Einladung geht an diese Adresse."+ },+ "actions": {+ "invite": "Einladen",+ "reinvite": "Erneut senden",+ "send_invitation": "Einladung senden",+ "approve": "Freigeben",+ "reinstate": "Sperre aufheben",+ "suspend": "Sperren",+ "reject": "Ablehnen"+ },+ "detail": {+ "load_error": "Dieser Verkäufer konnte nicht geladen werden",+ "delete_label": "Verkäufer löschen",+ "status": "Status",+ "settlement": "Auszahlungen und Steuern",+ "at_a_glance": "Auf einen Blick",+ "contact": "Kontakt",+ "edit_profile": "Profil bearbeiten",+ "edit_profile_description": "Der Verkäufer pflegt das in seinem eigenen Bereich. Änderungen hier erfolgen in seinem Namen.",+ "edit_settlement": "Auszahlungen und Steuern bearbeiten",+ "edit_settlement_description": "Nur Sie sehen und ändern diese Angaben. Der Verkäufer bearbeitet sie nie.",+ "no_about": "Dieser Verkäufer hat noch keine Beschreibung verfasst."+ },+ "status": {+ "pending": "Offen",+ "invited": "Eingeladen",+ "onboarding": "In Einrichtung",+ "ready_for_review": "Zur Prüfung bereit",+ "approved": "Freigegeben",+ "suspended": "Gesperrt",+ "rejected": "Abgelehnt",+ "canceled": "Abgebrochen"+ },+ "status_help": {+ "pending": "Angelegt, aber noch niemand eingeladen.",+ "invited": "Wartet darauf, dass jemand die Einladung annimmt.",+ "onboarding": "Trägt gerade seine Daten ein.",+ "ready_for_review": "Wartet auf Ihre Freigabe.",+ "approved": "Verkauft auf dem Marktplatz.",+ "suspended": "Vom Verkauf ausgeschlossen. Heben Sie die Sperre auf, um wieder zu handeln.",+ "rejected": "Nicht zum Marktplatz zugelassen.",+ "canceled": "Hat vor dem Beitritt zurückgezogen."+ },+ "tax_remittance": {+ "vendor": "Verkäufer führt ab",+ "platform": "Marktplatz führt ab"+ },+ "payout_interval": {+ "inherit": "Standard des Shops",+ "daily": "Täglich",+ "weekly": "Wöchentlich",+ "biweekly": "Alle zwei Wochen",+ "monthly": "Monatlich",+ "manual": "Manuell"+ },+ "messages": {+ "created": "Verkäufer angelegt",+ "create_failed": "Verkäufer konnte nicht angelegt werden",+ "updated": "Verkäufer aktualisiert",+ "update_failed": "Verkäufer konnte nicht aktualisiert werden",+ "deleted": "Verkäufer gelöscht",+ "delete_failed": "Verkäufer konnte nicht gelöscht werden",+ "invited": "Einladung gesendet",+ "invite_failed": "Einladung konnte nicht gesendet werden",+ "approved": "Verkäufer freigegeben",+ "approve_failed": "Verkäufer konnte nicht freigegeben werden",+ "suspended": "Verkäufer gesperrt",+ "suspend_failed": "Verkäufer konnte nicht gesperrt werden",+ "rejected": "Verkäufer abgelehnt",+ "reject_failed": "Verkäufer konnte nicht abgelehnt werden"+ },+ "not_provided": "Nicht angegeben",+ "images": {+ "logo_label": "Logo",+ "logo_help": "Quadratisch passt am besten. Wird überall neben dem Verkäufer angezeigt.",+ "square_logo_label": "Quadratisches Logo",+ "square_logo_help": "Für Stellen, die ein enges Quadrat brauchen, etwa ein Profilbild.",+ "cover_photo_label": "Titelbild",+ "cover_photo_help": "Ein breites Banner oben auf dem Verkäuferprofil."+ }}}}diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex e751cb9272..ac6648e7ae 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -1611,6 +1611,43 @@"expires_at": {"help": "Leave empty for a certificate that does not expire."}+ },+ "vendor": {+ "name": {+ "placeholder": "Sparks Audio"+ },+ "slug": {+ "help": "Used in the vendor’s storefront address. Derived from the name when left empty."+ },+ "contact_email": {+ "placeholder": "[email protected]",+ "help": "Where invitations and marketplace notices go."+ },+ "billing_email": {+ "label": "Billing email",+ "help": "Where commission invoices and payout notices go, if different."+ },+ "about": {+ "label": "About",+ "help": "Shown on the vendor’s storefront profile."+ },+ "tax_remittance": {+ "label": "Tax remitted by",+ "help": "Who accounts for consumer tax on this vendor’s sales."+ },+ "payouts_schedule_interval": {+ "label": "Payout schedule",+ "help": "How often this vendor is paid."+ },+ "minimum_payout_amount": {+ "label": "Minimum payout",+ "help": "Balances below this carry over to the next payout."+ },+ "holiday_mode_until": {+ "label": "Away until",+ "placeholder": "Pick a date",+ "help": "The catalog stays visible but nothing can be bought until then."+ }}},"delivery_profiles": {@@ -1882,7 +1919,8 @@"reports": "Reports","returns": "Returns","settings": "Settings",- "transfers": "Transfers"+ "transfers": "Transfers",+ "vendors": "Vendors"},"option_types": {"columns": {@@ -4067,6 +4105,113 @@},"enterprise": {"learn_more": "Learn about Spree Enterprise"+ },+ "vendors": {+ "add_cta": "Add vendor",+ "add_sheet_title": "New vendor",+ "create_description": "Create the seller record first. You can invite them, approve them and set up payouts from their page.",+ "create_label": "Create vendor",+ "search_placeholder": "Search vendors",+ "empty": "No vendors yet",+ "products_column": "Products",+ "team_column": "Team",+ "on_holiday_notice": "This vendor is away. Their catalog stays visible but nothing can be bought from them.",+ "delete_confirm": {+ "title": "Delete vendor?",+ "message": "This removes {{name}} from the marketplace. Their products stay in your catalog without a seller. This cannot be undone."+ },+ "suspend_confirm": {+ "title": "Suspend vendor?",+ "message": "{{name}} stops selling immediately. Their catalog and history stay, and you can reinstate them later."+ },+ "reject_confirm": {+ "title": "Reject vendor?",+ "message": "{{name}} will not be admitted to the marketplace. You can still approve them later if this was a mistake."+ },+ "invite_sheet": {+ "title": "Invite vendor",+ "description": "They join the vendor team when they accept and can then sign in to their own panel.",+ "email_help": "The invitation goes to this address."+ },+ "actions": {+ "invite": "Invite",+ "reinvite": "Send again",+ "send_invitation": "Send invitation",+ "approve": "Approve",+ "reinstate": "Reinstate",+ "suspend": "Suspend",+ "reject": "Reject"+ },+ "detail": {+ "load_error": "Could not load this vendor",+ "delete_label": "Delete vendor",+ "status": "Status",+ "settlement": "Payouts and tax",+ "at_a_glance": "At a glance",+ "contact": "Contact",+ "edit_profile": "Edit profile",+ "edit_profile_description": "The vendor maintains this from their own panel. Edits here apply on their behalf.",+ "edit_settlement": "Edit payouts and tax",+ "edit_settlement_description": "Only you can see or change these. The vendor never edits them.",+ "no_about": "This vendor has not written a description yet."+ },+ "status": {+ "pending": "Pending",+ "invited": "Invited",+ "onboarding": "Onboarding",+ "ready_for_review": "Ready for review",+ "approved": "Approved",+ "suspended": "Suspended",+ "rejected": "Rejected",+ "canceled": "Canceled"+ },+ "status_help": {+ "pending": "Created, but nobody has been invited yet.",+ "invited": "Waiting for someone to accept the invitation.",+ "onboarding": "Filling in their details.",+ "ready_for_review": "Waiting for you to approve them.",+ "approved": "Selling on the marketplace.",+ "suspended": "Stopped from selling. Reinstate to let them trade again.",+ "rejected": "Not admitted to the marketplace.",+ "canceled": "They withdrew before joining."+ },+ "tax_remittance": {+ "vendor": "Vendor remits",+ "platform": "Marketplace remits"+ },+ "payout_interval": {+ "inherit": "Use store default",+ "daily": "Daily",+ "weekly": "Weekly",+ "biweekly": "Every two weeks",+ "monthly": "Monthly",+ "manual": "Manual"+ },+ "messages": {+ "created": "Vendor created",+ "create_failed": "Could not create the vendor",+ "updated": "Vendor updated",+ "update_failed": "Could not update the vendor",+ "deleted": "Vendor deleted",+ "delete_failed": "Could not delete the vendor",+ "invited": "Invitation sent",+ "invite_failed": "Could not send the invitation",+ "approved": "Vendor approved",+ "approve_failed": "Could not approve the vendor",+ "suspended": "Vendor suspended",+ "suspend_failed": "Could not suspend the vendor",+ "rejected": "Vendor rejected",+ "reject_failed": "Could not reject the vendor"+ },+ "not_provided": "Not provided",+ "images": {+ "logo_label": "Logo",+ "logo_help": "Square works best. Shown beside the vendor everywhere they appear.",+ "square_logo_label": "Square logo",+ "square_logo_help": "Used where a tight square is needed, such as an avatar.",+ "cover_photo_label": "Cover photo",+ "cover_photo_help": "A wide banner across the top of the vendor profile."+ }}}}diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex a63e731dc8..9fb52c3c4b 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -1611,6 +1611,43 @@"expires_at": {"help": "Laissez vide pour une attestation sans date d'expiration."}+ },+ "vendor": {+ "name": {+ "placeholder": "Sparks Audio"+ },+ "slug": {+ "help": "Utilisé dans l'adresse de la boutique du vendeur. Dérivé du nom s'il est vide."+ },+ "contact_email": {+ "placeholder": "[email protected]",+ "help": "Destination des invitations et des avis de la place de marché."+ },+ "billing_email": {+ "label": "E-mail de facturation",+ "help": "Destination des factures de commission et des avis de versement, si elle diffère."+ },+ "about": {+ "label": "À propos",+ "help": "Affiché sur le profil boutique du vendeur."+ },+ "tax_remittance": {+ "label": "Taxe reversée par",+ "help": "Qui déclare la taxe à la consommation sur les ventes de ce vendeur."+ },+ "payouts_schedule_interval": {+ "label": "Fréquence de versement",+ "help": "À quelle fréquence ce vendeur est payé."+ },+ "minimum_payout_amount": {+ "label": "Versement minimum",+ "help": "Les soldes inférieurs sont reportés au versement suivant."+ },+ "holiday_mode_until": {+ "label": "Absent jusqu'au",+ "placeholder": "Choisir une date",+ "help": "Le catalogue reste visible mais rien ne peut être acheté jusque-là."+ }}},"delivery_profiles": {@@ -1882,7 +1919,8 @@"reports": "Rapports","returns": "Retours","settings": "Paramètres",- "transfers": "Transferts"+ "transfers": "Transferts",+ "vendors": "Vendeurs"},"option_types": {"columns": {@@ -4067,6 +4105,113 @@},"enterprise": {"learn_more": "En savoir plus sur Spree Enterprise"+ },+ "vendors": {+ "add_cta": "Ajouter un vendeur",+ "add_sheet_title": "Nouveau vendeur",+ "create_description": "Créez d'abord la fiche du vendeur. Vous pourrez l'inviter, l'approuver et configurer ses versements depuis sa page.",+ "create_label": "Créer le vendeur",+ "search_placeholder": "Rechercher des vendeurs",+ "empty": "Aucun vendeur pour le moment",+ "products_column": "Produits",+ "team_column": "Équipe",+ "on_holiday_notice": "Ce vendeur est absent. Son catalogue reste visible mais rien ne peut être acheté.",+ "delete_confirm": {+ "title": "Supprimer le vendeur ?",+ "message": "Cela retire {{name}} de la place de marché. Ses produits restent dans votre catalogue sans vendeur. Action irréversible."+ },+ "suspend_confirm": {+ "title": "Suspendre le vendeur ?",+ "message": "{{name}} cesse de vendre immédiatement. Son catalogue et son historique sont conservés, et vous pourrez le réactiver plus tard."+ },+ "reject_confirm": {+ "title": "Refuser le vendeur ?",+ "message": "{{name}} ne sera pas admis sur la place de marché. Vous pourrez toujours l'approuver plus tard."+ },+ "invite_sheet": {+ "title": "Inviter un vendeur",+ "description": "La personne rejoint l'équipe du vendeur en acceptant et peut alors se connecter à son propre espace.",+ "email_help": "L'invitation part à cette adresse."+ },+ "actions": {+ "invite": "Inviter",+ "reinvite": "Renvoyer",+ "send_invitation": "Envoyer l'invitation",+ "approve": "Approuver",+ "reinstate": "Réactiver",+ "suspend": "Suspendre",+ "reject": "Refuser"+ },+ "detail": {+ "load_error": "Impossible de charger ce vendeur",+ "delete_label": "Supprimer le vendeur",+ "status": "Statut",+ "settlement": "Versements et taxes",+ "at_a_glance": "En un coup d'œil",+ "contact": "Contact",+ "edit_profile": "Modifier le profil",+ "edit_profile_description": "Le vendeur gère ces informations depuis son propre espace. Les modifications faites ici le sont en son nom.",+ "edit_settlement": "Modifier les versements et les taxes",+ "edit_settlement_description": "Vous seul pouvez voir et modifier ces réglages. Le vendeur ne les modifie jamais.",+ "no_about": "Ce vendeur n'a pas encore rédigé de description."+ },+ "status": {+ "pending": "En attente",+ "invited": "Invité",+ "onboarding": "Configuration",+ "ready_for_review": "À examiner",+ "approved": "Approuvé",+ "suspended": "Suspendu",+ "rejected": "Refusé",+ "canceled": "Annulé"+ },+ "status_help": {+ "pending": "Créé, mais personne n'a encore été invité.",+ "invited": "En attente de l'acceptation de l'invitation.",+ "onboarding": "Renseigne ses informations.",+ "ready_for_review": "Attend votre approbation.",+ "approved": "Vend sur la place de marché.",+ "suspended": "Ne peut plus vendre. Réactivez-le pour reprendre.",+ "rejected": "Non admis sur la place de marché.",+ "canceled": "S'est retiré avant de rejoindre."+ },+ "tax_remittance": {+ "vendor": "Le vendeur reverse",+ "platform": "La place de marché reverse"+ },+ "payout_interval": {+ "inherit": "Valeur par défaut de la boutique",+ "daily": "Chaque jour",+ "weekly": "Chaque semaine",+ "biweekly": "Toutes les deux semaines",+ "monthly": "Chaque mois",+ "manual": "Manuel"+ },+ "messages": {+ "created": "Vendeur créé",+ "create_failed": "Impossible de créer le vendeur",+ "updated": "Vendeur mis à jour",+ "update_failed": "Impossible de mettre à jour le vendeur",+ "deleted": "Vendeur supprimé",+ "delete_failed": "Impossible de supprimer le vendeur",+ "invited": "Invitation envoyée",+ "invite_failed": "Impossible d'envoyer l'invitation",+ "approved": "Vendeur approuvé",+ "approve_failed": "Impossible d'approuver le vendeur",+ "suspended": "Vendeur suspendu",+ "suspend_failed": "Impossible de suspendre le vendeur",+ "rejected": "Vendeur refusé",+ "reject_failed": "Impossible de refuser le vendeur"+ },+ "not_provided": "Non renseigné",+ "images": {+ "logo_label": "Logo",+ "logo_help": "Un format carré convient le mieux. Affiché à côté du vendeur partout où il apparaît.",+ "square_logo_label": "Logo carré",+ "square_logo_help": "Pour les emplacements qui exigent un carré strict, comme un avatar.",+ "cover_photo_label": "Photo de couverture",+ "cover_photo_help": "Une bannière large en haut du profil du vendeur."+ }}}}diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex 87ef1e9869..3a0ba99b92 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -1625,6 +1625,43 @@"expires_at": {"help": "Zostaw puste, aby certyfikat nie wygasał."}+ },+ "vendor": {+ "name": {+ "placeholder": "Sparks Audio"+ },+ "slug": {+ "help": "Używany w adresie sklepu sprzedawcy. Gdy pusty, powstaje z nazwy."+ },+ "contact_email": {+ "placeholder": "[email protected]",+ "help": "Tu trafiają zaproszenia i powiadomienia marketplace."+ },+ "billing_email": {+ "label": "E-mail do rozliczeń",+ "help": "Tu trafiają faktury prowizyjne i powiadomienia o wypłatach, jeśli są inne."+ },+ "about": {+ "label": "O sprzedawcy",+ "help": "Widoczne w profilu sprzedawcy w sklepie."+ },+ "tax_remittance": {+ "label": "Podatek rozlicza",+ "help": "Kto odprowadza podatek konsumencki od sprzedaży tego sprzedawcy."+ },+ "payouts_schedule_interval": {+ "label": "Harmonogram wypłat",+ "help": "Jak często ten sprzedawca otrzymuje wypłatę."+ },+ "minimum_payout_amount": {+ "label": "Minimalna wypłata",+ "help": "Niższe salda przechodzą na kolejną wypłatę."+ },+ "holiday_mode_until": {+ "label": "Nieobecny do",+ "placeholder": "Wybierz datę",+ "help": "Katalog pozostaje widoczny, ale do tego czasu nic nie da się kupić."+ }}},"delivery_profiles": {@@ -1896,7 +1933,8 @@"reports": "Raporty","returns": "Zwroty","settings": "Ustawienia",- "transfers": "Transfery"+ "transfers": "Transfery",+ "vendors": "Sprzedawcy"},"option_types": {"columns": {@@ -4123,6 +4161,113 @@},"enterprise": {"learn_more": "Dowiedz się więcej o Spree Enterprise"+ },+ "vendors": {+ "add_cta": "Dodaj sprzedawcę",+ "add_sheet_title": "Nowy sprzedawca",+ "create_description": "Najpierw utwórz sprzedawcę. Zaproszenie, akceptację i wypłaty ustawisz na jego stronie.",+ "create_label": "Utwórz sprzedawcę",+ "search_placeholder": "Szukaj sprzedawców",+ "empty": "Nie ma jeszcze sprzedawców",+ "products_column": "Produkty",+ "team_column": "Zespół",+ "on_holiday_notice": "Ten sprzedawca jest nieobecny. Jego katalog pozostaje widoczny, ale nic nie da się kupić.",+ "delete_confirm": {+ "title": "Usunąć sprzedawcę?",+ "message": "To usunie {{name}} z marketplace. Jego produkty zostaną w katalogu bez sprzedawcy. Tej operacji nie można cofnąć."+ },+ "suspend_confirm": {+ "title": "Zawiesić sprzedawcę?",+ "message": "{{name}} natychmiast przestanie sprzedawać. Katalog i historia zostaną zachowane, a zawieszenie możesz później cofnąć."+ },+ "reject_confirm": {+ "title": "Odrzucić sprzedawcę?",+ "message": "{{name}} nie zostanie przyjęty do marketplace. Nadal możesz go później zaakceptować."+ },+ "invite_sheet": {+ "title": "Zaproś sprzedawcę",+ "description": "Po przyjęciu zaproszenia osoba dołącza do zespołu sprzedawcy i może zalogować się do własnego panelu.",+ "email_help": "Zaproszenie trafi na ten adres."+ },+ "actions": {+ "invite": "Zaproś",+ "reinvite": "Wyślij ponownie",+ "send_invitation": "Wyślij zaproszenie",+ "approve": "Zaakceptuj",+ "reinstate": "Przywróć",+ "suspend": "Zawieś",+ "reject": "Odrzuć"+ },+ "detail": {+ "load_error": "Nie udało się wczytać tego sprzedawcy",+ "delete_label": "Usuń sprzedawcę",+ "status": "Status",+ "settlement": "Wypłaty i podatki",+ "at_a_glance": "W skrócie",+ "contact": "Kontakt",+ "edit_profile": "Edytuj profil",+ "edit_profile_description": "Sprzedawca prowadzi to w swoim panelu. Zmiany tutaj wprowadzasz w jego imieniu.",+ "edit_settlement": "Edytuj wypłaty i podatki",+ "edit_settlement_description": "Tylko Ty widzisz i zmieniasz te ustawienia. Sprzedawca ich nie edytuje.",+ "no_about": "Ten sprzedawca nie napisał jeszcze opisu."+ },+ "status": {+ "pending": "Oczekuje",+ "invited": "Zaproszony",+ "onboarding": "Konfiguracja",+ "ready_for_review": "Do sprawdzenia",+ "approved": "Zaakceptowany",+ "suspended": "Zawieszony",+ "rejected": "Odrzucony",+ "canceled": "Anulowany"+ },+ "status_help": {+ "pending": "Utworzony, ale nikt nie został jeszcze zaproszony.",+ "invited": "Czeka na przyjęcie zaproszenia.",+ "onboarding": "Uzupełnia swoje dane.",+ "ready_for_review": "Czeka na Twoją akceptację.",+ "approved": "Sprzedaje w marketplace.",+ "suspended": "Nie może sprzedawać. Przywróć, aby wrócił do handlu.",+ "rejected": "Nieprzyjęty do marketplace.",+ "canceled": "Wycofał się przed dołączeniem."+ },+ "tax_remittance": {+ "vendor": "Rozlicza sprzedawca",+ "platform": "Rozlicza marketplace"+ },+ "payout_interval": {+ "inherit": "Domyślne ustawienie sklepu",+ "daily": "Codziennie",+ "weekly": "Co tydzień",+ "biweekly": "Co dwa tygodnie",+ "monthly": "Co miesiąc",+ "manual": "Ręcznie"+ },+ "messages": {+ "created": "Sprzedawca utworzony",+ "create_failed": "Nie udało się utworzyć sprzedawcy",+ "updated": "Sprzedawca zaktualizowany",+ "update_failed": "Nie udało się zaktualizować sprzedawcy",+ "deleted": "Sprzedawca usunięty",+ "delete_failed": "Nie udało się usunąć sprzedawcy",+ "invited": "Zaproszenie wysłane",+ "invite_failed": "Nie udało się wysłać zaproszenia",+ "approved": "Sprzedawca zaakceptowany",+ "approve_failed": "Nie udało się zaakceptować sprzedawcy",+ "suspended": "Sprzedawca zawieszony",+ "suspend_failed": "Nie udało się zawiesić sprzedawcy",+ "rejected": "Sprzedawca odrzucony",+ "reject_failed": "Nie udało się odrzucić sprzedawcy"+ },+ "not_provided": "Nie podano",+ "images": {+ "logo_label": "Logo",+ "logo_help": "Najlepiej sprawdza się kwadrat. Widoczne przy sprzedawcy wszędzie tam, gdzie się pojawia.",+ "square_logo_label": "Logo kwadratowe",+ "square_logo_help": "Do miejsc wymagających ścisłego kwadratu, na przykład awatara.",+ "cover_photo_label": "Zdjęcie w tle",+ "cover_photo_help": "Szeroki baner u góry profilu sprzedawcy."+ }}}}diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex abd80a699d..39b27eb771 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -1608,6 +1608,43 @@"expires_at": {"help": "留空表示该证明长期有效。"}+ },+ "vendor": {+ "name": {+ "placeholder": "Sparks Audio"+ },+ "slug": {+ "help": "用于卖家店铺地址。留空时根据名称生成。"+ },+ "contact_email": {+ "placeholder": "[email protected]",+ "help": "邀请和市场通知会发送到这里。"+ },+ "billing_email": {+ "label": "账单邮箱",+ "help": "佣金发票和结算通知的接收邮箱(如果不同)。"+ },+ "about": {+ "label": "简介",+ "help": "显示在卖家的店铺资料页。"+ },+ "tax_remittance": {+ "label": "税务申报方",+ "help": "由谁为该卖家的销售申报消费税。"+ },+ "payouts_schedule_interval": {+ "label": "结算周期",+ "help": "该卖家多久收到一次款项。"+ },+ "minimum_payout_amount": {+ "label": "最低结算金额",+ "help": "低于此金额的余额会顺延到下次结算。"+ },+ "holiday_mode_until": {+ "label": "休假至",+ "placeholder": "选择日期",+ "help": "在此之前商品仍然可见,但无法购买。"+ }}},"delivery_profiles": {@@ -1879,7 +1916,8 @@"reports": "报表","returns": "退货","settings": "设置",- "transfers": "调拨"+ "transfers": "调拨",+ "vendors": "卖家"},"option_types": {"columns": {@@ -4063,6 +4101,113 @@},"enterprise": {"learn_more": "了解 Spree Enterprise"+ },+ "vendors": {+ "add_cta": "添加卖家",+ "add_sheet_title": "新建卖家",+ "create_description": "先创建卖家记录,然后在卖家页面邀请、批准并设置结算。",+ "create_label": "创建卖家",+ "search_placeholder": "搜索卖家",+ "empty": "暂无卖家",+ "products_column": "商品",+ "team_column": "团队",+ "on_holiday_notice": "该卖家处于休假状态。商品仍然可见,但无法购买。",+ "delete_confirm": {+ "title": "删除卖家?",+ "message": "这会将 {{name}} 从市场中移除。其商品会保留在目录中但不再归属任何卖家。此操作无法撤销。"+ },+ "suspend_confirm": {+ "title": "暂停卖家?",+ "message": "{{name}} 将立即停止销售。商品和历史记录会保留,之后可以恢复。"+ },+ "reject_confirm": {+ "title": "拒绝卖家?",+ "message": "{{name}} 将不会进入市场。如有需要,之后仍可批准。"+ },+ "invite_sheet": {+ "title": "邀请卖家",+ "description": "对方接受后即加入卖家团队,并可登录自己的面板。",+ "email_help": "邀请将发送到该邮箱。"+ },+ "actions": {+ "invite": "邀请",+ "reinvite": "重新发送",+ "send_invitation": "发送邀请",+ "approve": "批准",+ "reinstate": "恢复",+ "suspend": "暂停",+ "reject": "拒绝"+ },+ "detail": {+ "load_error": "无法加载该卖家",+ "delete_label": "删除卖家",+ "status": "状态",+ "settlement": "结算与税务",+ "at_a_glance": "概览",+ "contact": "联系方式",+ "edit_profile": "编辑资料",+ "edit_profile_description": "卖家在自己的面板中维护这些信息。在这里的修改代表卖家进行。",+ "edit_settlement": "编辑结算与税务",+ "edit_settlement_description": "只有你能查看和修改这些设置,卖家无法编辑。",+ "no_about": "该卖家尚未填写简介。"+ },+ "status": {+ "pending": "待处理",+ "invited": "已邀请",+ "onboarding": "入驻中",+ "ready_for_review": "待审核",+ "approved": "已批准",+ "suspended": "已暂停",+ "rejected": "已拒绝",+ "canceled": "已取消"+ },+ "status_help": {+ "pending": "已创建,但尚未邀请任何人。",+ "invited": "等待对方接受邀请。",+ "onboarding": "正在填写资料。",+ "ready_for_review": "等待你的批准。",+ "approved": "正在市场中销售。",+ "suspended": "已停止销售。恢复后可继续经营。",+ "rejected": "未获准进入市场。",+ "canceled": "在加入前已退出。"+ },+ "tax_remittance": {+ "vendor": "卖家申报",+ "platform": "市场申报"+ },+ "payout_interval": {+ "inherit": "使用商店默认值",+ "daily": "每天",+ "weekly": "每周",+ "biweekly": "每两周",+ "monthly": "每月",+ "manual": "手动"+ },+ "messages": {+ "created": "卖家已创建",+ "create_failed": "无法创建卖家",+ "updated": "卖家已更新",+ "update_failed": "无法更新卖家",+ "deleted": "卖家已删除",+ "delete_failed": "无法删除卖家",+ "invited": "邀请已发送",+ "invite_failed": "无法发送邀请",+ "approved": "卖家已批准",+ "approve_failed": "无法批准卖家",+ "suspended": "卖家已暂停",+ "suspend_failed": "无法暂停卖家",+ "rejected": "卖家已拒绝",+ "reject_failed": "无法拒绝卖家"+ },+ "not_provided": "未填写",+ "images": {+ "logo_label": "标志",+ "logo_help": "建议使用正方形。会在卖家出现的各处显示在其旁边。",+ "square_logo_label": "方形标志",+ "square_logo_help": "用于需要严格正方形的位置,例如头像。",+ "cover_photo_label": "封面图",+ "cover_photo_help": "卖家资料页顶部的宽幅横幅。"+ }}}}diff --git a/packages/dashboard/src/nav/default.ts b/packages/dashboard/src/nav/default.tsindex b7ea9096e6..3729510c7d 100644--- a/packages/dashboard/src/nav/default.ts+++ b/packages/dashboard/src/nav/default.ts@@ -7,6 +7,7 @@ import {MapIcon,PackageIcon,SettingsIcon,+ StoreIcon,TagIcon,UsersIcon,} from 'lucide-react'@@ -156,6 +157,17 @@ nav.add({],})+// Only a marketplace has sellers, so the entry hides itself on a store whose+// staff hold no vendor permission at all.+nav.add({+ key: 'vendors',+ label: i18n.t('admin.nav.vendors'),+ path: '/vendors',+ icon: StoreIcon,+ subject: Subject.Vendor,+ position: 450,+})+nav.add({key: 'promotions',label: i18n.t('admin.nav.promotions'),diff --git a/packages/dashboard/src/routeTree.gen.ts b/packages/dashboard/src/routeTree.gen.tsindex b1a684b165..529441839e 100644--- a/packages/dashboard/src/routeTree.gen.ts+++ b/packages/dashboard/src/routeTree.gen.ts@@ -24,12 +24,14 @@ import { Route as GettingStartedRouteImport } from './routes/_authenticated/$stoimport { Route as ExchangesRouteImport } from './routes/_authenticated/$storeId/exchanges'import { Route as ClaimsRouteImport } from './routes/_authenticated/$storeId/claims'import { Route as SplatRouteImport } from './routes/_authenticated/$storeId/$'+import { Route as VendorsIndexRouteImport } from './routes/_authenticated/$storeId/vendors/index'import { Route as SettingsIndexRouteImport } from './routes/_authenticated/$storeId/settings/index'import { Route as PromotionsIndexRouteImport } from './routes/_authenticated/$storeId/promotions/index'import { Route as ProductsIndexRouteImport } from './routes/_authenticated/$storeId/products/index'import { Route as OrdersIndexRouteImport } from './routes/_authenticated/$storeId/orders/index'import { Route as CustomersIndexRouteImport } from './routes/_authenticated/$storeId/customers/index'import { Route as CompaniesIndexRouteImport } from './routes/_authenticated/$storeId/companies/index'+import { Route as VendorsVendorIdRouteImport } from './routes/_authenticated/$storeId/vendors/$vendorId'import { Route as SettingsTaxRatesRouteImport } from './routes/_authenticated/$storeId/settings/tax-rates'import { Route as SettingsTaxCategoriesRouteImport } from './routes/_authenticated/$storeId/settings/tax-categories'import { Route as SettingsStoreRouteImport } from './routes/_authenticated/$storeId/settings/store'@@ -153,6 +155,11 @@ const SplatRoute = SplatRouteImport.update({path: '/$',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const VendorsIndexRoute = VendorsIndexRouteImport.update({+ id: '/vendors/',+ path: '/vendors/',+ getParentRoute: () => authenticatedStoreIdRoute,+} as any)const SettingsIndexRoute = SettingsIndexRouteImport.update({id: '/',path: '/',@@ -183,6 +190,11 @@ const CompaniesIndexRoute = CompaniesIndexRouteImport.update({path: '/companies/',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const VendorsVendorIdRoute = VendorsVendorIdRouteImport.update({+ id: '/vendors/$vendorId',+ path: '/vendors/$vendorId',+ getParentRoute: () => authenticatedStoreIdRoute,+} as any)const SettingsTaxRatesRoute = SettingsTaxRatesRouteImport.update({id: '/tax-rates',path: '/tax-rates',@@ -473,12 +485,14 @@ export interface FileRoutesByFullPath {'/$storeId/settings/store': typeof SettingsStoreRoute'/$storeId/settings/tax-categories': typeof SettingsTaxCategoriesRoute'/$storeId/settings/tax-rates': typeof SettingsTaxRatesRoute+ '/$storeId/vendors/$vendorId': typeof VendorsVendorIdRoute'/$storeId/companies/': typeof CompaniesIndexRoute'/$storeId/customers/': typeof CustomersIndexRoute'/$storeId/orders/': typeof OrdersIndexRoute'/$storeId/products/': typeof ProductsIndexRoute'/$storeId/promotions/': typeof PromotionsIndexRoute'/$storeId/settings/': typeof SettingsIndexRoute+ '/$storeId/vendors/': typeof VendorsIndexRoute'/$storeId/companies/locations/$locationId': typeof CompaniesLocationsDotlocationIdRoute'/$storeId/orders/$orderId/edit': typeof OrdersOrderIdEditRoute'/$storeId/products/categories/$categoryId': typeof ProductsCategoriesCategoryIdRoute@@ -540,12 +554,14 @@ export interface FileRoutesByTo {'/$storeId/settings/store': typeof SettingsStoreRoute'/$storeId/settings/tax-categories': typeof SettingsTaxCategoriesRoute'/$storeId/settings/tax-rates': typeof SettingsTaxRatesRoute+ '/$storeId/vendors/$vendorId': typeof VendorsVendorIdRoute'/$storeId/companies': typeof CompaniesIndexRoute'/$storeId/customers': typeof CustomersIndexRoute'/$storeId/orders': typeof OrdersIndexRoute'/$storeId/products': typeof ProductsIndexRoute'/$storeId/promotions': typeof PromotionsIndexRoute'/$storeId/settings': typeof SettingsIndexRoute+ '/$storeId/vendors': typeof VendorsIndexRoute'/$storeId/companies/locations/$locationId': typeof CompaniesLocationsDotlocationIdRoute'/$storeId/orders/$orderId/edit': typeof OrdersOrderIdEditRoute'/$storeId/products/categories/$categoryId': typeof ProductsCategoriesCategoryIdRoute@@ -611,12 +627,14 @@ export interface FileRoutesById {'/_authenticated/$storeId/settings/store': typeof SettingsStoreRoute'/_authenticated/$storeId/settings/tax-categories': typeof SettingsTaxCategoriesRoute'/_authenticated/$storeId/settings/tax-rates': typeof SettingsTaxRatesRoute+ '/_authenticated/$storeId/vendors/$vendorId': typeof VendorsVendorIdRoute'/_authenticated/$storeId/companies/': typeof CompaniesIndexRoute'/_authenticated/$storeId/customers/': typeof CustomersIndexRoute'/_authenticated/$storeId/orders/': typeof OrdersIndexRoute'/_authenticated/$storeId/products/': typeof ProductsIndexRoute'/_authenticated/$storeId/promotions/': typeof PromotionsIndexRoute'/_authenticated/$storeId/settings/': typeof SettingsIndexRoute+ '/_authenticated/$storeId/vendors/': typeof VendorsIndexRoute'/_authenticated/$storeId/companies/locations/$locationId': typeof CompaniesLocationsDotlocationIdRoute'/_authenticated/$storeId/orders/$orderId/edit': typeof OrdersOrderIdEditRoute'/_authenticated/$storeId/products/categories/$categoryId': typeof ProductsCategoriesCategoryIdRoute@@ -682,12 +700,14 @@ export interface FileRouteTypes {| '/$storeId/settings/store'| '/$storeId/settings/tax-categories'| '/$storeId/settings/tax-rates'+ | '/$storeId/vendors/$vendorId'| '/$storeId/companies/'| '/$storeId/customers/'| '/$storeId/orders/'| '/$storeId/products/'| '/$storeId/promotions/'| '/$storeId/settings/'+ | '/$storeId/vendors/'| '/$storeId/companies/locations/$locationId'| '/$storeId/orders/$orderId/edit'| '/$storeId/products/categories/$categoryId'@@ -749,12 +769,14 @@ export interface FileRouteTypes {| '/$storeId/settings/store'| '/$storeId/settings/tax-categories'| '/$storeId/settings/tax-rates'+ | '/$storeId/vendors/$vendorId'| '/$storeId/companies'| '/$storeId/customers'| '/$storeId/orders'| '/$storeId/products'| '/$storeId/promotions'| '/$storeId/settings'+ | '/$storeId/vendors'| '/$storeId/companies/locations/$locationId'| '/$storeId/orders/$orderId/edit'| '/$storeId/products/categories/$categoryId'@@ -819,12 +841,14 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/settings/store'| '/_authenticated/$storeId/settings/tax-categories'| '/_authenticated/$storeId/settings/tax-rates'+ | '/_authenticated/$storeId/vendors/$vendorId'| '/_authenticated/$storeId/companies/'| '/_authenticated/$storeId/customers/'| '/_authenticated/$storeId/orders/'| '/_authenticated/$storeId/products/'| '/_authenticated/$storeId/promotions/'| '/_authenticated/$storeId/settings/'+ | '/_authenticated/$storeId/vendors/'| '/_authenticated/$storeId/companies/locations/$locationId'| '/_authenticated/$storeId/orders/$orderId/edit'| '/_authenticated/$storeId/products/categories/$categoryId'@@ -962,6 +986,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof SplatRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/vendors/': {+ id: '/_authenticated/$storeId/vendors/'+ path: '/vendors'+ fullPath: '/$storeId/vendors/'+ preLoaderRoute: typeof VendorsIndexRouteImport+ parentRoute: typeof authenticatedStoreIdRoute+ }'/_authenticated/$storeId/settings/': {id: '/_authenticated/$storeId/settings/'path: '/'@@ -1004,6 +1035,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof CompaniesIndexRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/vendors/$vendorId': {+ id: '/_authenticated/$storeId/vendors/$vendorId'+ path: '/vendors/$vendorId'+ fullPath: '/$storeId/vendors/$vendorId'+ preLoaderRoute: typeof VendorsVendorIdRouteImport+ parentRoute: typeof authenticatedStoreIdRoute+ }'/_authenticated/$storeId/settings/tax-rates': {id: '/_authenticated/$storeId/settings/tax-rates'path: '/tax-rates'@@ -1418,11 +1456,13 @@ interface authenticatedStoreIdRouteChildren {PromotionsPromotionIdRoute: typeof PromotionsPromotionIdRoutePromotionsGiftCardsRoute: typeof PromotionsGiftCardsRoutePromotionsNewRoute: typeof PromotionsNewRoute+ VendorsVendorIdRoute: typeof VendorsVendorIdRouteCompaniesIndexRoute: typeof CompaniesIndexRouteCustomersIndexRoute: typeof CustomersIndexRouteOrdersIndexRoute: typeof OrdersIndexRouteProductsIndexRoute: typeof ProductsIndexRoutePromotionsIndexRoute: typeof PromotionsIndexRoute+ VendorsIndexRoute: typeof VendorsIndexRouteCompaniesLocationsDotlocationIdRoute: typeof CompaniesLocationsDotlocationIdRouteOrdersOrderIdEditRoute: typeof OrdersOrderIdEditRouteProductsCategoriesCategoryIdRoute: typeof ProductsCategoriesCategoryIdRoute@@ -1457,11 +1497,13 @@ const authenticatedStoreIdRouteChildren: authenticatedStoreIdRouteChildren = {PromotionsPromotionIdRoute: PromotionsPromotionIdRoute,PromotionsGiftCardsRoute: PromotionsGiftCardsRoute,PromotionsNewRoute: PromotionsNewRoute,+ VendorsVendorIdRoute: VendorsVendorIdRoute,CompaniesIndexRoute: CompaniesIndexRoute,CustomersIndexRoute: CustomersIndexRoute,OrdersIndexRoute: OrdersIndexRoute,ProductsIndexRoute: ProductsIndexRoute,PromotionsIndexRoute: PromotionsIndexRoute,+ VendorsIndexRoute: VendorsIndexRoute,CompaniesLocationsDotlocationIdRoute: CompaniesLocationsDotlocationIdRoute,OrdersOrderIdEditRoute: OrdersOrderIdEditRoute,ProductsCategoriesCategoryIdRoute: ProductsCategoriesCategoryIdRoute,diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/vendors/$vendorId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/vendors/$vendorId.tsxnew file mode 100644index 0000000000..f7b0b6205e--- /dev/null+++ b/packages/dashboard/src/routes/_authenticated/$storeId/vendors/$vendorId.tsx@@ -0,0 +1,952 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type { Vendor } from '@spree/admin-sdk'+import {+ mapSpreeErrorsToForm,+ PageHeader,+ Slot,+ StoreDatePicker,+ Subject,+ usePermissions,+} from '@spree/dashboard-core'+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardHeader,+ CardTitle,+ DropdownMenuItem,+ ErrorState,+ Field,+ FieldDescription,+ FieldError,+ FieldGroup,+ FieldLabel,+ Input,+ RelativeTime,+ ResourceLayout,+ RichTextEditor,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ Sheet,+ SheetContent,+ SheetDescription,+ SheetFooter,+ SheetHeader,+ SheetTitle,+ StatusBadge,+ useConfirm,+} from '@spree/dashboard-ui'+import { createFileRoute, useNavigate } from '@tanstack/react-router'+import { MailIcon, PackageIcon, PencilIcon, StoreIcon, UsersIcon } from 'lucide-react'+import { type ReactNode, useEffect, useState } from 'react'+import { Controller, useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import { ResourceImageField } from '../../../../components/spree/resource-image-field'+import {+ useApproveVendor,+ useDeleteVendor,+ useInviteVendor,+ useRejectVendor,+ useSuspendVendor,+ useUpdateVendor,+ useVendor,+} from '../../../../hooks/use-vendors'+import {+ PAYOUT_INTERVALS,+ TAX_REMITTANCES,+ VENDOR_DEFAULTS,+ type VendorFormValues,+ type VendorInviteValues,+ vendorFormSchema,+ vendorImageParams,+ vendorInviteSchema,+ vendorValuesToParams,+} from '../../../../schemas/vendor'++export const Route = createFileRoute('/_authenticated/$storeId/vendors/$vendorId')({+ component: VendorDetailPage,+})++function VendorDetailPage() {+ const { t } = useTranslation()+ const { vendorId } = Route.useParams()+ const { data: vendor, isLoading, error, refetch } = useVendor(vendorId)++ if (isLoading) return <p className="text-muted-foreground">{t('admin.common.loading')}</p>+ if (error || !vendor) {+ return (+ <ErrorState+ title={t('admin.vendors.detail.load_error')}+ error={error as Error | undefined}+ onRetry={() => refetch()}+ />+ )+ }++ return <VendorBody vendor={vendor} />+}++/**+ * A vendor's page is something you read first. The lifecycle sits in the+ * header, the profile below it, and every editable section opens its own+ * sheet — so arriving here shows you who the seller is rather than dropping+ * you into a form.+ */+function VendorBody({ vendor }: { vendor: Vendor }) {+ const { t } = useTranslation()+ const { storeId } = Route.useParams()+ const navigate = useNavigate()+ const { permissions } = usePermissions()+ const confirm = useConfirm()+ const deleteMutation = useDeleteVendor()++ const [editingProfile, setEditingProfile] = useState(false)+ const [editingSettlement, setEditingSettlement] = useState(false)+ const [inviting, setInviting] = useState(false)++ const approveMutation = useApproveVendor(vendor.id)+ const suspendMutation = useSuspendVendor(vendor.id)+ const rejectMutation = useRejectVendor(vendor.id)++ const canEdit = permissions.can('update', Subject.Vendor)+ const status = vendor.status++ // Mirrors the workflow guards, so the operator is never offered a move the+ // server would refuse.+ const canInvite = ['pending', 'invited', 'canceled'].includes(status)+ const canApprove = ['onboarding', 'ready_for_review', 'suspended', 'rejected'].includes(status)+ const canSuspend = ['approved', 'onboarding', 'ready_for_review'].includes(status)+ const canReject = ['pending', 'invited', 'onboarding', 'ready_for_review'].includes(status)++ const busy =+ approveMutation.isPending || suspendMutation.isPending || rejectMutation.isPending || !canEdit++ async function handleDelete() {+ await deleteMutation.mutateAsync(vendor.id)+ navigate({ to: '/$storeId/vendors', params: { storeId } })+ }++ async function handleSuspend() {+ const ok = await confirm({+ title: t('admin.vendors.suspend_confirm.title'),+ message: t('admin.vendors.suspend_confirm.message', { name: vendor.name }),+ variant: 'destructive',+ confirmLabel: t('admin.vendors.actions.suspend'),+ })+ if (!ok) return+ await suspendMutation.mutateAsync(undefined).catch(() => undefined)+ }++ async function handleReject() {+ const ok = await confirm({+ title: t('admin.vendors.reject_confirm.title'),+ message: t('admin.vendors.reject_confirm.message', { name: vendor.name }),+ variant: 'destructive',+ confirmLabel: t('admin.vendors.actions.reject'),+ })+ if (!ok) return+ await rejectMutation.mutateAsync(undefined).catch(() => undefined)+ }++ // Approving is the move an operator comes here to make, so it is the button;+ // the rest live in the dropdown beside it.+ const primaryAction = canEdit ? (+ <>+ {canApprove && (+ <Button+ size="sm"+ disabled={busy}+ // The hook already surfaces the failure; catching keeps a rejected+ // request from also becoming an unhandled promise rejection, as the+ // suspend and reject handlers do.+ onClick={() => approveMutation.mutateAsync().catch(() => undefined)}+ >+ {status === 'suspended'+ ? t('admin.vendors.actions.reinstate')+ : t('admin.vendors.actions.approve')}+ </Button>+ )}+ {canInvite && (+ <Button+ size="sm"+ variant={canApprove ? 'outline' : 'default'}+ disabled={busy}+ onClick={() => setInviting(true)}+ >+ <MailIcon className="size-4" />+ {status === 'invited'+ ? t('admin.vendors.actions.reinvite')+ : t('admin.vendors.actions.invite')}+ </Button>+ )}+ </>+ ) : null++ const dropdownItems = canEdit ? (+ <>+ {canSuspend && (+ <DropdownMenuItem onClick={handleSuspend}>+ {t('admin.vendors.actions.suspend')}+ </DropdownMenuItem>+ )}+ {canReject && (+ <DropdownMenuItem onClick={handleReject}>+ {t('admin.vendors.actions.reject')}+ </DropdownMenuItem>+ )}+ </>+ ) : null++ return (+ <>+ <ResourceLayout+ header={+ <PageHeader+ title={vendor.name}+ subtitle={vendor.contact_email ?? undefined}+ backTo="vendors"+ badges={<StatusBadge status={status} label={t(`admin.vendors.status.${status}`)} />}+ actions={primaryAction}+ dropdownItems={dropdownItems}+ resource={{ id: vendor.id }}+ onDelete={permissions.can('destroy', Subject.Vendor) ? handleDelete : undefined}+ deleteLabel={t('admin.vendors.detail.delete_label')}+ />+ }+ main={+ <>+ <VendorBrandCard+ vendor={vendor}+ canEdit={canEdit}+ onEdit={() => setEditingProfile(true)}+ />+ <Slot name="vendor.form_main" context={{ vendor, canEdit }} />+ </>+ }+ sidebar={+ <>+ <VendorStatusCard vendor={vendor} />+ <VendorAtAGlanceCard vendor={vendor} />+ <VendorContactCard vendor={vendor} />+ <VendorSettlementCard+ vendor={vendor}+ canEdit={canEdit}+ onEdit={() => setEditingSettlement(true)}+ />+ <Slot name="vendor.form_sidebar" context={{ vendor, canEdit }} />+ </>+ }+ />++ <EditProfileSheet vendor={vendor} open={editingProfile} onOpenChange={setEditingProfile} />+ <EditSettlementSheet+ vendor={vendor}+ open={editingSettlement}+ onOpenChange={setEditingSettlement}+ />+ {inviting && <InviteVendorSheet vendor={vendor} open onOpenChange={setInviting} />}+ </>+ )+}++/** One labelled value in a sidebar card, with a placeholder when unset. */+function ReadRow({ label, children }: { label: string; children: ReactNode }) {+ const { t } = useTranslation()+ return (+ <div className="flex items-start justify-between gap-3 text-sm">+ <span className="text-muted-foreground">{label}</span>+ <span className="text-right">+ {children ?? (+ <span className="text-muted-foreground">{t('admin.vendors.not_provided')}</span>+ )}+ </span>+ </div>+ )+}++/** Cover photo, logo and the seller's own description — the storefront face. */+function VendorBrandCard({+ vendor,+ canEdit,+ onEdit,+}: {+ vendor: Vendor+ canEdit: boolean+ onEdit: () => void+}) {+ const { t } = useTranslation()++ return (+ <Card className="overflow-hidden">+ {/* A vendor with no cover gets a slim band rather than a tall empty+ block. It uses --accent rather than --muted: muted is a deliberate+ "whisper" against white, which over a region this size disappears+ entirely and leaves the logo looking unanchored. */}+ <div className="relative">+ {vendor.cover_photo_url ? (+ <img src={vendor.cover_photo_url} alt="" className="h-40 w-full bg-accent object-cover" />+ ) : (+ <div className="h-20 w-full border-border border-b bg-accent" />+ )}+ {canEdit && (+ <Button size="sm" variant="outline" className="absolute top-3 right-3" onClick={onEdit}>+ <PencilIcon className="size-4" />+ {t('admin.actions.edit')}+ </Button>+ )}+ </div>++ {/* The logo straddles the band, so it needs more inset than CardContent's+ own padding gives — otherwise an 80px tile pulled up over a slim band+ reads as hanging off the card's corner. */}+ <CardContent className="flex flex-col gap-4 px-5 pb-5">+ {/* Positioned with its own z-index: the band above is `relative`, so a+ plain sibling paints underneath it and the band's edge cuts across+ the tile. The border belongs on the tile itself rather than a ring+ outside it, which over the band reads as a halo. */}+ <div className="-mt-10 relative z-10 flex size-20 items-center justify-center overflow-hidden rounded-xl border border-border bg-card shadow-sm">+ {vendor.logo_url ? (+ <img src={vendor.logo_url} alt="" className="size-full object-cover" />+ ) : (+ <StoreIcon className="size-7 text-muted-foreground" />+ )}+ </div>++ {/* The name already sits in the page header; repeating it here would+ just be the same words twice. The handle is what the header lacks. */}+ <p className="text-muted-foreground text-sm">/{vendor.slug}</p>++ {vendor.about_html ? (+ // Server-sanitized on every write path (Spree::RichTextSanitizer),+ // which is what makes rendering it here safe.+ <div+ className="prose prose-sm max-w-none dark:prose-invert"+ // biome-ignore lint/security/noDangerouslySetInnerHtml: sanitized server-side+ dangerouslySetInnerHTML={{ __html: vendor.about_html }}+ />+ ) : (+ <p className="text-muted-foreground text-sm">{t('admin.vendors.detail.no_about')}</p>+ )}+ </CardContent>+ </Card>+ )+}++/** Where the vendor is, and what that means in plain words. */+function VendorStatusCard({ vendor }: { vendor: Vendor }) {+ const { t } = useTranslation()++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.vendors.detail.status')}</CardTitle>+ <CardAction>+ <StatusBadge status={vendor.status} label={t(`admin.vendors.status.${vendor.status}`)} />+ </CardAction>+ </CardHeader>+ <CardContent className="flex flex-col gap-2">+ <p className="text-muted-foreground text-sm">+ {t(`admin.vendors.status_help.${vendor.status}`, {+ defaultValue: t('admin.vendors.status_help.pending'),+ })}+ </p>+ {vendor.on_holiday && (+ <p className="text-muted-foreground text-sm">{t('admin.vendors.on_holiday_notice')}</p>+ )}+ </CardContent>+ </Card>+ )+}++/** The counts an operator scans for before opening anything else. */+function VendorAtAGlanceCard({ vendor }: { vendor: Vendor }) {+ const { t } = useTranslation()++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.vendors.detail.at_a_glance')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-3">+ <div className="flex items-center justify-between text-sm">+ <span className="flex items-center gap-2 text-muted-foreground">+ <PackageIcon className="size-4" />+ {t('admin.vendors.products_column')}+ </span>+ <span>{vendor.products_count}</span>+ </div>+ <div className="flex items-center justify-between text-sm">+ <span className="flex items-center gap-2 text-muted-foreground">+ <UsersIcon className="size-4" />+ {t('admin.vendors.team_column')}+ </span>+ <span>{vendor.users_count}</span>+ </div>+ <ReadRow label={t('admin.fields.created_at.label')}>+ <RelativeTime iso={vendor.created_at} />+ </ReadRow>+ </CardContent>+ </Card>+ )+}++function VendorContactCard({ vendor }: { vendor: Vendor }) {+ const { t } = useTranslation()++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.vendors.detail.contact')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-3">+ <ReadRow label={t('admin.fields.contact_email.label')}>+ {vendor.contact_email ? (+ <a href={`mailto:${vendor.contact_email}`}>{vendor.contact_email}</a>+ ) : null}+ </ReadRow>+ <ReadRow label={t('admin.fields.vendor.billing_email.label')}>+ {vendor.billing_email ? (+ <a href={`mailto:${vendor.billing_email}`}>{vendor.billing_email}</a>+ ) : null}+ </ReadRow>+ </CardContent>+ </Card>+ )+}++/** Operator-only: how and when this vendor gets paid, and who remits tax. */+function VendorSettlementCard({+ vendor,+ canEdit,+ onEdit,+}: {+ vendor: Vendor+ canEdit: boolean+ onEdit: () => void+}) {+ const { t } = useTranslation()++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.vendors.detail.settlement')}</CardTitle>+ {canEdit && (+ <CardAction>+ <Button size="sm" variant="outline" onClick={onEdit}>+ <PencilIcon className="size-4" />+ {t('admin.actions.edit')}+ </Button>+ </CardAction>+ )}+ </CardHeader>+ <CardContent className="flex flex-col gap-3">+ <ReadRow label={t('admin.fields.vendor.tax_remittance.label')}>+ {t(`admin.vendors.tax_remittance.${vendor.tax_remittance}`, {+ defaultValue: vendor.tax_remittance,+ })}+ </ReadRow>+ <ReadRow label={t('admin.fields.vendor.payouts_schedule_interval.label')}>+ {vendor.payouts_schedule_interval+ ? t(`admin.vendors.payout_interval.${vendor.payouts_schedule_interval}`)+ : t('admin.vendors.payout_interval.inherit')}+ </ReadRow>+ <ReadRow label={t('admin.fields.vendor.minimum_payout_amount.label')}>+ {vendor.minimum_payout_amount}+ </ReadRow>+ <ReadRow label={t('admin.fields.vendor.holiday_mode_until.label')}>+ {vendor.holiday_mode_until ? <RelativeTime iso={vendor.holiday_mode_until} /> : null}+ </ReadRow>+ </CardContent>+ </Card>+ )+}++/** The profile the vendor also maintains from their own panel. */+function EditProfileSheet({+ vendor,+ open,+ onOpenChange,+}: {+ vendor: Vendor+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const updateMutation = useUpdateVendor(vendor.id)++ const form = useForm<VendorFormValues>({+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ resolver: zodResolver(vendorFormSchema) as any,+ defaultValues: VENDOR_DEFAULTS,+ })++ // The sheet stays mounted across opens, so re-seed from the latest record+ // each time it opens rather than only on first mount.+ useEffect(() => {+ if (!open) return++ // Images reset to the empty triple: the persisted ones are passed to the+ // field as `serverUrl`, and the triple only carries what the operator+ // changes this time round.+ form.reset({+ ...VENDOR_DEFAULTS,+ name: vendor.name,+ slug: vendor.slug,+ contact_email: vendor.contact_email ?? '',+ billing_email: vendor.billing_email ?? '',+ about: vendor.about_html ?? '',+ })+ }, [open, vendor, form])++ async function onSubmit(values: VendorFormValues) {+ try {+ // Only this sheet's own fields — the settlement sheet owns the rest, and+ // sending them here would post this form's untouched defaults over them.+ const params = vendorValuesToParams(values)+ await updateMutation.mutateAsync({+ ...vendorImageParams(values),+ name: params.name,+ slug: params.slug,+ contact_email: params.contact_email,+ billing_email: params.billing_email,+ about: params.about,+ })+ onOpenChange(false)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const { errors } = form.formState++ return (+ <Sheet open={open} onOpenChange={onOpenChange}>+ <SheetContent>+ <SheetHeader>+ <SheetTitle>{t('admin.vendors.detail.edit_profile')}</SheetTitle>+ <SheetDescription>{t('admin.vendors.detail.edit_profile_description')}</SheetDescription>+ </SheetHeader>+ <form+ onSubmit={(event) => {+ form.handleSubmit(onSubmit)(event)+ event.stopPropagation()+ }}+ className="flex min-h-0 flex-1 flex-col"+ >+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <FieldGroup>+ {errors.root?.message && (+ <p className="text-destructive text-sm" role="alert">+ {errors.root.message}+ </p>+ )}+ <ResourceImageField+ form={form}+ kind="logo"+ serverUrl={vendor.logo_url}+ square+ translationNamespace="admin.vendors"+ labelKey="logo_label"+ helpKey="logo_help"+ />+ <ResourceImageField+ form={form}+ kind="square_logo"+ serverUrl={vendor.square_logo_url}+ square+ translationNamespace="admin.vendors"+ labelKey="square_logo_label"+ helpKey="square_logo_help"+ />+ <ResourceImageField+ form={form}+ kind="cover_photo"+ serverUrl={vendor.cover_photo_url}+ translationNamespace="admin.vendors"+ labelKey="cover_photo_label"+ helpKey="cover_photo_help"+ />++ <Field>+ <FieldLabel htmlFor="vendor-name">{t('admin.fields.name.label')}</FieldLabel>+ <Input+ id="vendor-name"+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ </Field>++ <Field>+ <FieldLabel htmlFor="vendor-slug">{t('admin.fields.slug.label')}</FieldLabel>+ <Input+ id="vendor-slug"+ aria-invalid={!!errors.slug || undefined}+ {...form.register('slug')}+ />+ <FieldDescription>{t('admin.fields.vendor.slug.help')}</FieldDescription>+ <FieldError errors={[errors.slug]} />+ </Field>++ <Field>+ <FieldLabel htmlFor="vendor-contact-email">+ {t('admin.fields.contact_email.label')}+ </FieldLabel>+ <Input+ id="vendor-contact-email"+ type="email"+ aria-invalid={!!errors.contact_email || undefined}+ {...form.register('contact_email')}+ />+ <FieldDescription>{t('admin.fields.vendor.contact_email.help')}</FieldDescription>+ <FieldError errors={[errors.contact_email]} />+ </Field>++ <Field>+ <FieldLabel htmlFor="vendor-billing-email">+ {t('admin.fields.vendor.billing_email.label')}+ </FieldLabel>+ <Input+ id="vendor-billing-email"+ type="email"+ aria-invalid={!!errors.billing_email || undefined}+ {...form.register('billing_email')}+ />+ <FieldDescription>{t('admin.fields.vendor.billing_email.help')}</FieldDescription>+ <FieldError errors={[errors.billing_email]} />+ </Field>++ <Field>+ <FieldLabel htmlFor="vendor-about">+ {t('admin.fields.vendor.about.label')}+ </FieldLabel>+ <Controller+ control={form.control}+ name="about"+ render={({ field }) => (+ <RichTextEditor+ id="vendor-about"+ ariaLabel={t('admin.fields.vendor.about.label')}+ value={field.value ?? ''}+ onChange={field.onChange}+ />+ )}+ />+ <FieldDescription>{t('admin.fields.vendor.about.help')}</FieldDescription>+ </Field>+ </FieldGroup>+ </div>+ <SheetFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>+ {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}+ </Button>+ </SheetFooter>+ </form>+ </SheetContent>+ </Sheet>+ )+}++function EditSettlementSheet({+ vendor,+ open,+ onOpenChange,+}: {+ vendor: Vendor+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const updateMutation = useUpdateVendor(vendor.id)++ const form = useForm<VendorFormValues>({+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ resolver: zodResolver(vendorFormSchema) as any,+ defaultValues: VENDOR_DEFAULTS,+ })++ useEffect(() => {+ if (!open) return++ form.reset({+ ...VENDOR_DEFAULTS,+ // Carried so the schema's required `name` still validates; the submit+ // below sends only this sheet's own fields.+ name: vendor.name,+ tax_remittance: (vendor.tax_remittance ?? 'vendor') as VendorFormValues['tax_remittance'],+ payouts_schedule_interval: (vendor.payouts_schedule_interval ??+ '') as VendorFormValues['payouts_schedule_interval'],+ minimum_payout_amount: vendor.minimum_payout_amount ?? '',+ holiday_mode_until: vendor.holiday_mode_until ?? '',+ })+ }, [open, vendor, form])++ async function onSubmit(values: VendorFormValues) {+ try {+ const params = vendorValuesToParams(values)+ await updateMutation.mutateAsync({+ tax_remittance: params.tax_remittance,+ payouts_schedule_interval: params.payouts_schedule_interval,+ minimum_payout_amount: params.minimum_payout_amount,+ holiday_mode_until: params.holiday_mode_until,+ })+ onOpenChange(false)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const { errors } = form.formState++ const remittanceOptions = TAX_REMITTANCES.map((value) => ({+ value,+ label: t(`admin.vendors.tax_remittance.${value}`),+ }))+ const intervalOptions = [+ { value: '', label: t('admin.vendors.payout_interval.inherit') },+ ...PAYOUT_INTERVALS.map((value) => ({+ value,+ label: t(`admin.vendors.payout_interval.${value}`),+ })),+ ]++ return (+ <Sheet open={open} onOpenChange={onOpenChange}>+ <SheetContent>+ <SheetHeader>+ <SheetTitle>{t('admin.vendors.detail.edit_settlement')}</SheetTitle>+ <SheetDescription>+ {t('admin.vendors.detail.edit_settlement_description')}+ </SheetDescription>+ </SheetHeader>+ <form+ onSubmit={(event) => {+ form.handleSubmit(onSubmit)(event)+ event.stopPropagation()+ }}+ className="flex min-h-0 flex-1 flex-col"+ >+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <FieldGroup>+ {errors.root?.message && (+ <p className="text-destructive text-sm" role="alert">+ {errors.root.message}+ </p>+ )}++ <Field>+ <FieldLabel htmlFor="tax_remittance">+ {t('admin.fields.vendor.tax_remittance.label')}+ </FieldLabel>+ <Controller+ name="tax_remittance"+ control={form.control}+ render={({ field }) => (+ <Select+ items={remittanceOptions}+ value={field.value ?? 'vendor'}+ onValueChange={field.onChange}+ >+ <SelectTrigger id="tax_remittance" className="w-full">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {remittanceOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ <FieldDescription>{t('admin.fields.vendor.tax_remittance.help')}</FieldDescription>+ </Field>++ <Field>+ <FieldLabel htmlFor="payouts_schedule_interval">+ {t('admin.fields.vendor.payouts_schedule_interval.label')}+ </FieldLabel>+ <Controller+ name="payouts_schedule_interval"+ control={form.control}+ render={({ field }) => (+ <Select+ items={intervalOptions}+ value={field.value ?? ''}+ onValueChange={field.onChange}+ >+ <SelectTrigger id="payouts_schedule_interval" className="w-full">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {intervalOptions.map((option) => (+ <SelectItem key={option.value || 'inherit'} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ <FieldDescription>+ {t('admin.fields.vendor.payouts_schedule_interval.help')}+ </FieldDescription>+ </Field>++ <Field>+ <FieldLabel htmlFor="minimum_payout_amount">+ {t('admin.fields.vendor.minimum_payout_amount.label')}+ </FieldLabel>+ <Input+ id="minimum_payout_amount"+ inputMode="decimal"+ aria-invalid={!!errors.minimum_payout_amount || undefined}+ {...form.register('minimum_payout_amount')}+ />+ <FieldDescription>+ {t('admin.fields.vendor.minimum_payout_amount.help')}+ </FieldDescription>+ <FieldError errors={[errors.minimum_payout_amount]} />+ </Field>++ <Field>+ <FieldLabel>{t('admin.fields.vendor.holiday_mode_until.label')}</FieldLabel>+ <Controller+ name="holiday_mode_until"+ control={form.control}+ render={({ field }) => (+ <StoreDatePicker+ value={field.value || null}+ onChange={(next) => field.onChange(next ?? '')}+ placeholder={t('admin.fields.vendor.holiday_mode_until.placeholder')}+ includeTime+ inline+ />+ )}+ />+ <FieldDescription>+ {t('admin.fields.vendor.holiday_mode_until.help')}+ </FieldDescription>+ </Field>+ </FieldGroup>+ </div>+ <SheetFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>+ {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}+ </Button>+ </SheetFooter>+ </form>+ </SheetContent>+ </Sheet>+ )+}++function InviteVendorSheet({+ vendor,+ open,+ onOpenChange,+}: {+ vendor: Vendor+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const inviteMutation = useInviteVendor(vendor.id)+ const form = useForm<VendorInviteValues>({+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ resolver: zodResolver(vendorInviteSchema) as any,+ defaultValues: { email: vendor.contact_email ?? '' },+ })++ async function onSubmit(values: VendorInviteValues) {+ try {+ await inviteMutation.mutateAsync(values)+ onOpenChange(false)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const { errors } = form.formState++ return (+ <Sheet open={open} onOpenChange={onOpenChange}>+ <SheetContent>+ <SheetHeader>+ <SheetTitle>{t('admin.vendors.invite_sheet.title')}</SheetTitle>+ <SheetDescription>{t('admin.vendors.invite_sheet.description')}</SheetDescription>+ </SheetHeader>+ <form+ onSubmit={(event) => {+ // This sheet renders inside the detail page's own tree; without+ // stopping the bubble the browser would submit an outer form.+ form.handleSubmit(onSubmit)(event)+ event.stopPropagation()+ }}+ className="flex min-h-0 flex-1 flex-col"+ >+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <FieldGroup>+ {errors.root?.message && (+ <p className="text-destructive text-sm" role="alert">+ {errors.root.message}+ </p>+ )}+ <Field>+ <FieldLabel htmlFor="invite-email">{t('admin.fields.email.label')}</FieldLabel>+ <Input+ id="invite-email"+ type="email"+ autoFocus+ aria-invalid={!!errors.email || undefined}+ {...form.register('email')}+ />+ <FieldDescription>{t('admin.vendors.invite_sheet.email_help')}</FieldDescription>+ <FieldError errors={[errors.email]} />+ </Field>+ </FieldGroup>+ </div>+ <SheetFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>+ {form.formState.isSubmitting+ ? t('admin.actions.saving')+ : t('admin.vendors.actions.send_invitation')}+ </Button>+ </SheetFooter>+ </form>+ </SheetContent>+ </Sheet>+ )+}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/vendors/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/vendors/index.tsxnew file mode 100644index 0000000000..5eabcdc6d3--- /dev/null+++ b/packages/dashboard/src/routes/_authenticated/$storeId/vendors/index.tsx@@ -0,0 +1,233 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type { Vendor } from '@spree/admin-sdk'+import {+ adminClient,+ Can,+ mapSpreeErrorsToForm,+ ResourceTable,+ resourceSearchSchema,+ Subject,+ usePermissions,+} from '@spree/dashboard-core'+import {+ Button,+ Field,+ FieldDescription,+ FieldError,+ FieldGroup,+ FieldLabel,+ Input,+ RowActions,+ Sheet,+ SheetContent,+ SheetDescription,+ SheetFooter,+ SheetHeader,+ SheetTitle,+ useConfirm,+} from '@spree/dashboard-ui'+import { createFileRoute, useNavigate } from '@tanstack/react-router'+import { PlusIcon } from 'lucide-react'+import { useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import { z } from 'zod/v4'+import { useCreateVendor, useDeleteVendor } from '../../../../hooks/use-vendors'+import {+ VENDOR_DEFAULTS,+ type VendorFormValues,+ vendorFormSchema,+ vendorValuesToParams,+} from '../../../../schemas/vendor'+import '../../../../tables/vendors'++const vendorsSearchSchema = resourceSearchSchema.extend({+ new: z.coerce.boolean().optional(),+})++export const Route = createFileRoute('/_authenticated/$storeId/vendors/')({+ validateSearch: vendorsSearchSchema,+ component: VendorsPage,+})++function VendorsPage() {+ const { t } = useTranslation()+ const search = Route.useSearch() as z.infer<typeof vendorsSearchSchema>+ const { storeId } = Route.useParams()+ const navigate = useNavigate()+ const confirm = useConfirm()+ const deleteMutation = useDeleteVendor()+ const { permissions } = usePermissions()++ const isCreating = !!search.new++ const closeSheet = () =>+ navigate({+ search: (prev: Record<string, unknown>) => {+ const { new: _n, ...rest } = prev+ return rest as never+ },+ })++ const openCreate = () =>+ navigate({ search: (prev: Record<string, unknown>) => ({ ...prev, new: true }) as never })++ async function handleDelete(vendor: Vendor) {+ const ok = await confirm({+ title: t('admin.vendors.delete_confirm.title'),+ message: t('admin.vendors.delete_confirm.message', { name: vendor.name }),+ variant: 'destructive',+ confirmLabel: t('admin.actions.delete'),+ })+ if (!ok) return+ await deleteMutation.mutateAsync(vendor.id).catch(() => undefined)+ }++ return (+ <>+ <ResourceTable<Vendor>+ tableKey="vendors"+ queryKey="vendors"+ queryFn={(params) => adminClient.vendors.list(params)}+ searchParams={search}+ rowActions={(vendor) => (+ <RowActions+ actions={[+ {+ key: 'edit',+ onSelect: () =>+ navigate({+ to: '/$storeId/vendors/$vendorId',+ params: { storeId, vendorId: vendor.id },+ }),+ },+ {+ key: 'delete',+ destructive: true,+ visible: permissions.can('destroy', Subject.Vendor),+ disabled: deleteMutation.isPending,+ onSelect: () => handleDelete(vendor),+ },+ ]}+ />+ )}+ actions={+ <Can I="create" a={Subject.Vendor}>+ <Button size="sm" className="h-[2.125rem]" onClick={openCreate}>+ <PlusIcon className="size-4" />+ {t('admin.vendors.add_cta')}+ </Button>+ </Can>+ }+ />++ {isCreating && <CreateVendorSheet open onOpenChange={(o) => !o && closeSheet()} />}+ </>+ )+}++function CreateVendorSheet({+ open,+ onOpenChange,+}: {+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const { storeId } = Route.useParams()+ const navigate = useNavigate()+ const createMutation = useCreateVendor()+ const form = useForm<VendorFormValues>({+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ resolver: zodResolver(vendorFormSchema) as any,+ defaultValues: VENDOR_DEFAULTS,+ })++ // A new vendor has no team, no catalog and no settlement setup yet, and all+ // of that lives on the detail page — so that is where the operator is+ // headed, most immediately to send the invitation.+ async function onSubmit(values: VendorFormValues) {+ try {+ const vendor = await createMutation.mutateAsync(vendorValuesToParams(values))+ form.reset(VENDOR_DEFAULTS)+ onOpenChange(false)+ navigate({+ to: '/$storeId/vendors/$vendorId',+ params: { storeId, vendorId: vendor.id },+ })+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const { errors } = form.formState++ return (+ <Sheet+ open={open}+ onOpenChange={(next) => {+ if (!next) form.reset(VENDOR_DEFAULTS)+ onOpenChange(next)+ }}+ >+ <SheetContent>+ <SheetHeader>+ <SheetTitle>{t('admin.vendors.add_sheet_title')}</SheetTitle>+ <SheetDescription>{t('admin.vendors.create_description')}</SheetDescription>+ </SheetHeader>+ <form onSubmit={form.handleSubmit(onSubmit)} className="flex min-h-0 flex-1 flex-col">+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <FieldGroup>+ {errors.root?.message && (+ <p className="text-destructive text-sm" role="alert">+ {errors.root.message}+ </p>+ )}+ <Field>+ <FieldLabel htmlFor="name">{t('admin.fields.name.label')}</FieldLabel>+ <Input+ id="name"+ autoFocus+ placeholder={t('admin.fields.vendor.name.placeholder')}+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ </Field>++ <Field>+ <FieldLabel htmlFor="contact_email">+ {t('admin.fields.contact_email.label')}+ </FieldLabel>+ <Input+ id="contact_email"+ type="email"+ placeholder={t('admin.fields.vendor.contact_email.placeholder')}+ aria-invalid={!!errors.contact_email || undefined}+ {...form.register('contact_email')}+ />+ <FieldDescription>{t('admin.fields.vendor.contact_email.help')}</FieldDescription>+ <FieldError errors={[errors.contact_email]} />+ </Field>+ </FieldGroup>+ </div>+ <SheetFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>+ {form.formState.isSubmitting+ ? t('admin.actions.creating')+ : t('admin.vendors.create_label')}+ </Button>+ </SheetFooter>+ </form>+ </SheetContent>+ </Sheet>+ )+}diff --git a/packages/dashboard/src/schemas/vendor.ts b/packages/dashboard/src/schemas/vendor.tsnew file mode 100644index 0000000000..23492c6b87--- /dev/null+++ b/packages/dashboard/src/schemas/vendor.ts@@ -0,0 +1,125 @@+import type { VendorCreateParams } from '@spree/admin-sdk'+import { blankToNull } from '@spree/dashboard-core'+import { requiredMessage } from '@spree/dashboard-ui'+import { z } from 'zod/v4'++/**+ * The lifecycle, in the order a vendor normally travels it. `status` is+ * never part of a form: each move is its own workflow on the server, so the+ * list here is only for rendering labels and filters.+ */+export const VENDOR_STATUSES = [+ 'pending',+ 'invited',+ 'onboarding',+ 'ready_for_review',+ 'approved',+ 'suspended',+ 'rejected',+ 'canceled',+] as const++export type VendorStatus = (typeof VENDOR_STATUSES)[number]++export const TAX_REMITTANCES = ['vendor', 'platform'] as const+export const PAYOUT_INTERVALS = ['daily', 'weekly', 'biweekly', 'monthly', 'manual'] as const++export const vendorFormSchema = z.object({+ name: z+ .string()+ .trim()+ .min(1, { error: requiredMessage('name') }),+ slug: z.string().trim().optional(),+ contact_email: z.email().or(z.literal('')).optional(),+ billing_email: z.email().or(z.literal('')).optional(),+ about: z.string().optional(),+ tax_remittance: z.enum(TAX_REMITTANCES).optional(),+ payouts_schedule_interval: z.enum(PAYOUT_INTERVALS).or(z.literal('')).optional(),+ minimum_payout_amount: z.string().trim().optional(),+ holiday_mode_until: z.string().optional(),+ // Three-state image fields, one triple per attachment. See ResourceImageField.+ logo_signed_id: z.string().nullable(),+ logo_preview_url: z.string().nullable(),+ logo_cleared: z.boolean(),+ square_logo_signed_id: z.string().nullable(),+ square_logo_preview_url: z.string().nullable(),+ square_logo_cleared: z.boolean(),+ cover_photo_signed_id: z.string().nullable(),+ cover_photo_preview_url: z.string().nullable(),+ cover_photo_cleared: z.boolean(),+})++export type VendorFormValues = z.infer<typeof vendorFormSchema>++export const VENDOR_DEFAULTS: VendorFormValues = {+ name: '',+ slug: '',+ contact_email: '',+ billing_email: '',+ about: '',+ tax_remittance: 'vendor',+ payouts_schedule_interval: '',+ minimum_payout_amount: '',+ holiday_mode_until: '',+ logo_signed_id: null,+ logo_preview_url: null,+ logo_cleared: false,+ square_logo_signed_id: null,+ square_logo_preview_url: null,+ square_logo_cleared: false,+ cover_photo_signed_id: null,+ cover_photo_preview_url: null,+ cover_photo_cleared: false,+}++export function vendorValuesToParams(values: VendorFormValues): VendorCreateParams {+ return {+ name: values.name,+ slug: blankToNull(values.slug) ?? undefined,+ contact_email: blankToNull(values.contact_email),+ billing_email: blankToNull(values.billing_email),+ about: blankToNull(values.about),+ tax_remittance: values.tax_remittance,+ payouts_schedule_interval: blankToNull(values.payouts_schedule_interval) as+ | VendorCreateParams['payouts_schedule_interval']+ | null,+ minimum_payout_amount: blankToNull(values.minimum_payout_amount),+ holiday_mode_until: blankToNull(values.holiday_mode_until),+ }+}++/** The image params only, for the sheet that owns the branding. */+export function vendorImageParams(+ values: VendorFormValues,+): Pick<VendorCreateParams, 'logo' | 'square_logo' | 'cover_photo'> {+ return {+ ...imageParam('logo', values.logo_signed_id, values.logo_cleared),+ ...imageParam('square_logo', values.square_logo_signed_id, values.square_logo_cleared),+ ...imageParam('cover_photo', values.cover_photo_signed_id, values.cover_photo_cleared),+ }+}++// Three-state mapping: a fresh upload sends the signed_id, an explicit clear+// sends null (purges the attachment), and an untouched field is omitted.+function imageParam(+ key: 'logo' | 'square_logo' | 'cover_photo',+ signedId: string | null,+ cleared: boolean,+): Partial<Record<'logo' | 'square_logo' | 'cover_photo', string | null>> {+ if (signedId) return { [key]: signedId }+ if (cleared) return { [key]: null }+ return {}+}++export const vendorInviteSchema = z.object({+ email: z.email({ error: requiredMessage('email') }),+})++export type VendorInviteValues = z.infer<typeof vendorInviteSchema>++/** Suspending and rejecting both take an optional note for the vendor. */+export const vendorReasonSchema = z.object({+ reason: z.string().trim().optional(),+})++export type VendorReasonValues = z.infer<typeof vendorReasonSchema>diff --git a/packages/dashboard/src/tables/vendors.tsx b/packages/dashboard/src/tables/vendors.tsxnew file mode 100644index 0000000000..911501ba2b--- /dev/null+++ b/packages/dashboard/src/tables/vendors.tsx@@ -0,0 +1,78 @@+import type { Vendor } from '@spree/admin-sdk'+import { defineTable } from '@spree/dashboard-core'+import { RelativeTime, StatusBadge } from '@spree/dashboard-ui'+import { Link } from '@tanstack/react-router'+import i18n from 'i18next'+import { StoreIcon } from 'lucide-react'+import { VENDOR_STATUSES } from '../schemas/vendor'++defineTable<Vendor>('vendors', {+ title: i18n.t('admin.nav.vendors'),+ searchParam: 'name_cont',+ searchPlaceholder: i18n.t('admin.vendors.search_placeholder'),+ defaultSort: { field: 'name', direction: 'asc' },+ emptyIcon: <StoreIcon className="size-8 text-muted-foreground" />,+ emptyMessage: i18n.t('admin.vendors.empty'),+ columns: [+ {+ key: 'name',+ label: i18n.t('admin.fields.name.label'),+ sortable: true,+ filterable: true,+ default: true,+ render: (vendor) => (+ <Link+ to={'/$storeId/vendors/$vendorId' as string}+ params={{ vendorId: vendor.id }}+ className="font-medium text-foreground no-underline"+ >+ {vendor.name}+ </Link>+ ),+ },+ {+ key: 'status',+ label: i18n.t('admin.fields.status.label'),+ sortable: true,+ filterable: true,+ filterType: 'enum',+ filterOptions: VENDOR_STATUSES.map((status) => ({+ value: status,+ label: i18n.t(`admin.vendors.status.${status}`),+ })),+ default: true,+ render: (vendor) => (+ <StatusBadge+ status={vendor.status}+ label={i18n.t(`admin.vendors.status.${vendor.status}`)}+ />+ ),+ },+ {+ key: 'contact_email',+ label: i18n.t('admin.fields.contact_email.label'),+ sortable: true,+ filterable: true,+ default: true,+ render: (vendor) => vendor.contact_email ?? <span className="text-muted-foreground">—</span>,+ },+ {+ key: 'products_count',+ label: i18n.t('admin.vendors.products_column'),+ default: true,+ render: (vendor) => vendor.products_count,+ },+ {+ key: 'users_count',+ label: i18n.t('admin.vendors.team_column'),+ render: (vendor) => vendor.users_count,+ },+ {+ key: 'created_at',+ label: i18n.t('admin.fields.created_at.label'),+ sortable: true,+ default: true,+ render: (vendor) => <RelativeTime iso={vendor.created_at} />,+ },+ ],+})diff --git a/spree/api/app/controllers/spree/api/v3/admin/vendors_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/vendors_controller.rbnew file mode 100644index 0000000000..768a65dcf8--- /dev/null+++ b/spree/api/app/controllers/spree/api/v3/admin/vendors_controller.rb@@ -0,0 +1,130 @@+module Spree+ module Api+ module V3+ module Admin+ # Sellers, as the marketplace operator manages them.+ #+ # Every status change is its own member action rather than mass+ # assignment, because each one is a workflow with its own arguments —+ # suspending carries a reason, inviting carries an email address. The+ # `status` field is deliberately not writable through `update`: a+ # vendor moved by a PATCH would skip the mail, the payout provisioning+ # and the extension hooks that make the transition mean something.+ class VendorsController < ResourceController+ # Sellers are their own catalog resource: `read_vendors`/`write_vendors`+ # is what a key needs here, and neither is grantable to a seller's own+ # panel — managing sellers is the operator's job.+ scoped_resource :vendors++ before_action :set_resource, only: [:show, :update, :destroy, :invite, :approve, :suspend, :reject]++ # POST /api/v3/admin/vendors/:id/invite+ #+ # Opens the vendor's team to someone. They become a member when they+ # accept, on the same invitation rail the store's own staff use.+ def invite+ result = Spree.vendor_invite_workflow.call(+ vendor: @resource,+ email: params[:email],+ role: role_for_invite,+ inviter: try_spree_current_user+ )++ if result.success?+ render json: serialize_resource(result.value), status: :created+ else+ render_result_error(result)+ end+ end++ # PATCH /api/v3/admin/vendors/:id/approve+ def approve+ run_workflow(Spree.vendor_approve_workflow, approver: try_spree_current_user)+ end++ # PATCH /api/v3/admin/vendors/:id/suspend+ def suspend+ run_workflow(Spree.vendor_suspend_workflow,+ reason: params[:reason],+ suspended_by: try_spree_current_user)+ end++ # PATCH /api/v3/admin/vendors/:id/reject+ def reject+ run_workflow(Spree.vendor_reject_workflow,+ reason: params[:reason],+ rejected_by: try_spree_current_user)+ end++ protected++ def model_class+ Spree::Vendor+ end++ def serializer_class+ Spree.api.admin_vendor_serializer+ end++ # `users` is preloaded because a vendor team is small and its count is+ # a cheap `.size` over loaded rows. `products` deliberately is not: a+ # catalog can run to thousands, so the serializer counts it in SQL+ # rather than materializing it just to measure it.+ def collection_includes+ [:billing_address, :returns_address, :users]+ end++ # Enumerated rather than borrowing the legacy global list, which+ # permits :id, :user_id and :deleted_at — the first of which would+ # reintroduce the address-by-id hole below.+ ADDRESS_KEYS = [+ :first_name, :last_name, :company, :address1, :address2, :city,+ :postal_code, :zipcode, :phone, :country_code, :state_code, :state_name, :label+ ].freeze++ # The vendor's own profile fields, plus the settlement and tax+ # configuration only the operator sets. `status` is absent by+ # design — see the class comment.+ #+ # Addresses are written as nested attributes, never as ids: an+ # address has no store of its own, so accepting `billing_address_id`+ # would bind an arbitrary row and the serializer would render it+ # back in full — an enumeration oracle over every customer address+ # on the installation.+ def permitted_params+ normalize_params(+ params.permit(:name, :slug, :contact_email, :billing_email, :about,+ :logo, :square_logo, :cover_photo,+ :tax_remittance, :payouts_schedule_interval, :minimum_payout_amount,+ :holiday_mode_until,+ metadata: {},+ billing_address: ADDRESS_KEYS,+ returns_address: ADDRESS_KEYS,+ custom_fields: [:id, :custom_field_definition_id, :value, { value: [] }, { value: {} }])+ )+ end++ private++ def run_workflow(workflow, **arguments)+ result = workflow.call(vendor: @resource, **arguments)++ if result.success?+ render json: serialize_resource(result.value)+ else+ render_result_error(result)+ end+ end++ # Read through the vendor's own roles: a role id naming somewhere+ # else is a 404 here rather than an invitation into another team.+ def role_for_invite+ return nil if params[:role_id].blank?++ @resource.roles.find_by_prefix_id!(params[:role_id])+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/serializers/spree/api/v3/admin/vendor_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/vendor_serializer.rbnew file mode 100644index 0000000000..37d94f1f10--- /dev/null+++ b/spree/api/app/serializers/spree/api/v3/admin/vendor_serializer.rb@@ -0,0 +1,94 @@+module Spree+ module Api+ module V3+ module Admin+ # A seller as the marketplace operator sees it: the profile the vendor+ # maintains, plus the settlement and tax configuration only the+ # operator sets.+ #+ # No store-level twin yet — a public seller profile arrives with the+ # storefront work, and until then nothing customer-facing reads a+ # vendor.+ class VendorSerializer < BaseSerializer+ typelize name: :string, slug: :string, status: :string,+ contact_email: [:string, nullable: true], billing_email: [:string, nullable: true],+ about: :string, about_html: :string,+ logo_url: [:string, nullable: true], square_logo_url: [:string, nullable: true],+ cover_photo_url: [:string, nullable: true],+ tax_remittance: :string,+ payouts_schedule_interval: [:string, nullable: true],+ minimum_payout_amount: [:string, nullable: true],+ holiday_mode_until: [:string, nullable: true],+ terms_accepted_at: [:string, nullable: true],+ deleted_at: [:string, nullable: true],+ on_holiday: :boolean, sellable: :boolean,+ products_count: :number, users_count: :number,+ metadata: 'Record<string, unknown> | null'++ attributes :name, :slug, :status, :contact_email, :billing_email,+ :tax_remittance, :payouts_schedule_interval, :metadata,+ holiday_mode_until: :iso8601,+ terms_accepted_at: :iso8601,+ created_at: :iso8601,+ updated_at: :iso8601,+ deleted_at: :iso8601++ attribute :minimum_payout_amount do |vendor|+ vendor.minimum_payout_amount&.to_s+ end++ attribute :about do |vendor|+ Spree::RichTextHelper.to_plain_text(vendor.about)+ end++ attribute :about_html do |vendor|+ vendor.about_html+ end++ attribute :logo_url do |vendor|+ image_url_for(vendor.logo)+ end++ attribute :square_logo_url do |vendor|+ image_url_for(vendor.square_logo)+ end++ attribute :cover_photo_url do |vendor|+ image_url_for(vendor.cover_photo)+ end++ # Approved but away still cannot sell, and the list has to say so+ # without the dashboard re-deriving the rule.+ attribute :on_holiday do |vendor|+ vendor.on_holiday?+ end++ attribute :sellable do |vendor|+ vendor.sellable?+ end++ # Saves the dashboard a request per row for the two counts its list+ # and header show. `count`, not `size`: a seller's catalog is the one association here+ # that can run to thousands of rows, and the list only ever renders+ # the number. Costs one COUNT per row, which is cheaper than loading+ # the catalog into memory to measure it.+ attribute :products_count do |vendor|+ vendor.products.count+ end++ attribute :users_count do |vendor|+ vendor.users.size+ end++ one :billing_address,+ resource: proc { Spree.api.admin_address_serializer },+ if: proc { |vendor| vendor.billing_address.present? }++ one :returns_address,+ resource: proc { Spree.api.admin_address_serializer },+ if: proc { |vendor| vendor.returns_address.present? }+ end+ end+ end+ end+enddiff --git a/spree/api/config/routes.rb b/spree/api/config/routes.rbindex b104b19e65..b160a8c481 100644--- a/spree/api/config/routes.rb+++ b/spree/api/config/routes.rb@@ -425,6 +425,18 @@ Spree::Core::Engine.add_routes do# Customer groups (segmentation; used by promotion rules + bulk customer ops)resources :customer_groups+ # Marketplace sellers. Each status change is its own member action+ # because each one is a workflow with its own arguments — mass+ # assignment would skip the mail and the extension hooks.+ resources :vendors, concerns: :custom_fieldable do+ member do+ post :invite+ patch :approve+ patch :suspend+ patch :reject+ end+ end+# Business customers. Branches and their buyers are created under their# parent and then addressed directly, so a caller holding a branch id# does not have to know which company it belongs to.diff --git a/spree/api/lib/spree/api/dependencies.rb b/spree/api/lib/spree/api/dependencies.rbindex c94f100a74..e3c4cf5314 100644--- a/spree/api/lib/spree/api/dependencies.rb+++ b/spree/api/lib/spree/api/dependencies.rb@@ -152,6 +152,7 @@ module Spreeadmin_company_contact_serializer: 'Spree::Api::V3::Admin::CompanyContactSerializer',admin_tax_exemption_certificate_serializer: 'Spree::Api::V3::Admin::TaxExemptionCertificateSerializer',admin_admin_user_serializer: 'Spree::Api::V3::Admin::AdminUserSerializer',+ admin_vendor_serializer: 'Spree::Api::V3::Admin::VendorSerializer',admin_address_serializer: 'Spree::Api::V3::Admin::AddressSerializer',admin_channel_serializer: 'Spree::Api::V3::Admin::ChannelSerializer',admin_order_routing_rule_serializer: 'Spree::Api::V3::Admin::OrderRoutingRuleSerializer',diff --git a/spree/api/spec/controllers/spree/api/v3/admin/vendors_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/vendors_controller_spec.rbnew file mode 100644index 0000000000..55cdf4fbde--- /dev/null+++ b/spree/api/spec/controllers/spree/api/v3/admin/vendors_controller_spec.rb@@ -0,0 +1,310 @@+require 'spec_helper'++RSpec.describe Spree::Api::V3::Admin::VendorsController, type: :controller do+ render_views++ include_context 'API v3 Admin authenticated'++ let!(:vendor) { create(:vendor, store: store, name: 'Sparks Audio', contact_email: '[email protected]') }++ before { request.headers.merge!(headers) }++ describe 'GET #index' do+ it 'lists the store sellers' do+ get :index, as: :json++ expect(response).to have_http_status(:ok)+ row = json_response['data'].first+ expect(row['id']).to start_with('ven_')+ expect(row['name']).to eq('Sparks Audio')+ expect(row['status']).to eq('pending')+ end++ it "hides another marketplace's sellers" do+ other = create(:vendor, store: create(:store))++ get :index, as: :json++ expect(json_response['data'].map { |row| row['id'] }).not_to include(other.prefixed_id)+ end++ # The team is preloaded and counted in Ruby; the catalog is counted in SQL,+ # so a seller with thousands of products never loads them just to show a+ # number.+ it 'never loads a vendor catalog to count it' do+ vendor.products << create(:product, store: store)+ 3.times { create(:vendor, store: store) }++ product_row_loads = 0+ team_counts = 0+ subscriber = ActiveSupport::Notifications.subscribe('sql.active_record') do |*, payload|+ sql = payload[:sql]+ product_row_loads += 1 if sql.match?(/spree_products/i) && !sql.match?(/SELECT COUNT/i)+ team_counts += 1 if sql.match?(/SELECT COUNT/i) && sql.match?(/spree_role_users/i)+ end++ get :index, as: :json++ ActiveSupport::Notifications.unsubscribe(subscriber)+ expect(product_row_loads).to eq(0)+ expect(team_counts).to eq(0)+ end++ it 'says whether a seller can be bought from right now' do+ vendor.update!(status: 'approved', holiday_mode_until: 2.weeks.from_now)++ get :index, as: :json++ row = json_response['data'].first+ expect(row['on_holiday']).to be(true)+ expect(row['sellable']).to be(false)+ end+ end++ describe 'GET #show' do+ it 'returns the seller profile' do+ get :show, params: { id: vendor.prefixed_id }, as: :json++ expect(response).to have_http_status(:ok)+ expect(json_response['contact_email']).to eq('[email protected]')+ end++ it "404s on another marketplace's seller" do+ other = create(:vendor, store: create(:store))++ get :show, params: { id: other.prefixed_id }, as: :json++ expect(response).to have_http_status(:not_found)+ end+ end++ describe 'POST #create' do+ it 'opens a seller record awaiting invitation' do+ post :create, params: { name: 'Northwind Books', contact_email: '[email protected]' }, as: :json++ expect(response).to have_http_status(:created)+ expect(json_response['status']).to eq('pending')+ expect(json_response['slug']).to eq('northwind-books')+ end++ it 'refuses a slug already taken in this marketplace' do+ post :create, params: { name: 'Sparks Audio' }, as: :json++ expect(response).to have_http_status(:unprocessable_content)+ end+ end++ describe 'PATCH #update' do+ it 'edits the profile and the settlement configuration' do+ patch :update, params: {+ id: vendor.prefixed_id,+ billing_email: '[email protected]',+ payouts_schedule_interval: 'weekly',+ minimum_payout_amount: '25.0'+ }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload.billing_email).to eq('[email protected]')+ expect(vendor.payouts_schedule_interval).to eq('weekly')+ end++ # The transitions are workflows; a PATCH that moved status would skip the+ # mail, the payout provisioning and the extension hooks.+ it 'ignores a status sent through mass assignment' do+ patch :update, params: { id: vendor.prefixed_id, status: 'approved' }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload).to be_pending+ end++ # Written as `about`, read back as both the plain text and the markup —+ # the column holds HTML either way.+ it 'keeps the markup in the description' do+ patch :update, params: { id: vendor.prefixed_id, about: '<p>Independent <em>hi-fi</em>.</p>' },+ as: :json++ expect(response).to have_http_status(:ok)+ expect(json_response['about_html']).to include('<em>hi-fi</em>')+ expect(json_response['about']).to eq('Independent hi-fi.')+ end++ it 'strips scripts out of the description' do+ patch :update, params: { id: vendor.prefixed_id, about: '<p>Hi</p><script>alert(1)</script>' },+ as: :json++ expect(vendor.reload.about_html).not_to include('script')+ end++ # An address carries no store of its own, so an id would bind an arbitrary+ # row — and the serializer renders it back in full, customer and all.+ it 'refuses to bind an address by id' do+ victim = create(:user)+ foreign = create(:address, user: victim, address1: '99 Secret Lane')++ patch :update, params: { id: vendor.prefixed_id, billing_address_id: foreign.prefixed_id },+ as: :json++ expect(vendor.reload.billing_address_id).to be_nil+ expect(json_response).not_to have_key('billing_address')+ end++ it 'ignores a raw integer address id too' do+ foreign = create(:address, user: create(:user))++ patch :update, params: { id: vendor.prefixed_id, billing_address_id: foreign.id.to_s }, as: :json++ expect(vendor.reload.billing_address_id).to be_nil+ end++ it 'creates the vendor its own address from nested attributes' do+ patch :update, params: {+ id: vendor.prefixed_id,+ billing_address: { first_name: 'Ada', last_name: 'Lovelace', address1: '1 Vendor Way',+ city: 'London', postal_code: 'EC1A 1BB', country_code: 'GB', phone: '555' }+ }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload.billing_address.address1).to eq('1 Vendor Way')+ expect(json_response['billing_address']['city']).to eq('London')+ end++ # The dashboard direct-uploads the file, then sends the resulting signed id.+ it 'attaches branding from a signed id' do+ blob = ActiveStorage::Blob.create_and_upload!(+ io: File.open(Spree::Core::Engine.root.join('spec', 'fixtures', 'thinking-cat.jpg')),+ filename: 'thinking-cat.jpg', content_type: 'image/jpeg'+ )++ patch :update, params: { id: vendor.prefixed_id, logo: blob.signed_id }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload.logo).to be_attached+ expect(json_response['logo_url']).to be_present+ end++ it 'attaches a cover photo the same way' do+ blob = ActiveStorage::Blob.create_and_upload!(+ io: File.open(Spree::Core::Engine.root.join('spec', 'fixtures', 'thinking-cat.jpg')),+ filename: 'cover.jpg', content_type: 'image/jpeg'+ )++ patch :update, params: { id: vendor.prefixed_id, cover_photo: blob.signed_id }, as: :json++ expect(vendor.reload.cover_photo).to be_attached+ expect(json_response['cover_photo_url']).to be_present+ end++ it 'purges the logo when logo is set to null' do+ vendor.logo.attach(+ io: File.new(Spree::Core::Engine.root.join('spec', 'fixtures', 'thinking-cat.jpg')),+ filename: 'thinking-cat.jpg'+ )++ patch :update, params: { id: vendor.prefixed_id, logo: nil }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload.logo).not_to be_attached+ end+ end++ # Spree::Vendor includes HasCustomFields and the controller permits them, so+ # the nested endpoints have to exist for a client to read or write one.+ describe 'custom fields' do+ it 'mounts the nested custom_fields resource' do+ expect(get: "/api/v3/admin/vendors/#{vendor.prefixed_id}/custom_fields").to be_routable+ end+ end++ describe 'POST #invite' do+ it "invites someone into the seller's own team" do+ post :invite, params: { id: vendor.prefixed_id, email: '[email protected]' }, as: :json++ expect(response).to have_http_status(:created)+ expect(vendor.reload).to be_invited+ expect(vendor.invitations.last.role.resource).to eq(vendor)+ end++ it 'refuses a role from another team' do+ store_role = Spree::Role.default_admin_role(store)++ post :invite, params: { id: vendor.prefixed_id, email: '[email protected]', role_id: store_role.prefixed_id },+ as: :json++ expect(response).to have_http_status(:not_found)+ expect(vendor.reload).to be_pending+ end+ end++ describe 'PATCH #approve' do+ it 'lets an applicant under review trade' do+ vendor.update!(status: 'ready_for_review')++ patch :approve, params: { id: vendor.prefixed_id }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload).to be_approved+ end++ it 'refuses one that has not applied yet' do+ patch :approve, params: { id: vendor.prefixed_id }, as: :json++ expect(response).to have_http_status(:unprocessable_content)+ end+ end++ describe 'PATCH #suspend' do+ before { vendor.update!(status: 'approved') }++ it 'stops a trading seller and keeps the reason' do+ patch :suspend, params: { id: vendor.prefixed_id, reason: 'Counterfeit goods' }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload).to be_suspended+ expect(vendor.metadata['suspension_reason']).to eq('Counterfeit goods')+ end+ end++ describe 'PATCH #reject' do+ it 'turns down an applicant' do+ vendor.update!(status: 'ready_for_review')++ patch :reject, params: { id: vendor.prefixed_id, reason: 'Incomplete paperwork' }, as: :json++ expect(response).to have_http_status(:ok)+ expect(vendor.reload).to be_rejected+ end++ it 'refuses one already trading — suspension is the right move there' do+ vendor.update!(status: 'approved')++ patch :reject, params: { id: vendor.prefixed_id }, as: :json++ expect(response).to have_http_status(:unprocessable_content)+ end+ end++ describe 'DELETE #destroy' do+ # A vendor's roles refuse deletion while anyone holds them. That guard is+ # for deleting a role on its own; when the whole vendor goes, its team goes+ # with it — otherwise an invited vendor could never be removed.+ it 'removes a seller that has already been invited' do+ Spree::Vendors::Invite.call(vendor: vendor, email: '[email protected]',+ inviter: create(:admin_user))++ delete :destroy, params: { id: vendor.prefixed_id }, as: :json++ expect(response).to have_http_status(:no_content)+ expect(Spree::Vendor.find_by(id: vendor.id)).to be_nil+ expect(Spree::Role.where(resource: vendor)).to be_empty+ end++ it 'removes the seller but keeps their catalog' do+ product = create(:product, store: store, vendor: vendor)++ delete :destroy, params: { id: vendor.prefixed_id }, as: :json++ expect(response).to have_http_status(:no_content)+ expect(product.reload.vendor_id).to be_nil+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/admin/vendors_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/vendors_spec.rbnew file mode 100644index 0000000000..12bdebc79b--- /dev/null+++ b/spree/api/spec/integration/spree/api/v3/admin/vendors_spec.rb@@ -0,0 +1,471 @@+# frozen_string_literal: true++require 'swagger_helper'++# Both vendor addresses accept the same keys, so they document the same shape —+# a bare `type: :object` on one of them would leave SDK consumers without any+# property types for it.+VENDOR_ADDRESS_SCHEMA = {+ type: :object,+ description: "The vendor's own address, written inline. There is no " \+ '`billing_address_id` — an address belongs to whoever it was ' \+ 'created for, so it is never referenced by id here.',+ properties: {+ first_name: { type: :string, example: 'Ada' },+ last_name: { type: :string, example: 'Lovelace' },+ company: { type: :string, example: 'Sparks Audio Ltd' },+ address1: { type: :string, example: '1 Vendor Way' },+ address2: { type: :string, example: 'Unit 4' },+ city: { type: :string, example: 'London' },+ postal_code: { type: :string, example: 'EC1A 1BB' },+ phone: { type: :string, example: '+44 20 7946 0000' },+ country_code: { type: :string, example: 'GB' },+ state_code: { type: :string, example: 'NY' },+ state_name: { type: :string, example: 'New York' },+ label: { type: :string, example: 'Head office' }+ }+}.freeze++RSpec.describe 'Admin Vendors API', type: :request, swagger_doc: 'api-reference/admin.yaml' do+ include_context 'API v3 Admin'++ let(:Authorization) { "Bearer #{admin_jwt_token}" }+ let!(:vendor) do+ create(:vendor, store: store, name: 'Sparks Audio', contact_email: '[email protected]')+ end++ path '/api/v3/admin/vendors' do+ get 'List vendors' do+ tags 'Vendors'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Returns the sellers on this marketplace. `status` says where each one+ is in its life on the marketplace, and `sellable` answers the question+ the status alone cannot: an approved vendor who is away cannot be+ bought from either.+ DESC+ admin_scope :read, :vendors++ admin_sdk_example 'vendors/list'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true,+ description: 'Bearer token for admin authentication'+ parameter name: :page, in: :query, type: :integer, required: false, description: 'Page number'+ parameter name: :limit, in: :query, type: :integer, required: false, description: 'Number of records per page'+ parameter name: :'q[name_cont]', in: :query, type: :string, required: false,+ description: 'Filter by name (contains)'+ parameter name: :'q[status_eq]', in: :query, type: :string, required: false,+ description: 'Filter by status'+ parameter name: :sort, in: :query, type: :string, required: false,+ description: 'Sort by field. Prefix with `-` for descending (e.g., `-created_at`).'++ response '200', 'vendors found' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }++ schema SwaggerSchemaHelpers.paginated('Vendor')++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['data'].pluck('id')).to include(vendor.prefixed_id)+ end+ end++ response '401', 'unauthorized' do+ let(:'x-spree-api-key') { 'invalid' }+ let(:Authorization) { 'Bearer invalid' }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end++ post 'Create a vendor' do+ tags 'Vendors'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Opens a seller record. The vendor starts as `pending` and has no team+ yet — invite someone to run it with the `invite` action below.++ `status` is deliberately not writable here or on update: every move+ through the lifecycle is its own action, because each one does more+ than set a column.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/create'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ required: %w[name],+ properties: {+ name: { type: :string, example: 'Northwind Books' },+ slug: { type: :string, example: 'northwind-books',+ description: 'Derived from the name when omitted.' },+ contact_email: { type: :string, example: '[email protected]', nullable: true },+ billing_email: { type: :string, example: '[email protected]', nullable: true },+ about: { type: :string, example: '<p>Independent bookshop.</p>', nullable: true },+ tax_remittance: { type: :string, enum: %w[vendor platform], example: 'vendor' },+ payouts_schedule_interval: {+ type: :string, enum: %w[daily weekly biweekly monthly manual], nullable: true+ },+ minimum_payout_amount: { type: :string, example: '25.0', nullable: true }+ }+ }++ response '201', 'vendor created' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: 'Northwind Books', contact_email: '[email protected]' } }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['name']).to eq('Northwind Books')+ expect(data['status']).to eq('pending')+ expect(data['slug']).to eq('northwind-books')+ end+ end++ response '422', 'validation error' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: '' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ end++ path '/api/v3/admin/vendors/{id}' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Vendor prefixed ID'++ get 'Get a vendor' do+ tags 'Vendors'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Returns a single vendor, including its settlement and tax configuration.'+ admin_scope :read, :vendors++ admin_sdk_example 'vendors/get'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true++ response '200', 'vendor found' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['id']).to eq(vendor.prefixed_id)+ expect(data['contact_email']).to eq('[email protected]')+ end+ end++ response '404', 'vendor not found' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { 'ven_nonexistent' }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end++ patch 'Update a vendor' do+ tags 'Vendors'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Updates the vendor's profile and the settlement configuration the+ operator owns. A `status` sent here is ignored — use the lifecycle+ actions.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/update'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: {+ name: { type: :string, example: 'Sparks Audio Ltd' },+ billing_email: { type: :string, example: '[email protected]', nullable: true },+ payouts_schedule_interval: {+ type: :string, enum: %w[daily weekly biweekly monthly manual], nullable: true+ },+ minimum_payout_amount: { type: :string, example: '25.0', nullable: true },+ holiday_mode_until: { type: :string, format: 'date-time', nullable: true },+ logo: {+ type: :string, nullable: true,+ description: 'ActiveStorage signed id of a direct-uploaded file. Send `null` ' \+ 'to remove the attachment, or omit the key to leave it alone. ' \+ 'Same for `square_logo` and `cover_photo`.'+ },+ square_logo: { type: :string, nullable: true },+ cover_photo: { type: :string, nullable: true },+ billing_address: VENDOR_ADDRESS_SCHEMA,+ returns_address: VENDOR_ADDRESS_SCHEMA+ }+ }++ response '200', 'vendor updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }+ let(:body) { { billing_email: '[email protected]', payouts_schedule_interval: 'weekly' } }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['billing_email']).to eq('[email protected]')+ expect(data['payouts_schedule_interval']).to eq('weekly')+ end+ end++ response '200', 'vendor address written inline' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }+ let(:body) do+ {+ billing_address: {+ first_name: 'Ada', last_name: 'Lovelace', address1: '1 Vendor Way',+ city: 'London', postal_code: 'EC1A 1BB', country_code: 'GB', phone: '555'+ }+ }+ end++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['billing_address']['address1']).to eq('1 Vendor Way')+ end+ end++ response '422', 'validation error' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }+ let(:body) { { name: '' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end++ delete 'Delete a vendor' do+ tags 'Vendors'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Soft-deletes the vendor. Their products are kept and left without a+ seller rather than deleted — what happens to a departed seller's+ catalog is the operator's decision.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/delete'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true++ response '204', 'vendor deleted' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }++ run_test!+ end+ end+ end++ path '/api/v3/admin/vendors/{id}/invite' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Vendor prefixed ID'++ post 'Invite someone to run a vendor' do+ tags 'Vendors'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Sends an invitation to the vendor's own team and moves the vendor to+ `invited`. The person becomes a member when they accept, and can then+ sign in to the vendor panel.++ `role_id` must name a role this vendor owns; omit it for the vendor's+ own admin role. Re-inviting is allowed — an invitation expires, or the+ first one goes to the wrong address.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/invite'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ required: %w[email],+ properties: {+ email: { type: :string, example: '[email protected]' },+ role_id: { type: :string, example: 'role_UkLWZg9DAJ', nullable: true }+ }+ }++ response '201', 'invitation sent' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }+ let(:body) { { email: '[email protected]' } }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('invited')+ end+ end+ end+ end++ path '/api/v3/admin/vendors/{id}/approve' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Vendor prefixed ID'++ patch 'Approve a vendor' do+ tags 'Vendors'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Lets the vendor sell. This is also the way back for one that was+ suspended or turned down, and it clears any holiday along with the+ suspension.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/approve'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true++ response '200', 'vendor approved' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }++ before { vendor.update!(status: 'ready_for_review') }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('approved')+ expect(data['sellable']).to be(true)+ end+ end++ response '422', 'vendor cannot be approved from its current status' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }++ before { vendor.update!(status: 'approved') }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ end++ path '/api/v3/admin/vendors/{id}/suspend' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Vendor prefixed ID'++ patch 'Suspend a vendor' do+ tags 'Vendors'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Stops a trading vendor from selling. Their catalog and history stay,+ and approving reinstates them. Use this rather than `reject` for a+ vendor already on the marketplace — it says something different, and+ it can be undone.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/suspend'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :body, in: :body, required: false, schema: {+ type: :object,+ properties: {+ reason: { type: :string, example: 'Counterfeit goods' }+ }+ }++ response '200', 'vendor suspended' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }+ let(:body) { { reason: 'Counterfeit goods' } }++ before { vendor.update!(status: 'approved') }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('suspended')+ expect(data['sellable']).to be(false)+ end+ end+ end+ end++ path '/api/v3/admin/vendors/{id}/reject' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Vendor prefixed ID'++ patch 'Reject a vendor' do+ tags 'Vendors'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Turns down an applicant who never traded. A vendor already selling is+ suspended instead; rejecting one is refused.+ DESC+ admin_scope :write, :vendors++ admin_sdk_example 'vendors/reject'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :body, in: :body, required: false, schema: {+ type: :object,+ properties: {+ reason: { type: :string, example: 'Incomplete paperwork' }+ }+ }++ response '200', 'vendor rejected' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { vendor.prefixed_id }+ let(:body) { { reason: 'Incomplete paperwork' } }++ before { vendor.update!(status: 'ready_for_review') }++ schema '$ref' => '#/components/schemas/Vendor'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('rejected')+ end+ end+ end+ end+enddiff --git a/spree/core/app/models/spree/store.rb b/spree/core/app/models/spree/store.rbindex cddab38b10..27af1ef920 100644--- a/spree/core/app/models/spree/store.rb+++ b/spree/core/app/models/spree/store.rb@@ -56,6 +56,10 @@ module Spreepreference :unit_system, :string, default: 'imperial'# email preferencespreference :send_consumer_transactional_emails, :boolean, default: true+ # Sellers are a different audience from shoppers, with their own reasons to+ # be silenced — a marketplace fronting its own seller comms turns these off+ # without also stopping customer receipts.+ preference :send_vendor_transactional_emails, :boolean, default: true# Checkout preferences# Store-level fallback for the channel-owned `guest_checkout` preference# (see Spree::Channel::Gating). Retained so existing accessors keep working.diff --git a/spree/core/app/models/spree/vendor.rb b/spree/core/app/models/spree/vendor.rbindex a873961de4..aa23b3c467 100644--- a/spree/core/app/models/spree/vendor.rb+++ b/spree/core/app/models/spree/vendor.rb@@ -58,9 +58,31 @@ module Spree#belongs_to :store, class_name: 'Spree::Store'# On the commission invoice (EU) and where customer returns route.+ #+ # Written as nested attributes, never by id: an address carries no store of+ # its own, so accepting an id would let any staff member bind — and then+ # read back — a row belonging to another store's customer.+ #+ # Not `dependent: :destroy`, unlike the equivalent on CompanyLocation: a+ # vendor is paranoid, so destroy is a soft delete, and taking the addresses+ # with it would hard-delete the rows a restored vendor — and its historical+ # commission invoices — still point at.belongs_to :billing_address, class_name: 'Spree::Address', optional: truebelongs_to :returns_address, class_name: 'Spree::Address', optional: true+ # update_only, so editing one field of an existing address changes that+ # row instead of building a replacement and orphaning the old one.+ accepts_nested_attributes_for :billing_address, update_only: true+ accepts_nested_attributes_for :returns_address, update_only: true++ # The API reads and writes these under the same name, so the writer takes+ # either a record or the nested hash a client sends.+ %i[billing_address returns_address].each do |name|+ define_method(:"#{name}=") do |value|+ value.is_a?(Hash) || value.is_a?(ActionController::Parameters) ? send(:"#{name}_attributes=", value) : super(value)+ end+ end+# Products and stock survive the vendor leaving: the operator decides what# happens to a departed seller's catalog, so it is never cascade-deleted.has_many :products, class_name: 'Spree::Product', dependent: :nullify@@ -95,6 +117,15 @@ module Spree# Callbacks#before_validation :normalize_slug+ # A vendor is born through plain CRUD rather than a workflow — creating one+ # is not a lifecycle transition, inviting them is — so the default lands+ # here instead of in a creating workflow, as on Spree::Fulfillment.+ after_initialize :apply_default_status, if: :new_record?+ # Roles refuse to be destroyed while anyone still holds them, which is+ # right when a role is deleted on its own and wrong when the whole vendor+ # goes: its roles govern nothing else. Dissolving the team first lets the+ # cascade through, so an invited vendor stays deletable.+ before_destroy :dissolve_team, prepend: true# A vendor's own team is granted through its roles, not the store's.#@@ -128,5 +159,17 @@ module Spreedef normalize_slugself.slug = (slug.presence || name).to_s.parameterize.presenceend++ def apply_default_status+ self.status ||= self.class.default_status+ end++ # Memberships and outstanding invitations are what make a role undeletable.+ # They mean nothing once the vendor is gone, so they go first.+ def dissolve_team+ Spree::RoleUser.where(role_id: roles.ids).delete_all+ invitations.destroy_all+ roles.each { |role| role.update_columns(mutable: true) unless role.mutable? }+ endendenddiff --git a/spree/core/app/workflows/spree/vendors/approve.rb b/spree/core/app/workflows/spree/vendors/approve.rbnew file mode 100644index 0000000000..b9a7fa9bf7--- /dev/null+++ b/spree/core/app/workflows/spree/vendors/approve.rb@@ -0,0 +1,44 @@+module Spree+ module Vendors+ # Lets a vendor trade. Also the way back for one that was suspended or+ # turned down, which is why the guard admits more than the linear path.+ class Approve < Spree::Workflow+ hooks :validate, :after_approve++ # @param vendor [Spree::Vendor]+ # @param approver [Object, nil] the staff member approving+ def perform(vendor:, approver: nil)+ super++ step :ensure_approvable+ run_hooks :validate++ ApplicationRecord.transaction do+ step :mark_approved+ end++ run_hooks :after_approve+ vendor.publish_event('vendor.approved')+ success(vendor.reload)+ end++ private++ def ensure_approvable+ failure(vendor, :already_approved) if vendor.approved?++ return if vendor.onboarding? || vendor.ready_for_review? ||+ vendor.suspended? || vendor.rejected?++ failure(vendor, :not_approvable)+ end++ # Lifting a suspension clears the holiday with it: a vendor coming back+ # is coming back to sell, and leaving them invisible would look like the+ # approval had not worked.+ def mark_approved+ vendor.update!(status: 'approved', holiday_mode_until: nil)+ end+ end+ end+enddiff --git a/spree/core/app/workflows/spree/vendors/invite.rb b/spree/core/app/workflows/spree/vendors/invite.rbnew file mode 100644index 0000000000..061a143600--- /dev/null+++ b/spree/core/app/workflows/spree/vendors/invite.rb@@ -0,0 +1,61 @@+module Spree+ module Vendors+ # Invites someone to run a vendor: sends them an invitation to the vendor's+ # own team and marks the vendor as awaiting their acceptance.+ #+ # Accepting the invitation is what creates the membership — that happens on+ # the existing invitation rail, not here, so this workflow only opens the+ # door.+ class Invite < Spree::Workflow+ hooks :validate, :after_invite++ # The invitation sent, so hook handlers can reach it.+ attr_reader :invitation++ # @param vendor [Spree::Vendor]+ # @param email [String] who to invite+ # @param inviter [Object] the staff member inviting them+ # @param role [Spree::Role, nil] the vendor role they accept into;+ # defaults to the vendor's own admin role+ def perform(vendor:, email:, inviter:, role: nil)+ super++ step :ensure_invitable+ run_hooks :validate++ ApplicationRecord.transaction do+ step :send_invitation+ step :mark_invited+ end++ run_hooks :after_invite+ vendor.publish_event('vendor.invited')+ success(vendor.reload)+ end++ private++ # Re-inviting is deliberate: an invitation expires, or the first one goes+ # to the wrong address. What cannot be re-opened is a vendor already+ # trading or already turned away.+ def ensure_invitable+ return if vendor.pending? || vendor.invited? || vendor.canceled?++ failure(vendor, :not_invitable)+ end++ # The invitation validates that the role is one this vendor owns, so a+ # role naming somewhere else comes back as a 422 rather than access+ # granted elsewhere.+ def send_invitation+ @invitation = vendor.invitations.new(email: email, role: role, inviter: inviter)++ failure(@invitation, @invitation.errors) unless @invitation.save+ end++ def mark_invited+ vendor.update!(status: 'invited')+ end+ end+ end+enddiff --git a/spree/core/app/workflows/spree/vendors/reject.rb b/spree/core/app/workflows/spree/vendors/reject.rbnew file mode 100644index 0000000000..d625bcc1ed--- /dev/null+++ b/spree/core/app/workflows/spree/vendors/reject.rb@@ -0,0 +1,52 @@+module Spree+ module Vendors+ # Turns down an applicant. Distinct from suspension: this one never traded,+ # so what they are told is that they were not admitted rather than that+ # they have been stopped.+ class Reject < Spree::Workflow+ hooks :validate, :after_reject++ # @param vendor [Spree::Vendor]+ # @param reason [String, nil] why, for the applicant and the audit trail+ # @param rejected_by [Object, nil] the staff member rejecting+ def perform(vendor:, reason: nil, rejected_by: nil)+ super++ step :ensure_rejectable+ run_hooks :validate++ ApplicationRecord.transaction do+ step :mark_rejected+ end++ run_hooks :after_reject+ vendor.publish_event('vendor.rejected')+ success(vendor.reload)+ end++ private++ # Only an applicant can be turned down. A trading vendor is suspended,+ # which is reversible and says something different.+ def ensure_rejectable+ failure(vendor, :already_rejected) if vendor.rejected?+ failure(vendor, :cannot_reject_approved) if vendor.approved?++ return if vendor.pending? || vendor.invited? || vendor.onboarding? || vendor.ready_for_review?++ failure(vendor, :not_rejectable)+ end++ def mark_rejected+ vendor.update!(status: 'rejected')+ record_reason+ end++ def record_reason+ return if reason.blank?++ vendor.update!(metadata: vendor.metadata.to_h.merge('rejection_reason' => reason))+ end+ end+ end+enddiff --git a/spree/core/app/workflows/spree/vendors/suspend.rb b/spree/core/app/workflows/spree/vendors/suspend.rbnew file mode 100644index 0000000000..605b667b3b--- /dev/null+++ b/spree/core/app/workflows/spree/vendors/suspend.rb@@ -0,0 +1,55 @@+module Spree+ module Vendors+ # Halts a trading vendor: their catalog stops selling, their record and+ # history stay. Reversible through Spree::Vendors::Approve.+ class Suspend < Spree::Workflow+ hooks :validate, :after_suspend++ # @param vendor [Spree::Vendor]+ # @param reason [String, nil] why, for the vendor and the audit trail+ # @param suspended_by [Object, nil] the staff member suspending+ def perform(vendor:, reason: nil, suspended_by: nil)+ super++ step :ensure_suspendable+ run_hooks :validate++ ApplicationRecord.transaction do+ step :mark_suspended+ end++ run_hooks :after_suspend+ vendor.publish_event('vendor.suspended')+ success(vendor.reload)+ end++ private++ # Anyone already admitted can be stopped — including a vendor still+ # setting themselves up, since a marketplace may need to halt someone+ # mid-onboarding. What cannot be suspended is a vendor who has not been+ # admitted at all; turning those away is Reject, which says something+ # different and is not the same undo.+ def ensure_suspendable+ failure(vendor, :already_suspended) if vendor.suspended?++ return if vendor.approved? || vendor.onboarding? || vendor.ready_for_review?++ failure(vendor, :not_suspendable)+ end++ def mark_suspended+ vendor.update!(status: 'suspended')+ record_reason+ end++ # Kept in metadata rather than a column: it is a note about one event,+ # and the next suspension will have its own.+ def record_reason+ return if reason.blank?++ vendor.update!(metadata: vendor.metadata.to_h.merge('suspension_reason' => reason))+ end+ end+ end+enddiff --git a/spree/core/config/locales/en.yml b/spree/core/config/locales/en.ymlindex 4d5d27a70e..d7a518bc94 100644--- a/spree/core/config/locales/en.yml+++ b/spree/core/config/locales/en.yml@@ -1665,6 +1665,22 @@ en:variants: Variantsvendor: Vendorvendor_access_denied: You do not have access to this vendor.+ vendor_mailer:+ approved_email:+ action: Go to your dashboard+ heading: You're approved+ message: Your application to sell on %{store_name} has been approved. You can now list products and start taking orders.+ subject: You're approved to sell on %{store_name}+ get_in_touch: If you think this is a mistake, reply to this email or contact us at %{store_email}.+ greeting: Hi %{vendor_name},+ rejected_email:+ heading: About your application+ message: Your application to sell on %{store_name} has not been accepted.+ subject: Your application to sell on %{store_name}+ suspended_email:+ heading: Your account has been suspended+ message: Selling on %{store_name} has been paused for your account. Your products and order history are unaffected.+ subject: Your %{store_name} account has been suspendedvendor_membership_required: This account does not belong to any vendor.verified: Verifiedverified_at: Verified atdiff --git a/spree/core/lib/spree/core/dependencies.rb b/spree/core/lib/spree/core/dependencies.rbindex 158d8cfc41..470aba45a1 100644--- a/spree/core/lib/spree/core/dependencies.rb+++ b/spree/core/lib/spree/core/dependencies.rb@@ -104,6 +104,12 @@ module Spreeclaim_deny_workflow: 'Spree::Claims::Deny',claim_cancel_workflow: 'Spree::Claims::Cancel',+ # vendors+ vendor_invite_workflow: 'Spree::Vendors::Invite',+ vendor_approve_workflow: 'Spree::Vendors::Approve',+ vendor_suspend_workflow: 'Spree::Vendors::Suspend',+ vendor_reject_workflow: 'Spree::Vendors::Reject',+tax_exemption_certificate_verify_workflow: 'Spree::TaxExemptionCertificates::Verify',# customersdiff --git a/spree/core/lib/spree/core/permission_configuration.rb b/spree/core/lib/spree/core/permission_configuration.rbindex 8783be4d7a..46f1c5cdd1 100644--- a/spree/core/lib/spree/core/permission_configuration.rb+++ b/spree/core/lib/spree/core/permission_configuration.rb@@ -337,14 +337,23 @@ module Spree[Spree.admin_user_class, Spree::Invitation, Spree::Role, Spree::RoleUser]})- # A seller's own record: profile, branding, addresses, onboarding.+ # Running the marketplace: admitting sellers, approving them, suspending+ # them. Deliberately not opened to the vendor audience — a seller+ # administering other sellers is the one thing this key must not allow.+ register_resource(:vendors, group: :access, subjects: -> { [Spree::Vendor] })++ # A seller editing their own record: profile, branding, addresses,+ # onboarding.#- # Grantable to staff as well, like every resource — the operator runs the- # marketplace and manages its sellers. What keeps a seller to their own- # record is not this key but the branch they hold it on: the vendor- # endpoints scope-fetch through `current_vendor`, so the key answers what- # they may do and the scope answers to which vendor.- register_resource(:vendor_profile, group: :access, subjects: -> { [Spree::Vendor] },+ # A symbol subject, not `Spree::Vendor`: that class belongs to `vendors`+ # above — the operator's key — and claiming it twice would make+ # `resource_for_subject` answer by registration order, besides letting a+ # seller's key manage vendor records generally. A symbol grants a real+ # `can` rule (so `authorize!` on the seller branch resolves) while+ # staying invisible to `resource_for_subject`, which matches Classes+ # only. Which vendor they may touch is still `current_vendor`+ # scope-fetching, never an ability rule.+ register_resource(:vendor_profile, group: :access, subjects: -> { [:vendor_profile] },audiences: %i[vendor])register_resource(:dashboard, group: :analytics, subjects: -> { [:dashboard] },diff --git a/spree/core/spec/lib/spree/core/permission_configuration_spec.rb b/spree/core/spec/lib/spree/core/permission_configuration_spec.rbindex 1b460d42e4..d649a1c2fd 100644--- a/spree/core/spec/lib/spree/core/permission_configuration_spec.rb+++ b/spree/core/spec/lib/spree/core/permission_configuration_spec.rb@@ -210,4 +210,33 @@ RSpec.describe Spree::PermissionConfiguration do)endend++ describe 'vendor_profile' do+ let(:store) { @default_store }+ let(:vendor) { create(:vendor, store: store) }+ let(:user) { create(:admin_user) }++ let(:seller_ability) do+ role = create(:role, name: 'seller', resource: vendor, permissions: %w[write_vendor_profile])+ create(:role_user, role: role, user: user)++ Spree::Ability.new(user, resource: vendor)+ end++ # A key that grants no subject silently authorizes nothing: `authorize!` on+ # the seller branch would fail closed with the permission apparently held.+ it 'grants a real ability rule' do+ expect(seller_ability).to be_can(:manage, :vendor_profile)+ end++ # The subject is a symbol so it cannot be confused with the operator's+ # `vendors` key, which owns the Spree::Vendor class.+ it 'does not let a seller manage vendor records' do+ expect(seller_ability).not_to be_can(:manage, vendor)+ end++ it 'leaves Spree::Vendor mapped to the operator resource' do+ expect(Spree.permissions.resource_for_subject(Spree::Vendor).name).to eq(:vendors)+ end+ endenddiff --git a/spree/core/spec/models/spree/vendor_spec.rb b/spree/core/spec/models/spree/vendor_spec.rbindex ab8eff0a21..92f65cca2d 100644--- a/spree/core/spec/models/spree/vendor_spec.rb+++ b/spree/core/spec/models/spree/vendor_spec.rb@@ -196,4 +196,44 @@ describe Spree::Vendor doexpect(build(:vendor, payouts_schedule_interval: nil, minimum_payout_amount: nil)).to be_validendend++ describe 'addresses' do+ let(:vendor) { create(:vendor) }++ it 'writes an address from nested attributes' do+ vendor.update!(billing_address: { first_name: 'Ada', last_name: 'Lovelace',+ address1: '1 Vendor Way', city: 'London',+ postal_code: 'EC1A 1BB', country_code: 'GB', phone: '555' })++ expect(vendor.reload.billing_address.address1).to eq('1 Vendor Way')+ end++ # A vendor is paranoid, so destroy is a soft delete. Taking the addresses+ # with it would hard-delete rows a restored vendor still points at.+ it 'keeps its addresses when soft-deleted, and finds them again on restore' do+ vendor.update!(billing_address: create(:address))+ address_id = vendor.billing_address_id++ vendor.destroy++ expect(Spree::Address.exists?(address_id)).to be(true)+ vendor.restore+ expect(vendor.reload.billing_address_id).to eq(address_id)+ end+ end++ describe 'deletion' do+ let(:vendor) { create(:vendor) }++ # A role refuses deletion while anyone holds it. That guard is for deleting+ # a role on its own; when the whole vendor goes, its team goes with it.+ it 'takes its team with it, so an invited vendor stays deletable' do+ Spree::Vendors::Invite.call(vendor: vendor, email: '[email protected]',+ inviter: create(:admin_user))++ expect(vendor.destroy).to be_truthy+ expect(Spree::Role.where(resource: vendor)).to be_empty+ expect(Spree::Invitation.where(resource: vendor)).to be_empty+ end+ endenddiff --git a/spree/core/spec/workflows/spree/vendors/lifecycle_spec.rb b/spree/core/spec/workflows/spree/vendors/lifecycle_spec.rbnew file mode 100644index 0000000000..293400584a--- /dev/null+++ b/spree/core/spec/workflows/spree/vendors/lifecycle_spec.rb@@ -0,0 +1,143 @@+require 'spec_helper'++RSpec.describe 'Spree::Vendors workflows' do+ let(:store) { @default_store }+ let(:vendor) { create(:vendor, store: store) }+ let(:staff) { create(:admin_user) }++ before { Spree.hooks.clear! }+ after { Spree.hooks.clear! }++ describe Spree::Vendors::Invite do+ subject(:result) { described_class.call(vendor: vendor, email: '[email protected]', inviter: staff) }++ it 'sends an invitation to the vendor and marks it invited' do+ expect(result).to be_success+ expect(vendor.reload).to be_invited+ expect(vendor.invitations.last.email).to eq('[email protected]')+ end++ it "invites into the vendor's own admin role, not the store's" do+ expect(result.value.invitations.last.role.resource).to eq(vendor)+ end++ it 'refuses a role belonging to somewhere else' do+ store_role = Spree::Role.default_admin_role(store)++ outcome = described_class.call(vendor: vendor, email: '[email protected]', inviter: staff, role: store_role)++ expect(outcome).to be_failure+ expect(vendor.reload).to be_pending+ end++ it 'refuses a vendor already trading' do+ vendor.update!(status: 'approved')++ expect(described_class.call(vendor: vendor, email: '[email protected]', inviter: staff)).to be_failure+ end++ it 're-invites one whose first invitation went astray' do+ result+ expect(described_class.call(vendor: vendor, email: '[email protected]', inviter: staff)).to be_success+ end++ it 'runs validate handlers before anything is written' do+ Spree.hooks.register('vendors.invite.validate') { |workflow| workflow.reject!('not this one') }++ expect(result).to be_failure+ expect(vendor.reload).to be_pending+ expect(vendor.invitations).to be_empty+ end+ end++ describe Spree::Vendors::Approve do+ it 'lets an applicant under review trade' do+ vendor.update!(status: 'ready_for_review')++ expect(described_class.call(vendor: vendor)).to be_success+ expect(vendor.reload).to be_approved+ end++ it 'lifts a suspension, and the holiday it was hiding behind' do+ vendor.update!(status: 'suspended', holiday_mode_until: 2.weeks.from_now)++ expect(described_class.call(vendor: vendor)).to be_success+ expect(vendor.reload).to be_sellable+ end++ it 'refuses one already approved' do+ vendor.update!(status: 'approved')++ expect(described_class.call(vendor: vendor)).to be_failure+ end++ it 'refuses one that has not been invited yet' do+ expect(described_class.call(vendor: vendor)).to be_failure+ end+ end++ describe Spree::Vendors::Suspend do+ before { vendor.update!(status: 'approved') }++ it 'stops a trading vendor' do+ expect(described_class.call(vendor: vendor)).to be_success+ expect(vendor.reload).to be_suspended+ expect(vendor).not_to be_sellable+ end++ it 'keeps the reason with the vendor' do+ described_class.call(vendor: vendor, reason: 'Counterfeit goods')++ expect(vendor.reload.metadata['suspension_reason']).to eq('Counterfeit goods')+ end++ it 'refuses one already suspended' do+ vendor.update!(status: 'suspended')++ expect(described_class.call(vendor: vendor)).to be_failure+ end+ end++ describe Spree::Vendors::Reject do+ it 'turns down an applicant' do+ vendor.update!(status: 'ready_for_review')++ expect(described_class.call(vendor: vendor, reason: 'Incomplete paperwork')).to be_success+ expect(vendor.reload).to be_rejected+ expect(vendor.metadata['rejection_reason']).to eq('Incomplete paperwork')+ end++ # A trading vendor is suspended instead — reversible, and a different+ # thing to tell them.+ it 'refuses one already approved' do+ vendor.update!(status: 'approved')++ expect(described_class.call(vendor: vendor)).to be_failure+ end++ it 'can be undone by approving' do+ vendor.update!(status: 'ready_for_review')+ described_class.call(vendor: vendor)++ expect(Spree::Vendors::Approve.call(vendor: vendor.reload)).to be_success+ expect(vendor.reload).to be_approved+ end+ end++ describe 'lifecycle hooks' do+ it 'reports each transition to its own hook' do+ seen = []+ %w[invite approve suspend reject].each do |action|+ Spree.hooks.register("vendors.#{action}.after_#{action}") { |_workflow| seen << action }+ end++ Spree::Vendors::Invite.call(vendor: vendor, email: '[email protected]', inviter: staff)+ vendor.update!(status: 'ready_for_review')+ Spree::Vendors::Approve.call(vendor: vendor)+ Spree::Vendors::Suspend.call(vendor: vendor.reload)+ Spree::Vendors::Reject.call(vendor: create(:vendor, store: store))++ expect(seen).to eq(%w[invite approve suspend reject])+ end+ end+enddiff --git a/spree/emails/app/mailers/spree/vendor_mailer.rb b/spree/emails/app/mailers/spree/vendor_mailer.rbnew file mode 100644index 0000000000..989153076e--- /dev/null+++ b/spree/emails/app/mailers/spree/vendor_mailer.rb@@ -0,0 +1,61 @@+module Spree+ # Tells a seller what just happened to them on the marketplace.+ #+ # Deliberately vendor-facing only: the legacy module also copied every store+ # admin on approvals and onboarding, which on a marketplace with many sellers+ # is a lot of mail about something staff can already see in the dashboard.+ # Marketplace-side notifications ride the event and webhook surface instead.+ class VendorMailer < BaseMailer+ helper Spree::MailHelper++ # @param vendor [Spree::Vendor, Integer]+ def approved_email(vendor)+ @vendor = load_vendor(vendor)+ # Where the seller signs in. Resolved rather than built from the store URL+ # so a hosted dashboard, a dev Vite server and a mounted build all work.+ @dashboard_url = Spree::Stores::DashboardUrl.call(store: store).presence++ deliver_to_vendor(Spree.t('vendor_mailer.approved_email.subject', store_name: store.name))+ end++ # Carries no reason: the operator's note is an internal record, and a+ # suspended seller is told to get in touch rather than handed a verdict.+ def suspended_email(vendor)+ @vendor = load_vendor(vendor)++ deliver_to_vendor(Spree.t('vendor_mailer.suspended_email.subject', store_name: store.name))+ end++ def rejected_email(vendor)+ @vendor = load_vendor(vendor)++ deliver_to_vendor(Spree.t('vendor_mailer.rejected_email.subject', store_name: store.name))+ end++ private++ def load_vendor(vendor)+ vendor.respond_to?(:id) ? vendor : Spree::Vendor.find(vendor)+ end++ def store+ @store ||= @vendor.store || Spree::Store.default+ end++ # The team plus the address the vendor gave for contact — before anyone has+ # accepted an invitation the team is empty, and that address is the only way+ # to reach them.+ def recipients+ (@vendor.users.pluck(:email) << @vendor.contact_email).compact_blank.uniq(&:downcase)+ end++ def deliver_to_vendor(subject)+ addresses = recipients+ return message.perform_deliveries = false if addresses.empty?++ with_store_locale(store) do+ mail(to: addresses, subject: subject, store_url: store.storefront_url)+ end+ end+ end+enddiff --git a/spree/emails/app/subscribers/spree/vendor_email_subscriber.rb b/spree/emails/app/subscribers/spree/vendor_email_subscriber.rbnew file mode 100644index 0000000000..9d2c4830e6--- /dev/null+++ b/spree/emails/app/subscribers/spree/vendor_email_subscriber.rb@@ -0,0 +1,46 @@+# frozen_string_literal: true++module Spree+ # Turns the vendor lifecycle events into seller-facing mail.+ #+ # Nothing is sent from the workflows themselves: a transition publishes an+ # event, and mail is one listener among several (webhooks, analytics) rather+ # than a step the transition waits on.+ #+ # `vendor.invited` is deliberately absent — inviting a vendor creates an+ # Invitation, which already mails the invitee through InvitationEmailSubscriber.+ # A second email would be the same news to the same address.+ class VendorEmailSubscriber < Spree::Subscriber+ subscribes_to 'vendor.approved', 'vendor.suspended', 'vendor.rejected'++ on 'vendor.approved', :send_approved_email+ on 'vendor.suspended', :send_suspended_email+ on 'vendor.rejected', :send_rejected_email++ private++ def send_approved_email(event)+ deliver(event, :approved_email)+ end++ def send_suspended_email(event)+ deliver(event, :suspended_email)+ end++ def send_rejected_email(event)+ deliver(event, :rejected_email)+ end++ def deliver(event, mailer_method)+ vendor = find_vendor(event)+ return unless vendor+ return unless vendor.store&.prefers_send_vendor_transactional_emails?++ VendorMailer.public_send(mailer_method, vendor.id).deliver_later+ end++ def find_vendor(event)+ Spree::Vendor.find_by_prefix_id(event.payload['id'])+ end+ end+enddiff --git a/spree/emails/app/views/spree/vendor_mailer/approved_email.html.erb b/spree/emails/app/views/spree/vendor_mailer/approved_email.html.erbnew file mode 100644index 0000000000..501467e4a1--- /dev/null+++ b/spree/emails/app/views/spree/vendor_mailer/approved_email.html.erb@@ -0,0 +1,8 @@+<%= render layout: 'spree/shared/mailer_hero' do %>+ <h1><%= Spree.t('vendor_mailer.approved_email.heading') %></h1>+ <p class="greeting"><%= Spree.t('vendor_mailer.greeting', vendor_name: @vendor.name) %></p>+ <p><%= Spree.t('vendor_mailer.approved_email.message', store_name: current_store.name) %></p>+ <% if @dashboard_url %>+ <%= render 'spree/shared/mailer_button', url: @dashboard_url, label: Spree.t('vendor_mailer.approved_email.action') %>+ <% end %>+<% end %>diff --git a/spree/emails/app/views/spree/vendor_mailer/approved_email.text.erb b/spree/emails/app/views/spree/vendor_mailer/approved_email.text.erbnew file mode 100644index 0000000000..a1616ca233--- /dev/null+++ b/spree/emails/app/views/spree/vendor_mailer/approved_email.text.erb@@ -0,0 +1,8 @@+<%= Spree.t('vendor_mailer.greeting', vendor_name: @vendor.name) %>++<%= Spree.t('vendor_mailer.approved_email.message', store_name: current_store.name) %>+<% if @dashboard_url %>+<%= Spree.t('vendor_mailer.approved_email.action') %>: <%= @dashboard_url %>+<% end %>++<%= Spree.t('order_mailer.store_team', store_name: current_store.name) %>diff --git a/spree/emails/app/views/spree/vendor_mailer/rejected_email.html.erb b/spree/emails/app/views/spree/vendor_mailer/rejected_email.html.erbnew file mode 100644index 0000000000..2ad1570242--- /dev/null+++ b/spree/emails/app/views/spree/vendor_mailer/rejected_email.html.erb@@ -0,0 +1,6 @@+<%= render layout: 'spree/shared/mailer_hero' do %>+ <h1><%= Spree.t('vendor_mailer.rejected_email.heading') %></h1>+ <p class="greeting"><%= Spree.t('vendor_mailer.greeting', vendor_name: @vendor.name) %></p>+ <p><%= Spree.t('vendor_mailer.rejected_email.message', store_name: current_store.name) %></p>+ <p class="sub"><%= Spree.t('vendor_mailer.get_in_touch', store_email: current_store.mail_from_address) %></p>+<% end %>diff --git a/spree/emails/app/views/spree/vendor_mailer/rejected_email.text.erb b/spree/emails/app/views/spree/vendor_mailer/rejected_email.text.erbnew file mode 100644index 0000000000..b9a41dadc2--- /dev/null+++ b/spree/emails/app/views/spree/vendor_mailer/rejected_email.text.erb@@ -0,0 +1,7 @@+<%= Spree.t('vendor_mailer.greeting', vendor_name: @vendor.name) %>++<%= Spree.t('vendor_mailer.rejected_email.message', store_name: current_store.name) %>++<%= Spree.t('vendor_mailer.get_in_touch', store_email: current_store.mail_from_address) %>++<%= Spree.t('order_mailer.store_team', store_name: current_store.name) %>diff --git a/spree/emails/app/views/spree/vendor_mailer/suspended_email.html.erb b/spree/emails/app/views/spree/vendor_mailer/suspended_email.html.erbnew file mode 100644index 0000000000..01ca0cb894--- /dev/null+++ b/spree/emails/app/views/spree/vendor_mailer/suspended_email.html.erb@@ -0,0 +1,6 @@+<%= render layout: 'spree/shared/mailer_hero' do %>+ <h1><%= Spree.t('vendor_mailer.suspended_email.heading') %></h1>+ <p class="greeting"><%= Spree.t('vendor_mailer.greeting', vendor_name: @vendor.name) %></p>+ <p><%= Spree.t('vendor_mailer.suspended_email.message', store_name: current_store.name) %></p>+ <p class="sub"><%= Spree.t('vendor_mailer.get_in_touch', store_email: current_store.mail_from_address) %></p>+<% end %>diff --git a/spree/emails/app/views/spree/vendor_mailer/suspended_email.text.erb b/spree/emails/app/views/spree/vendor_mailer/suspended_email.text.erbnew file mode 100644index 0000000000..4087f46841--- /dev/null+++ b/spree/emails/app/views/spree/vendor_mailer/suspended_email.text.erb@@ -0,0 +1,7 @@+<%= Spree.t('vendor_mailer.greeting', vendor_name: @vendor.name) %>++<%= Spree.t('vendor_mailer.suspended_email.message', store_name: current_store.name) %>++<%= Spree.t('vendor_mailer.get_in_touch', store_email: current_store.mail_from_address) %>++<%= Spree.t('order_mailer.store_team', store_name: current_store.name) %>diff --git a/spree/emails/lib/spree/emails/engine.rb b/spree/emails/lib/spree/emails/engine.rbindex 521e2d175f..643323bd62 100644--- a/spree/emails/lib/spree/emails/engine.rb+++ b/spree/emails/lib/spree/emails/engine.rb@@ -24,7 +24,8 @@ module SpreeSpree::FulfillmentEmailSubscriber,Spree::ReturnEmailSubscriber,Spree::NewsletterSubscriberEmailSubscriber,- Spree::CustomerEmailSubscriber+ Spree::CustomerEmailSubscriber,+ Spree::VendorEmailSubscriber]endenddiff --git a/spree/emails/spec/mailers/spree/vendor_mailer_spec.rb b/spree/emails/spec/mailers/spree/vendor_mailer_spec.rbnew file mode 100644index 0000000000..c0a7b42dde--- /dev/null+++ b/spree/emails/spec/mailers/spree/vendor_mailer_spec.rb@@ -0,0 +1,70 @@+# frozen_string_literal: true++require 'spec_helper'++RSpec.describe Spree::VendorMailer do+ let(:store) { create(:store, name: 'Sparks Marketplace') }+ let(:vendor) { create(:vendor, store: store, name: 'Sparks Audio', contact_email: '[email protected]') }++ describe '#approved_email' do+ subject(:message) { described_class.approved_email(vendor.id) }++ it 'tells the seller they can trade' do+ expect(message.subject).to include('Sparks Marketplace')+ expect(message.to).to eq(['[email protected]'])+ expect(message.body.encoded).to include('Sparks Audio')+ end++ it 'points them at the dashboard they sign in to' do+ expect(message.body.encoded).to include(Spree::Stores::DashboardUrl.call(store: store))+ end+ end++ describe '#suspended_email' do+ subject(:message) { described_class.suspended_email(vendor.id) }++ it 'tells the seller selling has stopped, and how to reach the operator' do+ expect(message.to).to eq(['[email protected]'])+ expect(message.body.encoded).to include(store.mail_from_address)+ end++ # The operator's note is an internal record — a suspended seller is asked to+ # get in touch rather than handed the verdict verbatim.+ it 'does not leak the operator note' do+ vendor.update!(metadata: { 'suspension_reason' => 'Counterfeit goods' })++ expect(message.body.encoded).not_to include('Counterfeit goods')+ end+ end++ describe '#rejected_email' do+ subject(:message) { described_class.rejected_email(vendor.id) }++ it 'tells the applicant they were not admitted' do+ expect(message.to).to eq(['[email protected]'])+ expect(message.body.encoded).to include('Sparks Audio')+ end++ it 'does not leak the operator note' do+ vendor.update!(metadata: { 'rejection_reason' => 'Incomplete paperwork' })++ expect(message.body.encoded).not_to include('Incomplete paperwork')+ end+ end++ describe 'recipients' do+ it 'reaches the whole team plus the contact address' do+ member = create(:admin_user, email: '[email protected]')+ vendor.add_user(member)++ expect(described_class.approved_email(vendor.id).to).+ to match_array(['[email protected]', '[email protected]'])+ end++ it 'does not send at all when there is nobody to tell' do+ vendor.update!(contact_email: nil)++ expect(described_class.approved_email(vendor.id).to).to be_blank+ end+ end+enddiff --git a/spree/emails/spec/subscribers/spree/vendor_email_subscriber_spec.rb b/spree/emails/spec/subscribers/spree/vendor_email_subscriber_spec.rbnew file mode 100644index 0000000000..89f0d02dee--- /dev/null+++ b/spree/emails/spec/subscribers/spree/vendor_email_subscriber_spec.rb@@ -0,0 +1,90 @@+# frozen_string_literal: true++require 'spec_helper'++RSpec.describe Spree::VendorEmailSubscriber do+ let(:store) { create(:store) }+ let(:vendor) { create(:vendor, store: store, contact_email: '[email protected]') }+ let(:subscriber) { described_class.new }++ # The `on` DSL routes through `call` by event name.+ def mock_event(record, name)+ double('Event', name: name, payload: { 'id' => record.prefixed_id },+ matches?: false)+ end++ before do+ store.update!(preferences: store.preferences.merge(send_vendor_transactional_emails: true))+ end++ describe 'vendor.approved event' do+ it 'sends the approved email' do+ expect(Spree::VendorMailer).to receive(:approved_email).with(vendor.id).+ and_return(double(deliver_later: true))++ subscriber.call(mock_event(vendor, 'vendor.approved'))+ end++ # Sellers are a different audience from shoppers, so silencing customer+ # receipts must not silence seller mail, and vice versa.+ context 'when the store does not prefer vendor transactional emails' do+ before do+ store.update!(preferences: store.preferences.merge(send_vendor_transactional_emails: false))+ end++ it 'sends nothing' do+ expect(Spree::VendorMailer).not_to receive(:approved_email)++ subscriber.call(mock_event(vendor, 'vendor.approved'))+ end+ end++ context 'when the consumer preference alone is off' do+ before do+ store.update!(preferences: store.preferences.merge(send_consumer_transactional_emails: false))+ end++ it 'still tells the vendor' do+ expect(Spree::VendorMailer).to receive(:approved_email).and_return(double(deliver_later: true))++ subscriber.call(mock_event(vendor, 'vendor.approved'))+ end+ end++ context 'when the vendor is gone' do+ it 'does not raise' do+ event = mock_event(vendor, 'vendor.approved')+ vendor.destroy++ expect { subscriber.call(event) }.not_to raise_error+ end+ end+ end++ describe 'vendor.suspended event' do+ it 'sends the suspended email' do+ expect(Spree::VendorMailer).to receive(:suspended_email).with(vendor.id).+ and_return(double(deliver_later: true))++ subscriber.call(mock_event(vendor, 'vendor.suspended'))+ end+ end++ describe 'vendor.rejected event' do+ it 'sends the rejected email' do+ expect(Spree::VendorMailer).to receive(:rejected_email).with(vendor.id).+ and_return(double(deliver_later: true))++ subscriber.call(mock_event(vendor, 'vendor.rejected'))+ end+ end++ # Inviting a vendor creates an Invitation, which mails the invitee through+ # InvitationEmailSubscriber. A vendor.invited email would be a second message+ # to the same address about the same thing.+ describe 'vendor.invited event' do+ it 'is not subscribed to' do+ expect(described_class.subscription_patterns).not_to include('vendor.invited')+ end+ end+enddiff --git a/spree/emails/spec/subscribers/spree/vendor_lifecycle_emails_spec.rb b/spree/emails/spec/subscribers/spree/vendor_lifecycle_emails_spec.rbnew file mode 100644index 0000000000..3eba9459d2--- /dev/null+++ b/spree/emails/spec/subscribers/spree/vendor_lifecycle_emails_spec.rb@@ -0,0 +1,65 @@+# frozen_string_literal: true++require 'spec_helper'++# The unit specs mock the event. This one drives the real workflows, so a+# transition that stops publishing its event — or a subscriber left out of the+# engine's registration list — fails here rather than going quietly unnoticed.+RSpec.describe 'vendor lifecycle emails', events: true do+ let(:store) { create(:store) }+ let(:vendor) do+ create(:vendor, store: store, contact_email: '[email protected]', status: 'ready_for_review')+ end++ it 'tells the seller when they are approved' do+ perform_enqueued_jobs do+ expect { Spree::Vendors::Approve.call(vendor: vendor) }.+ to change { ActionMailer::Base.deliveries.count }.by(1)+ end++ mail = ActionMailer::Base.deliveries.last+ expect(mail.to).to eq(['[email protected]'])+ expect(mail.subject).to include(store.name)+ end++ it 'tells the seller when they are suspended' do+ vendor.update!(status: 'approved')++ perform_enqueued_jobs do+ expect { Spree::Vendors::Suspend.call(vendor: vendor, reason: 'Counterfeit goods') }.+ to change { ActionMailer::Base.deliveries.count }.by(1)+ end++ # The reason is an internal record, not something the seller is handed.+ expect(ActionMailer::Base.deliveries.last.body.encoded).not_to include('Counterfeit goods')+ end++ it 'tells the applicant when they are rejected' do+ perform_enqueued_jobs do+ expect { Spree::Vendors::Reject.call(vendor: vendor) }.+ to change { ActionMailer::Base.deliveries.count }.by(1)+ end+ end++ it 'sends nothing when the store has vendor emails switched off' do+ store.update!(preferences: store.preferences.merge(send_vendor_transactional_emails: false))++ perform_enqueued_jobs do+ expect { Spree::Vendors::Approve.call(vendor: vendor) }.+ not_to change { ActionMailer::Base.deliveries.count }+ end+ end++ # Inviting already mails through the invitation rail; a vendor email here+ # would be the same news twice.+ it 'sends exactly one email when a vendor is invited' do+ pending_vendor = create(:vendor, store: store, contact_email: '[email protected]')++ perform_enqueued_jobs do+ expect do+ Spree::Vendors::Invite.call(vendor: pending_vendor, email: '[email protected]',+ inviter: create(:admin_user))+ end.to change { ActionMailer::Base.deliveries.count }.by(1)+ end+ end+end