Skip to content

armgit / spree

Public Imported from GitHub
0

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.

[SD-1480] Platform API - Promotions (#11398)

Matthew Kennedy15270d8ba8da
diff --git a/api/app/controllers/concerns/spree/api/v2/platform/promotion_calculator_params.rb b/api/app/controllers/concerns/spree/api/v2/platform/promotion_calculator_params.rb
new file mode 100644
index 0000000000..c8d4925021
--- /dev/null
+++ b/api/app/controllers/concerns/spree/api/v2/platform/promotion_calculator_params.rb
@@ -0,0 +1,17 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ module PromotionCalculatorParams
+ private
+
+ def calculator_params
+ [:preferred_flat_percent, :preferred_amount, :preferred_first_item, :preferred_additional_item,
+ :preferred_max_items, :preferred_percent, :preferred_minimal_amount, :preferred_normal_amount,
+ :preferred_discount_amount, :preferred_currency, :preferred_base_amount, :preferred_base_percent, { preferred_tiers: {} }]
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/controllers/concerns/spree/api/v2/platform/promotion_rule_params.rb b/api/app/controllers/concerns/spree/api/v2/platform/promotion_rule_params.rb
new file mode 100644
index 0000000000..aa60af94af
--- /dev/null
+++ b/api/app/controllers/concerns/spree/api/v2/platform/promotion_rule_params.rb
@@ -0,0 +1,16 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ module PromotionRuleParams
+ private
+
+ def rule_params
+ [:preferred_match_policy, :preferred_country_id, :preferred_amount_min, :preferred_operator_min, :preferred_amount_max,
+ :preferred_operator_max, { taxon_ids: [], user_ids: [], product_ids: [], preferred_eligible_values: {} }]
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/controllers/spree/api/v2/platform/promotion_actions_controller.rb b/api/app/controllers/spree/api/v2/platform/promotion_actions_controller.rb
new file mode 100644
index 0000000000..3483973b50
--- /dev/null
+++ b/api/app/controllers/spree/api/v2/platform/promotion_actions_controller.rb
@@ -0,0 +1,30 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ class PromotionActionsController < ResourceController
+ include ::Spree::Api::V2::Platform::PromotionCalculatorParams
+
+ private
+
+ def model_class
+ Spree::PromotionAction
+ end
+
+ def scope_includes
+ [:promotion]
+ end
+
+ def spree_permitted_attributes
+ conditional_params = action_name == 'update' ? [:id] : []
+
+ super + [{
+ promotion_action_line_items_attributes: Spree::PromotionActionLineItem.json_api_permitted_attributes.concat(conditional_params),
+ calculator_attributes: Spree::Calculator.json_api_permitted_attributes.concat(conditional_params, calculator_params)
+ }]
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/controllers/spree/api/v2/platform/promotion_rules_controller.rb b/api/app/controllers/spree/api/v2/platform/promotion_rules_controller.rb
new file mode 100644
index 0000000000..7a8a5fbdd9
--- /dev/null
+++ b/api/app/controllers/spree/api/v2/platform/promotion_rules_controller.rb
@@ -0,0 +1,25 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ class PromotionRulesController < ResourceController
+ include ::Spree::Api::V2::Platform::PromotionRuleParams
+
+ private
+
+ def model_class
+ Spree::PromotionRule
+ end
+
+ def scope_includes
+ [:promotion]
+ end
+
+ def spree_permitted_attributes
+ super + rule_params
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/controllers/spree/api/v2/platform/promotions_controller.rb b/api/app/controllers/spree/api/v2/platform/promotions_controller.rb
new file mode 100644
index 0000000000..7d3ea3cb7a
--- /dev/null
+++ b/api/app/controllers/spree/api/v2/platform/promotions_controller.rb
@@ -0,0 +1,31 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ class PromotionsController < ResourceController
+ include ::Spree::Api::V2::Platform::PromotionRuleParams
+ include ::Spree::Api::V2::Platform::PromotionCalculatorParams
+
+ private
+
+ def model_class
+ Spree::Promotion
+ end
+
+ def scope_includes
+ [:promotion_category, :promotion_rules, :promotion_actions]
+ end
+
+ def spree_permitted_attributes
+ conditional_params = action_name == 'update' ? [:id] : []
+
+ super + [{ promotion_actions_attributes: Spree::PromotionAction.json_api_permitted_attributes.concat(conditional_params) + [{
+ promotion_action_line_items_attributes: Spree::PromotionActionLineItem.json_api_permitted_attributes.concat(conditional_params),
+ calculator_attributes: Spree::Calculator.json_api_permitted_attributes.concat(conditional_params, calculator_params)
+ }], promotion_rules_attributes: Spree::PromotionRule.json_api_permitted_attributes.concat(conditional_params, rule_params) }]
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/serializers/spree/api/v2/platform/promotion_action_line_item_serializer.rb b/api/app/serializers/spree/api/v2/platform/promotion_action_line_item_serializer.rb
new file mode 100644
index 0000000000..ee11f832cc
--- /dev/null
+++ b/api/app/serializers/spree/api/v2/platform/promotion_action_line_item_serializer.rb
@@ -0,0 +1,14 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ class PromotionActionLineItemSerializer < BaseSerializer
+ include ResourceSerializerConcern
+
+ belongs_to :promotion_action
+ belongs_to :variant
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/serializers/spree/api/v2/platform/promotion_action_serializer.rb b/api/app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
index 77dad9be2a..78b62d705c 100644
--- a/api/app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
+++ b/api/app/serializers/spree/api/v2/platform/promotion_action_serializer.rb
@@ -6,6 +6,12 @@ module Spree
include ResourceSerializerConcern
belongs_to :promotion
+
+ # Some promotion actions have a :calculator, while others do not.
+ has_one :calculator, if: proc { |record| record.respond_to?(:calculator) }
+
+ # Only the CreateLineItems promotion action uses :promotion_action_line_items.
+ has_many :promotion_action_line_items, if: proc { |record| record.respond_to?(:promotion_action_line_items) }
end
end
end
diff --git a/api/app/serializers/spree/api/v2/platform/promotion_rule_serializer.rb b/api/app/serializers/spree/api/v2/platform/promotion_rule_serializer.rb
index fe76c610d2..c896abad06 100644
--- a/api/app/serializers/spree/api/v2/platform/promotion_rule_serializer.rb
+++ b/api/app/serializers/spree/api/v2/platform/promotion_rule_serializer.rb
@@ -5,7 +5,15 @@ module Spree
class PromotionRuleSerializer < BaseSerializer
include ResourceSerializerConcern
+ attribute :preferences do |promotion_rule|
+ promotion_rule.preferences
+ end
+
belongs_to :promotion
+
+ has_many :products, through: :product_promotion_rules, if: proc { |record| record.respond_to?(:product_promotion_rules) }
+ has_many :users, through: :promotion_rule_users, if: proc { |record| record.respond_to?(:promotion_rule_users) }
+ has_many :taxons, through: :promotion_rule_taxons, if: proc { |record| record.respond_to?(:promotion_rule_taxons) }
end
end
end
diff --git a/api/app/serializers/spree/api/v2/platform/promotion_serializer.rb b/api/app/serializers/spree/api/v2/platform/promotion_serializer.rb
index eac7b80385..fab9807075 100644
--- a/api/app/serializers/spree/api/v2/platform/promotion_serializer.rb
+++ b/api/app/serializers/spree/api/v2/platform/promotion_serializer.rb
@@ -9,6 +9,7 @@ module Spree
has_many :promotion_rules
has_many :promotion_actions
+ has_many :stores
end
end
end
diff --git a/api/config/routes.rb b/api/config/routes.rb
index ffb59b5cbb..e63e79811c 100644
--- a/api/config/routes.rb
+++ b/api/config/routes.rb
@@ -187,7 +187,9 @@ Spree::Core::Engine.add_routes do
namespace :platform do
# Promotions API
resources :promotions
+ resources :promotion_actions
resources :promotion_categories
+ resources :promotion_rules
# Returns API
resources :customer_returns
@@ -286,10 +288,8 @@ Spree::Core::Engine.add_routes do
end
end
- # CMS Pages API
+ # CMS
resources :cms_pages
-
- # CMS Sections API
resources :cms_sections
# Wishlists API
diff --git a/api/docs/v2/platform/index.yaml b/api/docs/v2/platform/index.yaml
index b002bfbc14..2c6970cd60 100644
--- a/api/docs/v2/platform/index.yaml
+++ b/api/docs/v2/platform/index.yaml
@@ -70,8 +70,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-11-10T10:23:17.012Z'
- updated_at: '2021-11-10T10:23:17.012Z'
+ created_at: '2021-11-11T12:51:01.357Z'
+ updated_at: '2021-11-11T12:51:01.357Z'
deleted_at:
label:
public_metadata: {}
@@ -100,8 +100,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-11-10T10:23:17.018Z'
- updated_at: '2021-11-10T10:23:17.018Z'
+ created_at: '2021-11-11T12:51:01.362Z'
+ updated_at: '2021-11-11T12:51:01.362Z'
deleted_at:
label:
public_metadata: {}
@@ -177,8 +177,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-11-10T10:23:17.416Z'
- updated_at: '2021-11-10T10:23:17.416Z'
+ created_at: '2021-11-11T12:51:01.611Z'
+ updated_at: '2021-11-11T12:51:01.611Z'
deleted_at:
label:
public_metadata: {}
@@ -274,8 +274,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-11-10T10:23:17.506Z'
- updated_at: '2021-11-10T10:23:17.506Z'
+ created_at: '2021-11-11T12:51:01.656Z'
+ updated_at: '2021-11-11T12:51:01.656Z'
deleted_at:
label:
public_metadata: {}
@@ -356,8 +356,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-11-10T10:23:17.631Z'
- updated_at: '2021-11-10T10:23:17.644Z'
+ created_at: '2021-11-11T12:51:01.733Z'
+ updated_at: '2021-11-11T12:51:01.741Z'
deleted_at:
label:
public_metadata: {}
@@ -503,8 +503,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-11-10T10:23:18.092Z'
- updated_at: '2021-11-10T10:23:18.092Z'
+ created_at: '2021-11-11T12:51:02.001Z'
+ updated_at: '2021-11-11T12:51:02.001Z'
state: open
included: false
display_amount: "$100.00"
@@ -530,8 +530,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-11-10T10:23:18.137Z'
- updated_at: '2021-11-10T10:23:18.137Z'
+ created_at: '2021-11-11T12:51:02.023Z'
+ updated_at: '2021-11-11T12:51:02.023Z'
state: open
included: false
display_amount: "$100.00"
@@ -604,8 +604,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-11-10T10:23:18.580Z'
- updated_at: '2021-11-10T10:23:18.580Z'
+ created_at: '2021-11-11T12:51:02.362Z'
+ updated_at: '2021-11-11T12:51:02.362Z'
state: open
included: false
display_amount: "$100.00"
@@ -687,8 +687,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-11-10T10:23:18.920Z'
- updated_at: '2021-11-10T10:23:18.927Z'
+ created_at: '2021-11-11T12:51:02.492Z'
+ updated_at: '2021-11-11T12:51:02.498Z'
state: open
included: false
display_amount: "$1.00"
@@ -766,8 +766,8 @@ paths:
label: New label
mandatory:
eligible: true
- created_at: '2021-11-10T10:23:19.276Z'
- updated_at: '2021-11-10T10:23:19.297Z'
+ created_at: '2021-11-11T12:51:02.759Z'
+ updated_at: '2021-11-11T12:51:02.772Z'
state: open
included: false
display_amount: "$15.00"
@@ -907,8 +907,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-11-10T10:23:20.294Z'
- updated_at: '2021-11-10T10:23:20.294Z'
+ created_at: '2021-11-11T12:51:03.320Z'
+ updated_at: '2021-11-11T12:51:03.320Z'
relationships:
product:
data:
@@ -922,8 +922,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-11-10T10:23:20.412Z'
- updated_at: '2021-11-10T10:23:20.412Z'
+ created_at: '2021-11-11T12:51:03.399Z'
+ updated_at: '2021-11-11T12:51:03.399Z'
relationships:
product:
data:
@@ -984,8 +984,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-11-10T10:23:21.150Z'
- updated_at: '2021-11-10T10:23:21.150Z'
+ created_at: '2021-11-11T12:51:03.902Z'
+ updated_at: '2021-11-11T12:51:03.902Z'
relationships:
product:
data:
@@ -1052,8 +1052,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-11-10T10:23:21.433Z'
- updated_at: '2021-11-10T10:23:21.433Z'
+ created_at: '2021-11-11T12:51:04.077Z'
+ updated_at: '2021-11-11T12:51:04.077Z'
relationships:
product:
data:
@@ -1119,8 +1119,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-11-10T10:23:21.994Z'
- updated_at: '2021-11-10T10:23:21.994Z'
+ created_at: '2021-11-11T12:51:04.400Z'
+ updated_at: '2021-11-11T12:51:04.400Z'
relationships:
product:
data:
@@ -1207,90 +1207,6 @@ paths:
error: The access token is invalid
schema:
"$ref": "#/components/schemas/error"
- "/api/v2/platform/classifications/{id}/reposition":
- patch:
- summary: Reposition a Classification
- tags:
- - Classifications
- security:
- - bearer_auth: []
- operationId: reposition-classification
- description: Reposition a Classification
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- - name: include
- in: query
- description: 'Select which associated resources you would like to fetch, see:
- <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
- example: product,taxon
- schema:
- type: string
- responses:
- '200':
- description: Record updated
- content:
- application/vnd.api+json:
- examples:
- Example:
- value:
- data:
- id: '13'
- type: classification
- attributes:
- position: 2
- created_at: '2021-11-10T10:23:23.308Z'
- updated_at: '2021-11-10T10:23:23.340Z'
- relationships:
- product:
- data:
- id: '21'
- type: product
- taxon:
- data:
- id: '26'
- type: taxon
- schema:
- "$ref": "#/components/schemas/resource"
- '422':
- description: Invalid request
- content:
- application/vnd.api+json:
- examples:
- Example:
- value:
- error: is not a number
- errors: {}
- schema:
- "$ref": "#/components/schemas/validation_errors"
- '404':
- description: Record not found
- content:
- application/vnd.api+json:
- examples:
- Example:
- value:
- error: The resource you were looking for could not be found.
- schema:
- "$ref": "#/components/schemas/error"
- '401':
- description: Authentication Failed
- content:
- application/vnd.api+json:
- examples:
- Example:
- value:
- error: The access token is invalid
- schema:
- "$ref": "#/components/schemas/error"
- requestBody:
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/update_classification_params"
"/api/v2/platform/cms_pages":
get:
summary: Return a list of CMS Pages
@@ -1348,35 +1264,35 @@ paths:
- id: '1'
type: cms_page
attributes:
- title: Illo suscipit quasi nisi cumque.
+ title: Quia eius ratione fugit doloribus assumenda.
meta_title:
content:
meta_description:
visible: true
- slug: illo-suscipit-quasi-nisi-cumque
+ slug: quia-eius-ratione-fugit-doloribus-assumenda
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-11-10T10:23:23.966Z'
- updated_at: '2021-11-10T10:23:23.966Z'
+ created_at: '2021-11-11T12:51:05.098Z'
+ updated_at: '2021-11-11T12:51:05.098Z'
relationships:
cms_sections:
data: []
- id: '2'
type: cms_page
attributes:
- title: Voluptas neque et porro earum dolore cupiditate perferendis
- temporibus.
+ title: Quis officia tempora minus cupiditate ad repudiandae
+ ut.
meta_title:
content:
meta_description:
visible: true
- slug: voluptas-neque-et-porro-earum-dolore-cupiditate-perferendis-temporibus
+ slug: quis-officia-tempora-minus-cupiditate-ad-repudiandae-ut
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-11-10T10:23:23.971Z'
- updated_at: '2021-11-10T10:23:23.971Z'
+ created_at: '2021-11-11T12:51:05.102Z'
+ updated_at: '2021-11-11T12:51:05.102Z'
relationships:
cms_sections:
data: []
@@ -1430,18 +1346,18 @@ paths:
id: '5'
type: cms_page
attributes:
- title: Minus laboriosam iure eveniet consectetur voluptatum
- ratione sint soluta.
+ title: Optio recusandae officia sit sapiente asperiores mollitia
+ consectetur.
meta_title:
content:
meta_description:
visible: true
- slug: minus-laboriosam-iure-eveniet-consectetur-voluptatum-ratione-sint-soluta
+ slug: optio-recusandae-officia-sit-sapiente-asperiores-mollitia-consectetur
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-11-10T10:23:24.118Z'
- updated_at: '2021-11-10T10:23:24.118Z'
+ created_at: '2021-11-11T12:51:05.201Z'
+ updated_at: '2021-11-11T12:51:05.201Z'
relationships:
cms_sections:
data: []
@@ -1507,18 +1423,18 @@ paths:
id: '6'
type: cms_page
attributes:
- title: Delectus dolores ipsa magni saepe alias architecto
- ducimus.
+ title: Amet maxime veniam corrupti repellat eveniet veritatis
+ rem.
meta_title:
content:
meta_description:
visible: true
- slug: delectus-dolores-ipsa-magni-saepe-alias-architecto-ducimus
+ slug: amet-maxime-veniam-corrupti-repellat-eveniet-veritatis-rem
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-11-10T10:23:24.200Z'
- updated_at: '2021-11-10T10:23:24.200Z'
+ created_at: '2021-11-11T12:51:05.249Z'
+ updated_at: '2021-11-11T12:51:05.249Z'
relationships:
cms_sections:
data: []
@@ -1582,12 +1498,12 @@ paths:
content:
meta_description:
visible: true
- slug: omnis-ab-architecto-officia-vitae-iusto
+ slug: culpa-animi-tempore-quos-odio-odit
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-11-10T10:23:24.341Z'
- updated_at: '2021-11-10T10:23:24.356Z'
+ created_at: '2021-11-11T12:51:05.339Z'
+ updated_at: '2021-11-11T12:51:05.348Z'
relationships:
cms_sections:
data: []
@@ -1716,7 +1632,7 @@ paths:
- id: '1'
type: cms_section
attributes:
- name: Inventore atque ullam expedita facilis voluptate a.
+ name: Rerum veniam perferendis ipsa molestiae.
content: {}
settings:
gutters: No Gutters
@@ -1725,8 +1641,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 1
linked_resource_type: Spree::Taxon
- created_at: '2021-11-10T10:23:24.688Z'
- updated_at: '2021-11-10T10:23:24.688Z'
+ created_at: '2021-11-11T12:51:05.538Z'
+ updated_at: '2021-11-11T12:51:05.538Z'
relationships:
cms_page:
data:
@@ -1737,7 +1653,7 @@ paths:
- id: '2'
type: cms_section
attributes:
- name: Ipsa dolorem eveniet ipsum deleniti.
+ name: Saepe ea autem aut laborum.
content:
link_type_one: Spree::Taxon
link_type_two: Spree::Taxon
@@ -1749,8 +1665,8 @@ paths:
type: Spree::Cms::Sections::ImageGallery
position: 2
linked_resource_type:
- created_at: '2021-11-10T10:23:24.694Z'
- updated_at: '2021-11-10T10:23:24.694Z'
+ created_at: '2021-11-11T12:51:05.542Z'
+ updated_at: '2021-11-11T12:51:05.542Z'
relationships:
cms_page:
data:
@@ -1761,7 +1677,7 @@ paths:
- id: '3'
type: cms_section
attributes:
- name: Incidunt numquam corporis id dicta quidem sit.
+ name: Eveniet et quo debitis aliquam iure.
content: {}
settings:
gutters: No Gutters
@@ -1770,8 +1686,8 @@ paths:
type: Spree::Cms::Sections::FeaturedArticle
position: 3
linked_resource_type: Spree::Taxon
- created_at: '2021-11-10T10:23:24.707Z'
- updated_at: '2021-11-10T10:23:24.707Z'
+ created_at: '2021-11-11T12:51:05.551Z'
+ updated_at: '2021-11-11T12:51:05.551Z'
relationships:
cms_page:
data:
@@ -1782,7 +1698,7 @@ paths:
- id: '4'
type: cms_section
attributes:
- name: Harum ullam voluptatem autem illum quo.
+ name: Eos quos corrupti officia vel.
content: {}
settings:
gutters: No Gutters
@@ -1791,8 +1707,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-11-10T10:23:24.720Z'
- updated_at: '2021-11-10T10:23:24.720Z'
+ created_at: '2021-11-11T12:51:05.560Z'
+ updated_at: '2021-11-11T12:51:05.560Z'
relationships:
cms_page:
data:
@@ -1800,13 +1716,13 @@ paths:
type: cms_page
linked_resource:
data:
- id: '24'
+ id: '21'
type: product
- id: '5'
type: cms_section
attributes:
- name: Accusamus excepturi consequatur explicabo officiis rem
- occaecati consequuntur quod.
+ name: Dolores cumque nam accusamus saepe ipsam voluptatem
+ dignissimos.
content: {}
settings:
gutters: No Gutters
@@ -1815,8 +1731,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 5
linked_resource_type: Spree::Product
- created_at: '2021-11-10T10:23:24.733Z'
- updated_at: '2021-11-10T10:23:24.733Z'
+ created_at: '2021-11-11T12:51:05.567Z'
+ updated_at: '2021-11-11T12:51:05.567Z'
relationships:
cms_page:
data:
@@ -1824,7 +1740,7 @@ paths:
type: cms_page
linked_resource:
data:
- id: '24'
+ id: '21'
type: product
meta:
count: 5
@@ -1876,8 +1792,7 @@ paths:
id: '13'
type: cms_section
attributes:
- name: Itaque recusandae distinctio voluptas inventore architecto
- sequi enim et.
+ name: Laboriosam asperiores eaque earum quos corrupti.
content: {}
settings:
gutters: No Gutters
@@ -1886,8 +1801,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 3
linked_resource_type: Spree::Product
- created_at: '2021-11-10T10:23:25.050Z'
- updated_at: '2021-11-10T10:23:25.050Z'
+ created_at: '2021-11-11T12:51:05.722Z'
+ updated_at: '2021-11-11T12:51:05.722Z'
relationships:
cms_page:
data:
@@ -1895,7 +1810,7 @@ paths:
type: cms_page
linked_resource:
data:
- id: '26'
+ id: '23'
type: product
schema:
"$ref": "#/components/schemas/resource"
@@ -1962,8 +1877,7 @@ paths:
id: '19'
type: cms_section
attributes:
- name: Fugiat eos laudantium fugit laborum delectus unde voluptatibus
- corporis.
+ name: Delectus ducimus facere earum dignissimos illo quos.
content: {}
settings:
gutters: No Gutters
@@ -1972,8 +1886,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-11-10T10:23:25.330Z'
- updated_at: '2021-11-10T10:23:25.330Z'
+ created_at: '2021-11-11T12:51:05.863Z'
+ updated_at: '2021-11-11T12:51:05.863Z'
relationships:
cms_page:
data:
@@ -1981,7 +1895,7 @@ paths:
type: cms_page
linked_resource:
data:
- id: '28'
+ id: '25'
type: product
schema:
"$ref": "#/components/schemas/resource"
@@ -2047,8 +1961,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 1
linked_resource_type: Spree::Product
- created_at: '2021-11-10T10:23:25.698Z'
- updated_at: '2021-11-10T10:23:25.716Z'
+ created_at: '2021-11-11T12:51:06.072Z'
+ updated_at: '2021-11-11T12:51:06.082Z'
relationships:
cms_page:
data:
@@ -2056,7 +1970,7 @@ paths:
type: cms_page
linked_resource:
data:
- id: '31'
+ id: '28'
type: product
schema:
"$ref": "#/components/schemas/resource"
@@ -2159,7 +2073,7 @@ paths:
Example:
value:
data:
- - id: '76'
+ - id: '72'
type: country
attributes:
iso_name: UNITED STATES
@@ -2168,13 +2082,13 @@ paths:
name: United States of America
numcode: 840
states_required: true
- updated_at: '2021-11-10T10:23:26.514Z'
+ updated_at: '2021-11-11T12:51:06.530Z'
zipcode_required: true
- created_at: '2021-11-10T10:23:26.514Z'
+ created_at: '2021-11-11T12:51:06.530Z'
relationships:
states:
data: []
- - id: '77'
+ - id: '73'
type: country
attributes:
iso_name: ISO_NAME_2
@@ -2183,13 +2097,13 @@ paths:
name: NAME_2
numcode: 840
states_required: false
- updated_at: '2021-11-10T10:23:26.522Z'
+ updated_at: '2021-11-11T12:51:06.536Z'
zipcode_required: true
- created_at: '2021-11-10T10:23:26.522Z'
+ created_at: '2021-11-11T12:51:06.536Z'
relationships:
states:
data: []
- - id: '78'
+ - id: '74'
type: country
attributes:
iso_name: ISO_NAME_3
@@ -2198,9 +2112,9 @@ paths:
name: NAME_3
numcode: 840
states_required: false
- updated_at: '2021-11-10T10:23:26.525Z'
+ updated_at: '2021-11-11T12:51:06.538Z'
zipcode_required: true
- created_at: '2021-11-10T10:23:26.525Z'
+ created_at: '2021-11-11T12:51:06.538Z'
relationships:
states:
data: []
@@ -2250,7 +2164,7 @@ paths:
Example:
value:
data:
- id: '83'
+ id: '79'
type: country
attributes:
iso_name: ISO_NAME_6
@@ -2259,9 +2173,9 @@ paths:
name: NAME_6
numcode: 840
states_required: false
- updated_at: '2021-11-10T10:23:26.618Z'
+ updated_at: '2021-11-11T12:51:06.594Z'
zipcode_required: true
- created_at: '2021-11-10T10:23:26.618Z'
+ created_at: '2021-11-11T12:51:06.594Z'
relationships:
states:
data: []
@@ -2319,7 +2233,7 @@ paths:
- id: '1'
type: digital_link
attributes:
- token: 17hry8MUF4s3fBUwvWyaTnrt
+ token: vu2iRAKLUqs36934ghSd3mGA
access_counter: 0
relationships:
digital:
@@ -2333,7 +2247,7 @@ paths:
- id: '2'
type: digital_link
attributes:
- token: dJdvtaGrzbqLZLjiuBRkiF8B
+ token: uU33138ukUuojfrRKtMxLHDS
access_counter: 0
relationships:
digital:
@@ -2387,7 +2301,7 @@ paths:
id: '5'
type: digital_link
attributes:
- token: 5sJVmC7rt6ccWfwi7oPTYoru
+ token: NTeu15gx9m4gqkdn6WM5RoQz
access_counter: 0
relationships:
digital:
@@ -2450,7 +2364,7 @@ paths:
id: '6'
type: digital_link
attributes:
- token: kGKmBnBwawUSLsXomxy9wXU8
+ token: 7gAyPuDzeZVH49HRLdJE9qm5
access_counter: 0
relationships:
digital:
@@ -2509,7 +2423,7 @@ paths:
id: '8'
type: digital_link
attributes:
- token: CLJKuW94Ts1qdq1UKYxWVZUf
+ token: Xf1q5iVc8pXXDFvyQ2KXCQ9d
access_counter: 0
relationships:
digital:
@@ -2624,7 +2538,7 @@ paths:
id: '13'
type: digital_link
attributes:
- token: fJvUgUcL81H7fnV3YmqracUX
+ token: 2pofAgmjtWPPSjUgig1fTieE
access_counter: 0
relationships:
digital:
@@ -2696,38 +2610,38 @@ paths:
- id: '15'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBJdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7ac8dcb37c96a4aca073d1927c8eeeb618ff6eea/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBJQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--860ca15629ebc5f4d7441da41871a108b0e7dd78/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
relationships:
variant:
data:
- id: '83'
+ id: '80'
type: variant
- id: '16'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--2bed42da1cfe85dd996652aae4378a073707efef/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBJUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cd93a7a24c8e65c57c89fe4b61067eef9963ac27/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
relationships:
variant:
data:
- id: '85'
+ id: '82'
type: variant
- id: '17'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--c3b9068ac0937fbddad7b697025a1ed8fb35b432/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBJZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5befa7aa2ac6959a986630ab7a10284c477bc956/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
relationships:
variant:
data:
- id: '87'
+ id: '84'
type: variant
meta:
count: 3
@@ -2779,14 +2693,14 @@ paths:
id: '24'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--3cccec0e4622c62696afe0cb299448c98bf619c6/icon_256x256.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBLUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--79a82443400f89bfd0c4afca948b4ce6c4078dd9/icon_256x256.jpg"
content_type: image/png
filename: icon_256x256.jpg
byte_size: 818
relationships:
variant:
data:
- id: '97'
+ id: '94'
type: variant
schema:
"$ref": "#/components/schemas/resource"
@@ -2844,14 +2758,14 @@ paths:
id: '28'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBNQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--4aff9dfba2af0999a7906bad86308c0f5b03fd14/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--70b477b25f2dcbe20e93aae8a566cacdbc77c4f1/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
relationships:
variant:
data:
- id: '115'
+ id: '112'
type: variant
schema:
"$ref": "#/components/schemas/resource"
@@ -2908,14 +2822,14 @@ paths:
id: '36'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBPdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7727de02ef4b7abade21a8687b4b6858b6b690ad/icon_256x256.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBPQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--72942ec613f57abc1daeb6e7d478f782d9c58c26/icon_256x256.jpg"
content_type: image/png
filename: icon_256x256.jpg
byte_size: 818
relationships:
variant:
data:
- id: '137'
+ id: '134'
type: variant
schema:
"$ref": "#/components/schemas/resource"
@@ -3041,8 +2955,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-11-10T10:23:39.956Z'
- updated_at: '2021-11-10T10:23:39.968Z'
+ created_at: '2021-11-11T12:51:14.117Z'
+ updated_at: '2021-11-11T12:51:14.124Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3054,10 +2968,6 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
- display_price: "$10.00"
- single_display_amount: "$10.00"
- display_discounted_amount: "$10.00"
- display_total: "$10.00"
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
@@ -3066,6 +2976,10 @@ paths:
display_promo_total: "$0.00"
display_included_tax_total: "$0.00"
display_pre_tax_amount: "$10.00"
+ display_price: "$10.00"
+ single_display_amount: "$10.00"
+ display_discounted_amount: "$10.00"
+ display_total: "$10.00"
relationships:
order:
data:
@@ -3073,11 +2987,11 @@ paths:
type: order
tax_category:
data:
- id: '73'
+ id: '70'
type: tax_category
variant:
data:
- id: '186'
+ id: '183'
type: variant
adjustments:
data: []
@@ -3090,8 +3004,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-11-10T10:23:40.027Z'
- updated_at: '2021-11-10T10:23:40.037Z'
+ created_at: '2021-11-11T12:51:14.154Z'
+ updated_at: '2021-11-11T12:51:14.158Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3103,10 +3017,6 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
- display_price: "$10.00"
- single_display_amount: "$10.00"
- display_discounted_amount: "$10.00"
- display_total: "$10.00"
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
@@ -3115,6 +3025,10 @@ paths:
display_promo_total: "$0.00"
display_included_tax_total: "$0.00"
display_pre_tax_amount: "$10.00"
+ display_price: "$10.00"
+ single_display_amount: "$10.00"
+ display_discounted_amount: "$10.00"
+ display_total: "$10.00"
relationships:
order:
data:
@@ -3122,11 +3036,11 @@ paths:
type: order
tax_category:
data:
- id: '73'
+ id: '70'
type: tax_category
variant:
data:
- id: '187'
+ id: '184'
type: variant
adjustments:
data: []
@@ -3186,8 +3100,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-11-10T10:23:40.437Z'
- updated_at: '2021-11-10T10:23:40.477Z'
+ created_at: '2021-11-11T12:51:14.466Z'
+ updated_at: '2021-11-11T12:51:14.511Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3199,10 +3113,6 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
- display_price: "$10.00"
- single_display_amount: "$10.00"
- display_discounted_amount: "$10.00"
- display_total: "$10.00"
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
@@ -3211,6 +3121,10 @@ paths:
display_promo_total: "$0.00"
display_included_tax_total: "$0.00"
display_pre_tax_amount: "$10.00"
+ display_price: "$10.00"
+ single_display_amount: "$10.00"
+ display_discounted_amount: "$10.00"
+ display_total: "$10.00"
relationships:
order:
data:
@@ -3218,11 +3132,11 @@ paths:
type: order
tax_category:
data:
- id: '75'
+ id: '72'
type: tax_category
variant:
data:
- id: '190'
+ id: '187'
type: variant
adjustments:
data: []
@@ -3291,8 +3205,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-11-10T10:23:40.722Z'
- updated_at: '2021-11-10T10:23:40.734Z'
+ created_at: '2021-11-11T12:51:14.669Z'
+ updated_at: '2021-11-11T12:51:14.676Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3304,10 +3218,6 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
- display_price: "$10.00"
- single_display_amount: "$10.00"
- display_discounted_amount: "$10.00"
- display_total: "$10.00"
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
@@ -3316,6 +3226,10 @@ paths:
display_promo_total: "$0.00"
display_included_tax_total: "$0.00"
display_pre_tax_amount: "$10.00"
+ display_price: "$10.00"
+ single_display_amount: "$10.00"
+ display_discounted_amount: "$10.00"
+ display_total: "$10.00"
relationships:
order:
data:
@@ -3323,11 +3237,11 @@ paths:
type: order
tax_category:
data:
- id: '76'
+ id: '73'
type: tax_category
variant:
data:
- id: '191'
+ id: '188'
type: variant
adjustments:
data: []
@@ -3392,8 +3306,8 @@ paths:
attributes:
quantity: 4
price: '10.0'
- created_at: '2021-11-10T10:23:41.126Z'
- updated_at: '2021-11-10T10:23:41.193Z'
+ created_at: '2021-11-11T12:51:14.915Z'
+ updated_at: '2021-11-11T12:51:14.954Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3405,10 +3319,6 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
- display_price: "$10.00"
- single_display_amount: "$10.00"
- display_discounted_amount: "$40.00"
- display_total: "$40.00"
display_amount: "$40.00"
display_subtotal: "$40.00"
display_final_amount: "$40.00"
@@ -3417,6 +3327,10 @@ paths:
display_promo_total: "$0.00"
display_included_tax_total: "$0.00"
display_pre_tax_amount: "$40.00"
+ display_price: "$10.00"
+ single_display_amount: "$10.00"
+ display_discounted_amount: "$40.00"
+ display_total: "$40.00"
relationships:
order:
data:
@@ -3424,11 +3338,11 @@ paths:
type: order
tax_category:
data:
- id: '78'
+ id: '75'
type: tax_category
variant:
data:
- id: '195'
+ id: '192'
type: variant
adjustments:
data: []
@@ -3445,10 +3359,10 @@ paths:
examples:
Example:
value:
- error: 'Quantity selected of "Product #130 - 5861" is not available.'
+ error: 'Quantity selected of "Product #127 - 4668" is not available.'
errors:
quantity:
- - 'selected of "Product #130 - 5861" is not available.'
+ - 'selected of "Product #127 - 4668" is not available.'
schema:
"$ref": "#/components/schemas/validation_errors"
'404':
@@ -3568,8 +3482,8 @@ paths:
lft: 2
rgt: 3
depth: 1
- created_at: '2021-11-10T10:23:42.178Z'
- updated_at: '2021-11-10T10:23:42.185Z'
+ created_at: '2021-11-11T12:51:15.562Z'
+ updated_at: '2021-11-11T12:51:15.567Z'
link:
is_container: false
is_root: false
@@ -3578,7 +3492,7 @@ paths:
relationships:
icon:
data:
- id: '16'
+ id: '13'
type: icon
menu:
data:
@@ -3605,8 +3519,8 @@ paths:
lft: 4
rgt: 5
depth: 1
- created_at: '2021-11-10T10:23:42.270Z'
- updated_at: '2021-11-10T10:23:42.276Z'
+ created_at: '2021-11-11T12:51:15.620Z'
+ updated_at: '2021-11-11T12:51:15.625Z'
link:
is_container: false
is_root: false
@@ -3615,7 +3529,7 @@ paths:
relationships:
icon:
data:
- id: '17'
+ id: '14'
type: icon
menu:
data:
@@ -3642,8 +3556,8 @@ paths:
lft: 6
rgt: 7
depth: 1
- created_at: '2021-11-10T10:23:42.363Z'
- updated_at: '2021-11-10T10:23:42.370Z'
+ created_at: '2021-11-11T12:51:15.677Z'
+ updated_at: '2021-11-11T12:51:15.682Z'
link:
is_container: false
is_root: false
@@ -3652,7 +3566,7 @@ paths:
relationships:
icon:
data:
- id: '18'
+ id: '15'
type: icon
menu:
data:
@@ -3679,8 +3593,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-11-10T10:23:42.482Z'
- updated_at: '2021-11-10T10:23:42.489Z'
+ created_at: '2021-11-11T12:51:15.735Z'
+ updated_at: '2021-11-11T12:51:15.739Z'
link:
is_container: false
is_root: false
@@ -3689,7 +3603,7 @@ paths:
relationships:
icon:
data:
- id: '19'
+ id: '16'
type: icon
menu:
data:
@@ -3716,8 +3630,8 @@ paths:
lft: 10
rgt: 11
depth: 1
- created_at: '2021-11-10T10:23:42.577Z'
- updated_at: '2021-11-10T10:23:42.584Z'
+ created_at: '2021-11-11T12:51:15.791Z'
+ updated_at: '2021-11-11T12:51:15.796Z'
link:
is_container: false
is_root: false
@@ -3726,7 +3640,7 @@ paths:
relationships:
icon:
data:
- id: '20'
+ id: '17'
type: icon
menu:
data:
@@ -3753,8 +3667,8 @@ paths:
lft: 12
rgt: 13
depth: 1
- created_at: '2021-11-10T10:23:42.680Z'
- updated_at: '2021-11-10T10:23:42.687Z'
+ created_at: '2021-11-11T12:51:15.849Z'
+ updated_at: '2021-11-11T12:51:15.854Z'
link:
is_container: false
is_root: false
@@ -3763,7 +3677,7 @@ paths:
relationships:
icon:
data:
- id: '21'
+ id: '18'
type: icon
menu:
data:
@@ -3790,8 +3704,8 @@ paths:
lft: 14
rgt: 15
depth: 1
- created_at: '2021-11-10T10:23:42.774Z'
- updated_at: '2021-11-10T10:23:42.781Z'
+ created_at: '2021-11-11T12:51:15.907Z'
+ updated_at: '2021-11-11T12:51:15.911Z'
link:
is_container: false
is_root: false
@@ -3800,7 +3714,7 @@ paths:
relationships:
icon:
data:
- id: '22'
+ id: '19'
type: icon
menu:
data:
@@ -3817,7 +3731,7 @@ paths:
- id: '1'
type: menu_item
attributes:
- name: Vitae aspernatur natus necessitatibus deleniti tempore.
+ name: Sapiente impedit perferendis eos nihil dignissimos.
subtitle:
destination:
new_window: false
@@ -3827,8 +3741,8 @@ paths:
lft: 1
rgt: 16
depth: 0
- created_at: '2021-11-10T10:23:42.090Z'
- updated_at: '2021-11-10T10:23:42.795Z'
+ created_at: '2021-11-11T12:51:15.505Z'
+ updated_at: '2021-11-11T12:51:15.922Z'
link:
is_container: true
is_root: true
@@ -3921,8 +3835,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-11-10T10:23:43.948Z'
- updated_at: '2021-11-10T10:23:43.956Z'
+ created_at: '2021-11-11T12:51:16.602Z'
+ updated_at: '2021-11-11T12:51:16.606Z'
link:
is_container: false
is_root: false
@@ -4012,8 +3926,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-11-10T10:23:44.744Z'
- updated_at: '2021-11-10T10:23:44.750Z'
+ created_at: '2021-11-11T12:51:17.081Z'
+ updated_at: '2021-11-11T12:51:17.085Z'
link:
is_container: false
is_root: false
@@ -4022,7 +3936,7 @@ paths:
relationships:
icon:
data:
- id: '39'
+ id: '36'
type: icon
menu:
data:
@@ -4101,8 +4015,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-11-10T10:23:46.001Z'
- updated_at: '2021-11-10T10:23:46.044Z'
+ created_at: '2021-11-11T12:51:17.810Z'
+ updated_at: '2021-11-11T12:51:17.834Z'
link:
is_container: false
is_root: false
@@ -4111,7 +4025,7 @@ paths:
relationships:
icon:
data:
- id: '50'
+ id: '47'
type: icon
menu:
data:
@@ -4239,8 +4153,8 @@ paths:
lft: 5
rgt: 6
depth: 2
- created_at: '2021-11-10T10:23:49.028Z'
- updated_at: '2021-11-10T10:23:49.071Z'
+ created_at: '2021-11-11T12:51:19.595Z'
+ updated_at: '2021-11-11T12:51:19.621Z'
link:
is_container: false
is_root: false
@@ -4249,7 +4163,7 @@ paths:
relationships:
icon:
data:
- id: '76'
+ id: '73'
type: icon
menu:
data:
@@ -4344,8 +4258,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-11-10T10:23:49.895Z'
- updated_at: '2021-11-10T10:23:50.117Z'
+ created_at: '2021-11-11T12:51:20.112Z'
+ updated_at: '2021-11-11T12:51:20.228Z'
relationships:
menu_items:
data:
@@ -4361,8 +4275,8 @@ paths:
name: Footer Menu
location: footer
locale: en
- created_at: '2021-11-10T10:23:49.911Z'
- updated_at: '2021-11-10T10:23:50.319Z'
+ created_at: '2021-11-11T12:51:20.120Z'
+ updated_at: '2021-11-11T12:51:20.340Z'
relationships:
menu_items:
data:
@@ -4425,8 +4339,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-11-10T10:23:50.919Z'
- updated_at: '2021-11-10T10:23:50.927Z'
+ created_at: '2021-11-11T12:51:20.667Z'
+ updated_at: '2021-11-11T12:51:20.673Z'
relationships:
menu_items:
data:
@@ -4494,8 +4408,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-11-10T10:23:51.027Z'
- updated_at: '2021-11-10T10:23:51.036Z'
+ created_at: '2021-11-11T12:51:20.721Z'
+ updated_at: '2021-11-11T12:51:20.727Z'
relationships:
menu_items:
data:
@@ -4559,8 +4473,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-11-10T10:23:51.172Z'
- updated_at: '2021-11-10T10:23:51.182Z'
+ created_at: '2021-11-11T12:51:20.811Z'
+ updated_at: '2021-11-11T12:51:20.817Z'
relationships:
menu_items:
data:
@@ -4695,8 +4609,8 @@ paths:
name: foo-size-68
presentation: Size
position: 1
- created_at: '2021-11-10T10:23:51.538Z'
- updated_at: '2021-11-10T10:23:51.538Z'
+ created_at: '2021-11-11T12:51:21.010Z'
+ updated_at: '2021-11-11T12:51:21.010Z'
filterable: true
public_metadata: {}
private_metadata: {}
@@ -4709,8 +4623,8 @@ paths:
name: foo-size-69
presentation: Size
position: 2
- created_at: '2021-11-10T10:23:51.541Z'
- updated_at: '2021-11-10T10:23:51.541Z'
+ created_at: '2021-11-11T12:51:21.011Z'
+ updated_at: '2021-11-11T12:51:21.011Z'
filterable: true
public_metadata: {}
private_metadata: {}
@@ -4763,8 +4677,8 @@ paths:
name: foo-size-72
presentation: Size
position: 1
- created_at: '2021-11-10T10:23:51.654Z'
- updated_at: '2021-11-10T10:23:51.654Z'
+ created_at: '2021-11-11T12:51:21.078Z'
+ updated_at: '2021-11-11T12:51:21.078Z'
filterable: true
public_metadata: {}
private_metadata: {}
@@ -4823,8 +4737,8 @@ paths:
name: foo-size-73
presentation: Size
position: 1
- created_at: '2021-11-10T10:23:51.724Z'
- updated_at: '2021-11-10T10:23:51.724Z'
+ created_at: '2021-11-11T12:51:21.119Z'
+ updated_at: '2021-11-11T12:51:21.119Z'
filterable: true
public_metadata: {}
private_metadata: {}
@@ -4882,8 +4796,8 @@ paths:
name: Size-X
presentation: Size
position: 1
- created_at: '2021-11-10T10:23:51.843Z'
- updated_at: '2021-11-10T10:23:51.856Z'
+ created_at: '2021-11-11T12:51:21.189Z'
+ updated_at: '2021-11-11T12:51:21.196Z'
filterable: true
public_metadata: {}
private_metadata: {}
@@ -5021,8 +4935,8 @@ paths:
position: 1
name: Size-68
presentation: S
- created_at: '2021-11-10T10:23:52.110Z'
- updated_at: '2021-11-10T10:23:52.110Z'
+ created_at: '2021-11-11T12:51:21.349Z'
+ updated_at: '2021-11-11T12:51:21.349Z'
public_metadata: {}
private_metadata: {}
relationships:
@@ -5036,8 +4950,8 @@ paths:
position: 1
name: Size-69
presentation: S
- created_at: '2021-11-10T10:23:52.118Z'
- updated_at: '2021-11-10T10:23:52.118Z'
+ created_at: '2021-11-11T12:51:21.355Z'
+ updated_at: '2021-11-11T12:51:21.355Z'
public_metadata: {}
private_metadata: {}
relationships:
@@ -5098,8 +5012,8 @@ paths:
position: 1
name: Size-72
presentation: S
- created_at: '2021-11-10T10:23:52.234Z'
- updated_at: '2021-11-10T10:23:52.234Z'
+ created_at: '2021-11-11T12:51:21.427Z'
+ updated_at: '2021-11-11T12:51:21.427Z'
public_metadata: {}
private_metadata: {}
relationships:
@@ -5164,8 +5078,8 @@ paths:
position: 1
name: Size-73
presentation: S
- created_at: '2021-11-10T10:23:52.318Z'
- updated_at: '2021-11-10T10:23:52.318Z'
+ created_at: '2021-11-11T12:51:21.470Z'
+ updated_at: '2021-11-11T12:51:21.470Z'
public_metadata: {}
private_metadata: {}
relationships:
@@ -5231,8 +5145,8 @@ paths:
position: 1
name: M
presentation: S
- created_at: '2021-11-10T10:23:52.432Z'
- updated_at: '2021-11-10T10:23:52.449Z'
+ created_at: '2021-11-11T12:51:21.547Z'
+ updated_at: '2021-11-11T12:51:21.555Z'
public_metadata: {}
private_metadata: {}
relationships:
@@ -5362,7 +5276,7 @@ paths:
- id: '40'
type: order
attributes:
- number: R500945733
+ number: R310395771
item_total: '0.0'
total: '0.0'
state: cart
@@ -5371,10 +5285,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:52.732Z'
- updated_at: '2021-11-10T10:23:52.732Z'
+ created_at: '2021-11-11T12:51:21.733Z'
+ updated_at: '2021-11-11T12:51:21.733Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5405,11 +5319,11 @@ paths:
display_ship_total: "$0.00"
display_shipment_total: "$0.00"
display_total: "$0.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$0.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -5448,7 +5362,7 @@ paths:
- id: '41'
type: order
attributes:
- number: R357683875
+ number: R495949770
item_total: '0.0'
total: '0.0'
state: cart
@@ -5457,10 +5371,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:52.748Z'
- updated_at: '2021-11-10T10:23:52.748Z'
+ created_at: '2021-11-11T12:51:21.741Z'
+ updated_at: '2021-11-11T12:51:21.741Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5491,11 +5405,11 @@ paths:
display_ship_total: "$0.00"
display_shipment_total: "$0.00"
display_total: "$0.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$0.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -5581,7 +5495,7 @@ paths:
id: '44'
type: order
attributes:
- number: R601780530
+ number: R163806903
item_total: '0.0'
total: '0.0'
state: cart
@@ -5592,8 +5506,8 @@ paths:
payment_state:
email:
special_instructions:
- created_at: '2021-11-10T10:23:53.203Z'
- updated_at: '2021-11-10T10:23:53.237Z'
+ created_at: '2021-11-11T12:51:22.057Z'
+ updated_at: '2021-11-11T12:51:22.073Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5624,11 +5538,11 @@ paths:
display_ship_total: "$0.00"
display_shipment_total: "$0.00"
display_total: "$0.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$0.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -5709,7 +5623,7 @@ paths:
id: '45'
type: order
attributes:
- number: R104338192
+ number: R034858752
item_total: '10.0'
total: '110.0'
state: delivery
@@ -5718,10 +5632,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:53.311Z'
- updated_at: '2021-11-10T10:23:53.508Z'
+ created_at: '2021-11-11T12:51:22.128Z'
+ updated_at: '2021-11-11T12:51:22.283Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5752,11 +5666,11 @@ paths:
display_ship_total: "$100.00"
display_shipment_total: "$100.00"
display_total: "$110.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$110.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -5853,7 +5767,7 @@ paths:
id: '47'
type: order
attributes:
- number: R003036393
+ number: R667714444
item_total: '10.0'
total: '110.0'
state: delivery
@@ -5864,8 +5778,8 @@ paths:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:53.873Z'
- updated_at: '2021-11-10T10:23:54.072Z'
+ created_at: '2021-11-11T12:51:22.536Z'
+ updated_at: '2021-11-11T12:51:22.630Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5896,11 +5810,11 @@ paths:
display_ship_total: "$100.00"
display_shipment_total: "$100.00"
display_total: "$110.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$110.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -6053,7 +5967,7 @@ paths:
id: '52'
type: order
attributes:
- number: R065714264
+ number: R588438630
item_total: '10.0'
total: '110.0'
state: payment
@@ -6062,10 +5976,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:55.253Z'
- updated_at: '2021-11-10T10:23:55.487Z'
+ created_at: '2021-11-11T12:51:23.223Z'
+ updated_at: '2021-11-11T12:51:23.354Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6096,11 +6010,11 @@ paths:
display_ship_total: "$100.00"
display_shipment_total: "$100.00"
display_total: "$110.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$110.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -6200,7 +6114,7 @@ paths:
id: '54'
type: order
attributes:
- number: R060191781
+ number: R015429574
item_total: '10.0'
total: '110.0'
state: payment
@@ -6209,10 +6123,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:55.836Z'
- updated_at: '2021-11-10T10:23:56.040Z'
+ created_at: '2021-11-11T12:51:23.559Z'
+ updated_at: '2021-11-11T12:51:23.684Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6243,11 +6157,11 @@ paths:
display_ship_total: "$100.00"
display_shipment_total: "$100.00"
display_total: "$110.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$110.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -6347,19 +6261,19 @@ paths:
id: '56'
type: order
attributes:
- number: R446587388
+ number: R264305879
item_total: '10.0'
total: '110.0'
state: complete
adjustment_total: '0.0'
- completed_at: '2021-11-10T10:23:56.689Z'
+ completed_at: '2021-11-11T12:51:24.085Z'
payment_total: '0.0'
shipment_state: pending
payment_state: balance_due
special_instructions:
- created_at: '2021-11-10T10:23:56.345Z'
- updated_at: '2021-11-10T10:23:56.689Z'
+ created_at: '2021-11-11T12:51:23.867Z'
+ updated_at: '2021-11-11T12:51:24.085Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6390,11 +6304,11 @@ paths:
display_ship_total: "$100.00"
display_shipment_total: "$100.00"
display_total: "$110.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$110.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -6505,7 +6419,7 @@ paths:
id: '59'
type: order
attributes:
- number: R665557510
+ number: R009943242
item_total: '0.0'
total: '0.0'
state: cart
@@ -6514,10 +6428,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:57.265Z'
- updated_at: '2021-11-10T10:23:57.450Z'
+ created_at: '2021-11-11T12:51:24.398Z'
+ updated_at: '2021-11-11T12:51:24.500Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -6548,11 +6462,11 @@ paths:
display_ship_total: "$0.00"
display_shipment_total: "$0.00"
display_total: "$0.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$0.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -6647,7 +6561,7 @@ paths:
id: '61'
type: order
attributes:
- number: R138237251
+ number: R699753701
item_total: '10.0'
total: '110.0'
state: delivery
@@ -6656,10 +6570,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-11-10T10:23:57.757Z'
- updated_at: '2021-11-10T10:23:57.892Z'
+ created_at: '2021-11-11T12:51:24.679Z'
+ updated_at: '2021-11-11T12:51:24.756Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6690,11 +6604,11 @@ paths:
display_ship_total: "$100.00"
display_shipment_total: "$100.00"
display_total: "$110.00"
- display_total_applicable_store_credit: "$0.00"
- display_total_applied_store_credit: "$0.00"
display_order_total_after_store_credit: "$110.00"
display_total_available_store_credit: "$0.00"
display_store_credit_remaining_after_capture: "$0.00"
+ display_total_applicable_store_credit: "$0.00"
+ display_total_applied_store_credit: "$0.00"
relationships:
user:
data:
@@ -6962,8 +6876,8 @@ paths:
display_on: both
auto_capture:
position: 1
- created_at: '2021-11-10T10:24:00.553Z'
- updated_at: '2021-11-10T10:24:00.553Z'
+ created_at: '2021-11-11T12:51:26.416Z'
+ updated_at: '2021-11-11T12:51:26.416Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -6971,7 +6885,7 @@ paths:
relationships:
stores:
data:
- - id: '291'
+ - id: '287'
type: store
- id: '13'
type: payment_method
@@ -6983,8 +6897,8 @@ paths:
display_on: both
auto_capture:
position: 2
- created_at: '2021-11-10T10:24:00.566Z'
- updated_at: '2021-11-10T10:24:00.566Z'
+ created_at: '2021-11-11T12:51:26.422Z'
+ updated_at: '2021-11-11T12:51:26.422Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -6992,7 +6906,7 @@ paths:
relationships:
stores:
data:
- - id: '291'
+ - id: '287'
type: store
- id: '14'
type: payment_method
@@ -7004,8 +6918,8 @@ paths:
display_on: both
auto_capture:
position: 3
- created_at: '2021-11-10T10:24:00.573Z'
- updated_at: '2021-11-10T10:24:00.573Z'
+ created_at: '2021-11-11T12:51:26.426Z'
+ updated_at: '2021-11-11T12:51:26.426Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -7013,7 +6927,7 @@ paths:
relationships:
stores:
data:
- - id: '291'
+ - id: '287'
type: store
- id: '15'
type: payment_method
@@ -7025,8 +6939,8 @@ paths:
display_on: both
auto_capture:
position: 4
- created_at: '2021-11-10T10:24:00.579Z'
- updated_at: '2021-11-10T10:24:00.579Z'
+ created_at: '2021-11-11T12:51:26.429Z'
+ updated_at: '2021-11-11T12:51:26.429Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -7037,7 +6951,7 @@ paths:
relationships:
stores:
data:
- - id: '291'
+ - id: '287'
type: store
- id: '16'
type: payment_method
@@ -7049,8 +6963,8 @@ paths:
display_on: both
auto_capture:
position: 5
- created_at: '2021-11-10T10:24:00.586Z'
- updated_at: '2021-11-10T10:24:00.586Z'
+ created_at: '2021-11-11T12:51:26.433Z'
+ updated_at: '2021-11-11T12:51:26.433Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -7061,7 +6975,7 @@ paths:
relationships:
stores:
data:
- - id: '291'
+ - id: '287'
type: store
meta:
count: 5
@@ -7120,8 +7034,8 @@ paths:
display_on: both
auto_capture:
position: 3
- created_at: '2021-11-10T10:24:00.783Z'
- updated_at: '2021-11-10T10:24:00.783Z'
+ created_at: '2021-11-11T12:51:26.545Z'
+ updated_at: '2021-11-11T12:51:26.545Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -7132,9 +7046,9 @@ paths:
relationships:
stores:
data:
- - id: '295'
+ - id: '291'
type: store
- - id: '296'
+ - id: '292'
type: store
schema:
"$ref": "#/components/schemas/resource"
@@ -7197,8 +7111,8 @@ paths:
display_on: both
auto_capture:
position: 4
- created_at: '2021-11-10T10:24:00.926Z'
- updated_at: '2021-11-10T10:24:00.926Z'
+ created_at: '2021-11-11T12:51:26.636Z'
+ updated_at: '2021-11-11T12:51:26.636Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -7209,7 +7123,7 @@ paths:
relationships:
stores:
data:
- - id: '299'
+ - id: '295'
type: store
schema:
"$ref": "#/components/schemas/resource"
@@ -7273,8 +7187,8 @@ paths:
display_on: both
auto_capture:
position: 3
- created_at: '2021-11-10T10:24:01.150Z'
- updated_at: '2021-11-10T10:24:01.168Z'
+ created_at: '2021-11-11T12:51:26.758Z'
+ updated_at: '2021-11-11T12:51:26.772Z'
deleted_at:
public_metadata: {}
private_metadata: {}
@@ -7285,7 +7199,7 @@ paths:
relationships:
stores:
data:
- - id: '305'
+ - id: '301'
type: store
schema:
"$ref": "#/components/schemas/resource"
@@ -7422,9 +7336,9 @@ paths:
state: invalid
response_code: '12345'
avs_response:
- created_at: '2021-11-10T10:24:01.760Z'
- updated_at: '2021-11-10T10:24:01.796Z'
- number: PQF0WAC4
+ created_at: '2021-11-11T12:51:27.066Z'
+ updated_at: '2021-11-11T12:51:27.084Z'
+ number: PBSC4TY2
cvv_response_code:
cvv_response_message:
public_metadata: {}
@@ -7461,9 +7375,9 @@ paths:
state: checkout
response_code: '12345'
avs_response:
- created_at: '2021-11-10T10:24:01.791Z'
- updated_at: '2021-11-10T10:24:01.791Z'
- number: PGG2YR2B
+ created_at: '2021-11-11T12:51:27.081Z'
+ updated_at: '2021-11-11T12:51:27.081Z'
+ number: PVV8JV0C
cvv_response_code:
cvv_response_message:
public_metadata: {}
@@ -7551,9 +7465,9 @@ paths:
state: checkout
response_code: '12345'
avs_response:
- created_at: '2021-11-10T10:24:02.079Z'
- updated_at: '2021-11-10T10:24:02.079Z'
- number: PSMG59M1
+ created_at: '2021-11-11T12:51:27.263Z'
+ updated_at: '2021-11-11T12:51:27.263Z'
+ number: PH77SZTW
cvv_response_code:
cvv_response_message:
public_metadata: {}
@@ -7639,15 +7553,15 @@ paths:
error: The access token is invalid
schema:
"$ref": "#/components/schemas/error"
- "/api/v2/platform/promotion_categories":
+ "/api/v2/platform/promotion_actions":
get:
- summary: Return a list of Promotion Categories
+ summary: Return a list of Promotion Actions
tags:
- - Promotion Categories
+ - Promotion Actions
security:
- bearer_auth: []
- description: Returns a list of Promotion Categories
- operationId: promotion-categories-list
+ description: Returns a list of Promotion Actions
+ operationId: promotion-actions-list
parameters:
- name: page
in: query
@@ -7663,19 +7577,13 @@ paths:
in: query
description: 'Select which associated resources you would like to fetch, see:
<a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
- example: promotions
- schema:
- type: string
- - name: filter[code]
- in: query
- description: ''
- example: BLK-FRI
+ example: calculator
schema:
type: string
- - name: filter[name]
+ - name: filter[type_eq]
in: query
description: ''
- example: 2020 Promotions
+ example: Spree::Promotion::Actions::CreateAdjustment
schema:
type: string
responses:
@@ -7687,36 +7595,42 @@ paths:
Example:
value:
data:
- - id: '1'
- type: promotion_category
+ - id: '5'
+ type: promotion_action
attributes:
- name: Promotion Category
- created_at: '2021-11-10T10:24:02.511Z'
- updated_at: '2021-11-10T10:24:02.511Z'
- code: POP123
+ position:
+ type:
+ deleted_at:
+ created_at: '2021-11-11T12:51:27.495Z'
+ updated_at: '2021-11-11T12:51:27.495Z'
relationships:
- promotions:
- data: []
- - id: '2'
- type: promotion_category
+ promotion:
+ data:
+ id: '5'
+ type: promotion
+ - id: '6'
+ type: promotion_action
attributes:
- name: Promotion Category
- created_at: '2021-11-10T10:24:02.513Z'
- updated_at: '2021-11-10T10:24:02.513Z'
- code: POP123
+ position:
+ type:
+ deleted_at:
+ created_at: '2021-11-11T12:51:27.496Z'
+ updated_at: '2021-11-11T12:51:27.496Z'
relationships:
- promotions:
- data: []
+ promotion:
+ data:
+ id: '5'
+ type: promotion
meta:
count: 2
total_count: 2
total_pages: 1
links:
- self: http://www.example.com/api/v2/platform/promotion_categories?page=1&per_page=&include=&filter[code]=&filter[name]=
- next: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
- prev: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
- last: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
- first: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
+ self: http://www.example.com/api/v2/platform/promotion_actions?page=1&per_page=&include=&filter[type_eq]=
+ next: http://www.example.com/api/v2/platform/promotion_actions?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ prev: http://www.example.com/api/v2/platform/promotion_actions?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ last: http://www.example.com/api/v2/platform/promotion_actions?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ first: http://www.example.com/api/v2/platform/promotion_actions?filter%5Btype_eq%5D=&include=&page=1&per_page=
schema:
"$ref": "#/components/schemas/resources_list"
'401':
@@ -7730,19 +7644,19 @@ paths:
schema:
"$ref": "#/components/schemas/error"
post:
- summary: Create a Promotion Category
+ summary: Create a Promotion Action
tags:
- - Promotion Categories
+ - Promotion Actions
security:
- bearer_auth: []
- description: Creates a Promotion Category
- operationId: create-promotion-category
+ description: Creates a Promotion Action
+ operationId: create-promotion-action
parameters:
- name: include
in: query
description: 'Select which associated resources you would like to fetch, see:
<a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
- example: promotions
+ example: calculator
schema:
type: string
responses:
@@ -7754,16 +7668,1087 @@ paths:
Example:
value:
data:
- id: '5'
- type: promotion_category
+ id: '9'
+ type: promotion_action
attributes:
- name: Promotion Category
- created_at: '2021-11-10T10:24:02.615Z'
- updated_at: '2021-11-10T10:24:02.615Z'
- code: 2021-BFM
+ position:
+ type:
+ deleted_at:
+ created_at: '2021-11-11T12:51:27.578Z'
+ updated_at: '2021-11-11T12:51:27.578Z'
+ relationships:
+ promotion:
+ data:
+ id: '7'
+ type: promotion
+ schema:
+ "$ref": "#/components/schemas/resource"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "#/components/schemas/create_promotion_action_params"
+ "/api/v2/platform/promotion_actions/{id}":
+ get:
+ summary: Return a Promotion Action
+ tags:
+ - Promotion Actions
+ security:
+ - bearer_auth: []
+ description: Returns a Promotion Action
+ operationId: show-promotion-action
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: calculator
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '10'
+ type: promotion_action
+ attributes:
+ position:
+ type:
+ deleted_at:
+ created_at: '2021-11-11T12:51:27.604Z'
+ updated_at: '2021-11-11T12:51:27.604Z'
+ relationships:
+ promotion:
+ data:
+ id: '8'
+ type: promotion
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ patch:
+ summary: Update a Promotion Action
+ tags:
+ - Promotion Actions
+ security:
+ - bearer_auth: []
+ description: Updates a Promotion Action
+ operationId: update-promotion-action
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: calculator
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record updated
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '12'
+ type: promotion_action
+ attributes:
+ position:
+ type: Spree::Promotion::Actions::CreateAdjustment
+ deleted_at:
+ created_at: '2021-11-11T12:51:27.689Z'
+ updated_at: '2021-11-11T12:51:27.695Z'
+ relationships:
+ promotion:
+ data:
+ id: '10'
+ type: promotion
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "#/components/schemas/update_promotion_action_params"
+ delete:
+ summary: Delete a Promotion Action
+ tags:
+ - Promotion Actions
+ security:
+ - bearer_auth: []
+ description: Deletes a Promotion Action
+ operationId: delete-promotion-action
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Record deleted
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ "/api/v2/platform/promotion_categories":
+ get:
+ summary: Return a list of Promotion Categories
+ tags:
+ - Promotion Categories
+ security:
+ - bearer_auth: []
+ description: Returns a list of Promotion Categories
+ operationId: promotion-categories-list
+ parameters:
+ - name: page
+ in: query
+ example: 1
+ schema:
+ type: integer
+ - name: per_page
+ in: query
+ example: 50
+ schema:
+ type: integer
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: promotions
+ schema:
+ type: string
+ - name: filter[code]
+ in: query
+ description: ''
+ example: BLK-FRI
+ schema:
+ type: string
+ - name: filter[name]
+ in: query
+ description: ''
+ example: 2020 Promotions
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Records returned
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ - id: '1'
+ type: promotion_category
+ attributes:
+ name: Promotion Category
+ created_at: '2021-11-11T12:51:27.840Z'
+ updated_at: '2021-11-11T12:51:27.840Z'
+ code: POP123
+ relationships:
+ promotions:
+ data: []
+ - id: '2'
+ type: promotion_category
+ attributes:
+ name: Promotion Category
+ created_at: '2021-11-11T12:51:27.842Z'
+ updated_at: '2021-11-11T12:51:27.842Z'
+ code: POP123
relationships:
promotions:
data: []
+ meta:
+ count: 2
+ total_count: 2
+ total_pages: 1
+ links:
+ self: http://www.example.com/api/v2/platform/promotion_categories?page=1&per_page=&include=&filter[code]=&filter[name]=
+ next: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
+ prev: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
+ last: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
+ first: http://www.example.com/api/v2/platform/promotion_categories?filter%5Bcode%5D=&filter%5Bname%5D=&include=&page=1&per_page=
+ schema:
+ "$ref": "#/components/schemas/resources_list"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ post:
+ summary: Create a Promotion Category
+ tags:
+ - Promotion Categories
+ security:
+ - bearer_auth: []
+ description: Creates a Promotion Category
+ operationId: create-promotion-category
+ parameters:
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: promotions
+ schema:
+ type: string
+ responses:
+ '201':
+ description: Record created
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '5'
+ type: promotion_category
+ attributes:
+ name: Promotion Category
+ created_at: '2021-11-11T12:51:27.898Z'
+ updated_at: '2021-11-11T12:51:27.898Z'
+ code: 2021-BFM
+ relationships:
+ promotions:
+ data: []
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '422':
+ description: Invalid request
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: Name can't be blank
+ errors:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/validation_errors"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "#/components/schemas/create_promotion_category_params"
+ "/api/v2/platform/promotion_categories/{id}":
+ get:
+ summary: Return a Promotion Category
+ tags:
+ - Promotion Categories
+ security:
+ - bearer_auth: []
+ description: Returns a Promotion Category
+ operationId: show-promotion-category
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: promotions
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '6'
+ type: promotion_category
+ attributes:
+ name: Promotion Category
+ created_at: '2021-11-11T12:51:27.944Z'
+ updated_at: '2021-11-11T12:51:27.944Z'
+ code: MJO
+ relationships:
+ promotions:
+ data: []
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ patch:
+ summary: Update a Promotion Category
+ tags:
+ - Promotion Categories
+ security:
+ - bearer_auth: []
+ description: Updates a Promotion Category
+ operationId: update-promotion-category
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: promotions
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record updated
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '8'
+ type: promotion_category
+ attributes:
+ name: 2021 Promotions
+ created_at: '2021-11-11T12:51:28.007Z'
+ updated_at: '2021-11-11T12:51:28.013Z'
+ code: 2021-Promos
+ relationships:
+ promotions:
+ data: []
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '422':
+ description: Invalid request
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: Name can't be blank
+ errors:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/validation_errors"
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "#/components/schemas/update_promotion_category_params"
+ delete:
+ summary: Delete a Promotion Category
+ tags:
+ - Promotion Categories
+ security:
+ - bearer_auth: []
+ description: Deletes a Promotion Category
+ operationId: delete-promotion-category
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Record deleted
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ "/api/v2/platform/promotion_rules":
+ get:
+ summary: Return a list of Promotion Rules
+ tags:
+ - Promotion Rules
+ security:
+ - bearer_auth: []
+ description: Returns a list of Promotion Rules
+ operationId: promotion-rules-list
+ parameters:
+ - name: page
+ in: query
+ example: 1
+ schema:
+ type: integer
+ - name: per_page
+ in: query
+ example: 50
+ schema:
+ type: integer
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: user
+ schema:
+ type: string
+ - name: filter[type_eq]
+ in: query
+ description: ''
+ example: Spree::Promotion::Rules::Product
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Records returned
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ - id: '1'
+ type: promotion_rule
+ attributes:
+ type:
+ created_at: '2021-11-11T12:51:28.163Z'
+ updated_at: '2021-11-11T12:51:28.163Z'
+ code:
+ preferences: {}
+ relationships:
+ promotion:
+ data:
+ id: '14'
+ type: promotion
+ - id: '2'
+ type: promotion_rule
+ attributes:
+ type:
+ created_at: '2021-11-11T12:51:28.165Z'
+ updated_at: '2021-11-11T12:51:28.165Z'
+ code:
+ preferences: {}
+ relationships:
+ promotion:
+ data:
+ id: '14'
+ type: promotion
+ meta:
+ count: 2
+ total_count: 2
+ total_pages: 1
+ links:
+ self: http://www.example.com/api/v2/platform/promotion_rules?page=1&per_page=&include=&filter[type_eq]=
+ next: http://www.example.com/api/v2/platform/promotion_rules?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ prev: http://www.example.com/api/v2/platform/promotion_rules?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ last: http://www.example.com/api/v2/platform/promotion_rules?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ first: http://www.example.com/api/v2/platform/promotion_rules?filter%5Btype_eq%5D=&include=&page=1&per_page=
+ schema:
+ "$ref": "#/components/schemas/resources_list"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ post:
+ summary: Create a Promotion Rule
+ tags:
+ - Promotion Rules
+ security:
+ - bearer_auth: []
+ description: Creates a Promotion Rule
+ operationId: create-promotion-rule
+ parameters:
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: user
+ schema:
+ type: string
+ responses:
+ '201':
+ description: Record created
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '5'
+ type: promotion_rule
+ attributes:
+ type:
+ created_at: '2021-11-11T12:51:28.238Z'
+ updated_at: '2021-11-11T12:51:28.238Z'
+ code:
+ preferences: {}
+ relationships:
+ promotion:
+ data:
+ id: '16'
+ type: promotion
+ schema:
+ "$ref": "#/components/schemas/resource"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "#/components/schemas/create_promotion_rule_params"
+ "/api/v2/platform/promotion_rules/{id}":
+ get:
+ summary: Return a Promotion Rule
+ tags:
+ - Promotion Rules
+ security:
+ - bearer_auth: []
+ description: Returns a Promotion Rule
+ operationId: show-promotion-rule
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: user
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '6'
+ type: promotion_rule
+ attributes:
+ type:
+ created_at: '2021-11-11T12:51:28.269Z'
+ updated_at: '2021-11-11T12:51:28.269Z'
+ code:
+ preferences: {}
+ relationships:
+ promotion:
+ data:
+ id: '17'
+ type: promotion
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ patch:
+ summary: Update a Promotion Rule
+ tags:
+ - Promotion Rules
+ security:
+ - bearer_auth: []
+ description: Updates a Promotion Rule
+ operationId: update-promotion-rule
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: user
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record updated
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '8'
+ type: promotion_rule
+ attributes:
+ type: Spree::Promotion::Rules::Country
+ created_at: '2021-11-11T12:51:28.350Z'
+ updated_at: '2021-11-11T12:51:28.357Z'
+ code:
+ preferences: {}
+ relationships:
+ promotion:
+ data:
+ id: '19'
+ type: promotion
+ schema:
+ "$ref": "#/components/schemas/resource"
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "#/components/schemas/update_promotion_rule_params"
+ delete:
+ summary: Delete a Promotion Rule
+ tags:
+ - Promotion Rules
+ security:
+ - bearer_auth: []
+ description: Deletes a Promotion Rule
+ operationId: delete-promotion-rule
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Record deleted
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ schema:
+ "$ref": "#/components/schemas/error"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ "/api/v2/platform/promotions":
+ get:
+ summary: Return a list of Promotions
+ tags:
+ - Promotions
+ security:
+ - bearer_auth: []
+ description: Returns a list of Promotions
+ operationId: promotions-list
+ parameters:
+ - name: page
+ in: query
+ example: 1
+ schema:
+ type: integer
+ - name: per_page
+ in: query
+ example: 50
+ schema:
+ type: integer
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: promotion_category,promotion_rules,promotion_actions,stores
+ schema:
+ type: string
+ - name: filter[code_eq]
+ in: query
+ description: ''
+ example: BLK-FRI
+ schema:
+ type: string
+ - name: filter[name_cont]
+ in: query
+ description: ''
+ example: New Customer
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Records returned
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ - id: '23'
+ type: promotion
+ attributes:
+ description:
+ expires_at:
+ starts_at:
+ name: Promo
+ type:
+ usage_limit:
+ match_policy: all
+ code:
+ advertise: false
+ path:
+ created_at: '2021-11-11T12:51:28.512Z'
+ updated_at: '2021-11-11T12:51:28.512Z'
+ public_metadata: {}
+ private_metadata: {}
+ relationships:
+ promotion_category:
+ data:
+ promotion_rules:
+ data: []
+ promotion_actions:
+ data: []
+ stores:
+ data:
+ - id: '361'
+ type: store
+ - id: '24'
+ type: promotion
+ attributes:
+ description:
+ expires_at:
+ starts_at:
+ name: Promo
+ type:
+ usage_limit:
+ match_policy: all
+ code:
+ advertise: false
+ path:
+ created_at: '2021-11-11T12:51:28.521Z'
+ updated_at: '2021-11-11T12:51:28.521Z'
+ public_metadata: {}
+ private_metadata: {}
+ relationships:
+ promotion_category:
+ data:
+ id: '13'
+ type: promotion_category
+ promotion_rules:
+ data: []
+ promotion_actions:
+ data:
+ - id: '16'
+ type: promotion_action
+ stores:
+ data:
+ - id: '361'
+ type: store
+ - id: '25'
+ type: promotion
+ attributes:
+ description:
+ expires_at:
+ starts_at:
+ name: Promo
+ type:
+ usage_limit:
+ match_policy: all
+ code:
+ advertise: false
+ path:
+ created_at: '2021-11-11T12:51:28.535Z'
+ updated_at: '2021-11-11T12:51:28.535Z'
+ public_metadata: {}
+ private_metadata: {}
+ relationships:
+ promotion_category:
+ data:
+ id: '13'
+ type: promotion_category
+ promotion_rules:
+ data: []
+ promotion_actions:
+ data:
+ - id: '17'
+ type: promotion_action
+ stores:
+ data:
+ - id: '361'
+ type: store
+ - id: '26'
+ type: promotion
+ attributes:
+ description:
+ expires_at:
+ starts_at:
+ name: Promo
+ type:
+ usage_limit:
+ match_policy: all
+ code:
+ advertise: false
+ path:
+ created_at: '2021-11-11T12:51:28.545Z'
+ updated_at: '2021-11-11T12:51:28.545Z'
+ public_metadata: {}
+ private_metadata: {}
+ relationships:
+ promotion_category:
+ data:
+ id: '13'
+ type: promotion_category
+ promotion_rules:
+ data:
+ - id: '12'
+ type: promotion_rule
+ promotion_actions:
+ data:
+ - id: '18'
+ type: promotion_action
+ stores:
+ data:
+ - id: '361'
+ type: store
+ meta:
+ count: 4
+ total_count: 4
+ total_pages: 1
+ links:
+ self: http://www.example.com/api/v2/platform/promotions?page=1&per_page=&include=&filter[code_eq]=&filter[name_cont]=
+ next: http://www.example.com/api/v2/platform/promotions?filter%5Bcode_eq%5D=&filter%5Bname_cont%5D=&include=&page=1&per_page=
+ prev: http://www.example.com/api/v2/platform/promotions?filter%5Bcode_eq%5D=&filter%5Bname_cont%5D=&include=&page=1&per_page=
+ last: http://www.example.com/api/v2/platform/promotions?filter%5Bcode_eq%5D=&filter%5Bname_cont%5D=&include=&page=1&per_page=
+ first: http://www.example.com/api/v2/platform/promotions?filter%5Bcode_eq%5D=&filter%5Bname_cont%5D=&include=&page=1&per_page=
+ schema:
+ "$ref": "#/components/schemas/resources_list"
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ schema:
+ "$ref": "#/components/schemas/error"
+ post:
+ summary: Create a Promotion
+ tags:
+ - Promotions
+ security:
+ - bearer_auth: []
+ description: Creates a Promotion
+ operationId: create-promotion
+ parameters:
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: promotion_category,promotion_rules,promotion_actions,stores
+ schema:
+ type: string
+ responses:
+ '201':
+ description: Record created
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '35'
+ type: promotion
+ attributes:
+ description: First 1000 Customers Save 20%
+ expires_at: '2021-11-15T12:51:28.711Z'
+ starts_at: '2021-11-11T12:51:28.711Z'
+ name: Black Friday 20% Off
+ type: Spree::Promotion
+ usage_limit: 1000
+ match_policy: any
+ code: BLK-20
+ advertise: true
+ path: "/black-fri/today"
+ created_at: '2021-11-11T12:51:28.724Z'
+ updated_at: '2021-11-11T12:51:28.724Z'
+ public_metadata: {}
+ private_metadata: {}
+ relationships:
+ promotion_category:
+ data:
+ id: '15'
+ type: promotion_category
+ promotion_rules:
+ data: []
+ promotion_actions:
+ data: []
+ stores:
+ data:
+ - id: '368'
+ type: store
+ - id: '369'
+ type: store
+ - id: '367'
+ type: store
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -7783,16 +8768,16 @@ paths:
content:
application/json:
schema:
- "$ref": "#/components/schemas/create_promotion_category_params"
- "/api/v2/platform/promotion_categories/{id}":
+ "$ref": "#/components/schemas/create_promotion_params"
+ "/api/v2/platform/promotions/{id}":
get:
- summary: Return a Promotion Category
+ summary: Return a Promotion
tags:
- - Promotion Categories
+ - Promotions
security:
- bearer_auth: []
- description: Returns a Promotion Category
- operationId: show-promotion-category
+ description: Returns a Promotion
+ operationId: show-promotion
parameters:
- name: id
in: path
@@ -7803,7 +8788,7 @@ paths:
in: query
description: 'Select which associated resources you would like to fetch, see:
<a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
- example: promotions
+ example: promotion_category,promotion_rules,promotion_actions,stores
schema:
type: string
responses:
@@ -7815,16 +8800,40 @@ paths:
Example:
value:
data:
- id: '6'
- type: promotion_category
+ id: '44'
+ type: promotion
attributes:
- name: Promotion Category
- created_at: '2021-11-10T10:24:02.684Z'
- updated_at: '2021-11-10T10:24:02.684Z'
- code: MJO
+ description:
+ expires_at:
+ starts_at:
+ name: Promo
+ type:
+ usage_limit:
+ match_policy: all
+ code:
+ advertise: false
+ path:
+ created_at: '2021-11-11T12:51:28.881Z'
+ updated_at: '2021-11-11T12:51:28.881Z'
+ public_metadata: {}
+ private_metadata: {}
relationships:
- promotions:
- data: []
+ promotion_category:
+ data:
+ id: '17'
+ type: promotion_category
+ promotion_rules:
+ data:
+ - id: '16'
+ type: promotion_rule
+ promotion_actions:
+ data:
+ - id: '31'
+ type: promotion_action
+ stores:
+ data:
+ - id: '373'
+ type: store
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -7848,13 +8857,13 @@ paths:
schema:
"$ref": "#/components/schemas/error"
patch:
- summary: Update a Promotion Category
+ summary: Update a Promotion
tags:
- - Promotion Categories
+ - Promotions
security:
- bearer_auth: []
- description: Updates a Promotion Category
- operationId: update-promotion-category
+ description: Updates a Promotion
+ operationId: update-promotion
parameters:
- name: id
in: path
@@ -7865,7 +8874,7 @@ paths:
in: query
description: 'Select which associated resources you would like to fetch, see:
<a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
- example: promotions
+ example: promotion_category,promotion_rules,promotion_actions,stores
schema:
type: string
responses:
@@ -7877,16 +8886,40 @@ paths:
Example:
value:
data:
- id: '8'
- type: promotion_category
+ id: '58'
+ type: promotion
attributes:
- name: 2021 Promotions
- created_at: '2021-11-10T10:24:02.815Z'
- updated_at: '2021-11-10T10:24:02.829Z'
- code: 2021-Promos
+ description: This is the new updated promo
+ expires_at:
+ starts_at:
+ name: 10% OFF
+ type:
+ usage_limit:
+ match_policy: all
+ code: RAND-10
+ advertise: false
+ path:
+ created_at: '2021-11-11T12:51:29.200Z'
+ updated_at: '2021-11-11T12:51:29.216Z'
+ public_metadata: {}
+ private_metadata: {}
relationships:
- promotions:
- data: []
+ promotion_category:
+ data:
+ id: '20'
+ type: promotion_category
+ promotion_rules:
+ data:
+ - id: '19'
+ type: promotion_rule
+ promotion_actions:
+ data:
+ - id: '42'
+ type: promotion_action
+ stores:
+ data:
+ - id: '382'
+ type: store
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -7926,15 +8959,22 @@ paths:
content:
application/json:
schema:
- "$ref": "#/components/schemas/update_promotion_category_params"
+ oneOf:
+ - "$ref": "#/components/schemas/update_promotion_params"
+ - "$ref": "#/components/schemas/update_promotion_add_rule_params"
+ - "$ref": "#/components/schemas/update_promotion_update_rule_params"
+ - "$ref": "#/components/schemas/update_promotion_add_action_params"
+ - "$ref": "#/components/schemas/update_promotion_change_action_params"
+ - "$ref": "#/components/schemas/update_promotion_action_calculator_params"
+ - "$ref": "#/components/schemas/update_promotion_change_calculator_params"
delete:
- summary: Delete a Promotion Category
+ summary: Delete a Promotion
tags:
- - Promotion Categories
+ - Promotions
security:
- bearer_auth: []
- description: Deletes a Promotion Category
- operationId: delete-promotion-category
+ description: Deletes a Promotion
+ operationId: delete-promotion
parameters:
- name: id
in: path
@@ -8003,14 +9043,14 @@ paths:
type: role
attributes:
name: 'Role #1'
- created_at: '2021-11-10T10:24:03.101Z'
- updated_at: '2021-11-10T10:24:03.101Z'
+ created_at: '2021-11-11T12:51:29.716Z'
+ updated_at: '2021-11-11T12:51:29.716Z'
- id: '2'
type: role
attributes:
name: 'Role #2'
- created_at: '2021-11-10T10:24:03.103Z'
- updated_at: '2021-11-10T10:24:03.103Z'
+ created_at: '2021-11-11T12:51:29.718Z'
+ updated_at: '2021-11-11T12:51:29.718Z'
meta:
count: 2
total_count: 2
@@ -8055,8 +9095,8 @@ paths:
type: role
attributes:
name: 'Role #5'
- created_at: '2021-11-10T10:24:03.206Z'
- updated_at: '2021-11-10T10:24:03.206Z'
+ created_at: '2021-11-11T12:51:29.782Z'
+ updated_at: '2021-11-11T12:51:29.782Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -8105,8 +9145,8 @@ paths:
type: role
attributes:
name: 'Role #6'
- created_at: '2021-11-10T10:24:03.273Z'
- updated_at: '2021-11-10T10:24:03.273Z'
+ created_at: '2021-11-11T12:51:29.823Z'
+ updated_at: '2021-11-11T12:51:29.823Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -8156,8 +9196,8 @@ paths:
type: role
attributes:
name: administrator
- created_at: '2021-11-10T10:24:03.385Z'
- updated_at: '2021-11-10T10:24:03.396Z'
+ created_at: '2021-11-11T12:51:29.889Z'
+ updated_at: '2021-11-11T12:51:29.896Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -8281,12 +9321,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H22850408672
+ number: H80949427431
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-11-10T10:24:03.737Z'
- updated_at: '2021-11-10T10:24:03.742Z'
+ created_at: '2021-11-11T12:51:30.054Z'
+ updated_at: '2021-11-11T12:51:30.057Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8296,11 +9336,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$0.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8310,7 +9350,7 @@ paths:
data:
stock_location:
data:
- id: '127'
+ id: '124'
type: stock_location
adjustments:
data: []
@@ -8330,12 +9370,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H27852654160
+ number: H76821114218
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-11-10T10:24:03.843Z'
- updated_at: '2021-11-10T10:24:03.848Z'
+ created_at: '2021-11-11T12:51:30.085Z'
+ updated_at: '2021-11-11T12:51:30.088Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8345,11 +9385,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$0.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8359,7 +9399,7 @@ paths:
data:
stock_location:
data:
- id: '128'
+ id: '125'
type: stock_location
adjustments:
data: []
@@ -8432,12 +9472,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H88771980130
+ number: H37739783228
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-11-10T10:24:04.514Z'
- updated_at: '2021-11-10T10:24:04.545Z'
+ created_at: '2021-11-11T12:51:30.379Z'
+ updated_at: '2021-11-11T12:51:30.394Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8447,11 +9487,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$10.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8461,7 +9501,7 @@ paths:
data:
stock_location:
data:
- id: '133'
+ id: '130'
type: stock_location
adjustments:
data: []
@@ -8573,12 +9613,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H68780247115
+ number: H94368375009
cost: '100.0'
shipped_at:
state: ready
- created_at: '2021-11-10T10:24:06.026Z'
- updated_at: '2021-11-10T10:24:06.072Z'
+ created_at: '2021-11-11T12:51:31.218Z'
+ updated_at: '2021-11-11T12:51:31.249Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8588,11 +9628,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$10.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8602,7 +9642,7 @@ paths:
data:
stock_location:
data:
- id: '145'
+ id: '142'
type: stock_location
adjustments:
data: []
@@ -8679,12 +9719,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H26186345187
+ number: H44447278595
cost: '100.0'
- shipped_at: '2021-11-10T10:24:06.840Z'
+ shipped_at: '2021-11-11T12:51:31.772Z'
state: shipped
- created_at: '2021-11-10T10:24:06.778Z'
- updated_at: '2021-11-10T10:24:06.840Z'
+ created_at: '2021-11-11T12:51:31.738Z'
+ updated_at: '2021-11-11T12:51:31.772Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8694,11 +9734,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$10.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8708,7 +9748,7 @@ paths:
data:
stock_location:
data:
- id: '151'
+ id: '148'
type: stock_location
adjustments:
data: []
@@ -8785,12 +9825,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H14623305546
+ number: H39383646411
cost: '100.0'
shipped_at:
state: canceled
- created_at: '2021-11-10T10:24:07.563Z'
- updated_at: '2021-11-10T10:24:07.610Z'
+ created_at: '2021-11-11T12:51:32.168Z'
+ updated_at: '2021-11-11T12:51:32.194Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8800,11 +9840,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$10.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8814,7 +9854,7 @@ paths:
data:
stock_location:
data:
- id: '157'
+ id: '154'
type: stock_location
adjustments:
data: []
@@ -8891,12 +9931,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H32022639522
+ number: H55555211724
cost: '100.0'
shipped_at:
state: ready
- created_at: '2021-11-10T10:24:08.332Z'
- updated_at: '2021-11-10T10:24:08.378Z'
+ created_at: '2021-11-11T12:51:32.624Z'
+ updated_at: '2021-11-11T12:51:32.652Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8906,11 +9946,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$10.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -8920,7 +9960,7 @@ paths:
data:
stock_location:
data:
- id: '163'
+ id: '160'
type: stock_location
adjustments:
data: []
@@ -8997,12 +10037,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H03386828481
+ number: H69562340303
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-11-10T10:24:09.095Z'
- updated_at: '2021-11-10T10:24:09.142Z'
+ created_at: '2021-11-11T12:51:33.066Z'
+ updated_at: '2021-11-11T12:51:33.091Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -9012,11 +10052,11 @@ paths:
non_taxable_adjustment_total: '0.0'
public_metadata: {}
private_metadata: {}
+ display_amount: "$100.00"
display_cost: "$100.00"
display_discounted_cost: "$100.00"
display_item_cost: "$10.00"
display_final_price: "$100.00"
- display_amount: "$100.00"
relationships:
order:
data:
@@ -9026,7 +10066,7 @@ paths:
data:
stock_location:
data:
- id: '169'
+ id: '166'
type: stock_location
adjustments:
data: []
@@ -9103,18 +10143,18 @@ paths:
Example:
value:
data:
- - id: '116'
+ - id: '113'
type: shipping_category
attributes:
- name: 'ShippingCategory #116'
- created_at: '2021-11-10T10:24:09.741Z'
- updated_at: '2021-11-10T10:24:09.741Z'
- - id: '117'
+ name: 'ShippingCategory #113'
+ created_at: '2021-11-11T12:51:33.321Z'
+ updated_at: '2021-11-11T12:51:33.321Z'
+ - id: '114'
type: shipping_category
attributes:
- name: 'ShippingCategory #117'
- created_at: '2021-11-10T10:24:09.742Z'
- updated_at: '2021-11-10T10:24:09.742Z'
+ name: 'ShippingCategory #114'
+ created_at: '2021-11-11T12:51:33.322Z'
+ updated_at: '2021-11-11T12:51:33.322Z'
meta:
count: 2
total_count: 2
@@ -9155,12 +10195,12 @@ paths:
Example:
value:
data:
- id: '120'
+ id: '117'
type: shipping_category
attributes:
- name: 'ShippingCategory #120'
- created_at: '2021-11-10T10:24:09.846Z'
- updated_at: '2021-11-10T10:24:09.846Z'
+ name: 'ShippingCategory #117'
+ created_at: '2021-11-11T12:51:33.386Z'
+ updated_at: '2021-11-11T12:51:33.386Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -9205,12 +10245,12 @@ paths:
Example:
value:
data:
- id: '121'
+ id: '118'
type: shipping_category
attributes:
- name: 'ShippingCategory #121'
- created_at: '2021-11-10T10:24:09.913Z'
- updated_at: '2021-11-10T10:24:09.913Z'
+ name: 'ShippingCategory #118'
+ created_at: '2021-11-11T12:51:33.427Z'
+ updated_at: '2021-11-11T12:51:33.427Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -9256,12 +10296,12 @@ paths:
Example:
value:
data:
- id: '123'
+ id: '120'
type: shipping_category
attributes:
name: Default
- created_at: '2021-11-10T10:24:10.022Z'
- updated_at: '2021-11-10T10:24:10.033Z'
+ created_at: '2021-11-11T12:51:33.495Z'
+ updated_at: '2021-11-11T12:51:33.501Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -9395,15 +10435,15 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-11-10T10:24:10.275Z'
- updated_at: '2021-11-10T10:24:10.275Z'
+ created_at: '2021-11-11T12:51:33.649Z'
+ updated_at: '2021-11-11T12:51:33.649Z'
deleted_at:
public_metadata: {}
private_metadata: {}
relationships:
shipping_categories:
data:
- - id: '128'
+ - id: '125'
type: shipping_category
shipping_rates:
data: []
@@ -9411,7 +10451,7 @@ paths:
data:
calculator:
data:
- id: '71'
+ id: '120'
type: calculator
- id: '61'
type: shipping_method
@@ -9421,15 +10461,15 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-11-10T10:24:10.292Z'
- updated_at: '2021-11-10T10:24:10.292Z'
+ created_at: '2021-11-11T12:51:33.659Z'
+ updated_at: '2021-11-11T12:51:33.659Z'
deleted_at:
public_metadata: {}
private_metadata: {}
relationships:
shipping_categories:
data:
- - id: '128'
+ - id: '125'
type: shipping_category
shipping_rates:
data: []
@@ -9437,7 +10477,7 @@ paths:
data:
calculator:
data:
- id: '72'
+ id: '121'
type: calculator
meta:
count: 2
@@ -9494,25 +10534,25 @@ paths:
admin_name: DHL Express- Zone A
display_on: both
tracking_url:
- created_at: '2021-11-10T10:24:10.444Z'
- updated_at: '2021-11-10T10:24:10.444Z'
+ created_at: '2021-11-11T12:51:33.750Z'
+ updated_at: '2021-11-11T12:51:33.750Z'
deleted_at:
public_metadata: {}
private_metadata: {}
relationships:
shipping_categories:
data:
- - id: '130'
+ - id: '127'
type: shipping_category
shipping_rates:
data: []
tax_category:
data:
- id: '125'
+ id: '122'
type: tax_category
calculator:
data:
- id: '75'
+ id: '124'
type: calculator
schema:
"$ref": "#/components/schemas/resource"
@@ -9581,15 +10621,15 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-11-10T10:24:10.539Z'
- updated_at: '2021-11-10T10:24:10.539Z'
+ created_at: '2021-11-11T12:51:33.825Z'
+ updated_at: '2021-11-11T12:51:33.825Z'
deleted_at:
public_metadata: {}
private_metadata: {}
relationships:
shipping_categories:
data:
- - id: '131'
+ - id: '128'
type: shipping_category
shipping_rates:
data: []
@@ -9597,7 +10637,7 @@ paths:
data:
calculator:
data:
- id: '76'
+ id: '125'
type: calculator
schema:
"$ref": "#/components/schemas/resource"
@@ -9659,15 +10699,15 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-11-10T10:24:10.685Z'
- updated_at: '2021-11-10T10:24:10.712Z'
+ created_at: '2021-11-11T12:51:33.976Z'
+ updated_at: '2021-11-11T12:51:33.988Z'
deleted_at:
public_metadata: {}
private_metadata: {}
relationships:
shipping_categories:
data:
- - id: '133'
+ - id: '130'
type: shipping_category
shipping_rates:
data: []
@@ -9675,7 +10715,7 @@ paths:
data:
calculator:
data:
- id: '79'
+ id: '128'
type: calculator
schema:
"$ref": "#/components/schemas/resource"
@@ -9793,14 +10833,14 @@ paths:
type: store_credit_category
attributes:
name: Exchange
- created_at: '2021-11-10T10:24:11.033Z'
- updated_at: '2021-11-10T10:24:11.033Z'
+ created_at: '2021-11-11T12:51:34.183Z'
+ updated_at: '2021-11-11T12:51:34.183Z'
- id: '3'
type: store_credit_category
attributes:
name: Exchange
- created_at: '2021-11-10T10:24:11.035Z'
- updated_at: '2021-11-10T10:24:11.035Z'
+ created_at: '2021-11-11T12:51:34.184Z'
+ updated_at: '2021-11-11T12:51:34.184Z'
meta:
count: 2
total_count: 2
@@ -9845,8 +10885,8 @@ paths:
type: store_credit_category
attributes:
name: Exchange
- created_at: '2021-11-10T10:24:11.136Z'
- updated_at: '2021-11-10T10:24:11.136Z'
+ created_at: '2021-11-11T12:51:34.240Z'
+ updated_at: '2021-11-11T12:51:34.240Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -9895,8 +10935,8 @@ paths:
type: store_credit_category
attributes:
name: Exchange
- created_at: '2021-11-10T10:24:11.199Z'
- updated_at: '2021-11-10T10:24:11.199Z'
+ created_at: '2021-11-11T12:51:34.280Z'
+ updated_at: '2021-11-11T12:51:34.280Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -9946,8 +10986,8 @@ paths:
type: store_credit_category
attributes:
name: refunded
- created_at: '2021-11-10T10:24:11.302Z'
- updated_at: '2021-11-10T10:24:11.311Z'
+ created_at: '2021-11-11T12:51:34.347Z'
+ updated_at: '2021-11-11T12:51:34.353Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -10059,15 +11099,15 @@ paths:
attributes:
name: Expiring
priority: 1
- created_at: '2021-11-10T10:24:11.540Z'
- updated_at: '2021-11-10T10:24:11.540Z'
+ created_at: '2021-11-11T12:51:34.488Z'
+ updated_at: '2021-11-11T12:51:34.488Z'
- id: '3'
type: store_credit_type
attributes:
name: Expiring
priority: 1
- created_at: '2021-11-10T10:24:11.541Z'
- updated_at: '2021-11-10T10:24:11.541Z'
+ created_at: '2021-11-11T12:51:34.488Z'
+ updated_at: '2021-11-11T12:51:34.488Z'
meta:
count: 2
total_count: 2
@@ -10113,8 +11153,8 @@ paths:
attributes:
name: Expiring
priority: 1
- created_at: '2021-11-10T10:24:11.630Z'
- updated_at: '2021-11-10T10:24:11.630Z'
+ created_at: '2021-11-11T12:51:34.546Z'
+ updated_at: '2021-11-11T12:51:34.546Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -10164,8 +11204,8 @@ paths:
attributes:
name: Expiring
priority: 1
- created_at: '2021-11-10T10:24:11.702Z'
- updated_at: '2021-11-10T10:24:11.702Z'
+ created_at: '2021-11-11T12:51:34.585Z'
+ updated_at: '2021-11-11T12:51:34.585Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -10216,8 +11256,8 @@ paths:
attributes:
name: default
priority: 1
- created_at: '2021-11-10T10:24:11.805Z'
- updated_at: '2021-11-10T10:24:11.816Z'
+ created_at: '2021-11-11T12:51:34.651Z'
+ updated_at: '2021-11-11T12:51:34.657Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -10365,12 +11405,12 @@ paths:
currency: USD
amount_authorized: '0.0'
originator_type:
- created_at: '2021-11-10T10:24:12.054Z'
- updated_at: '2021-11-10T10:24:12.054Z'
+ created_at: '2021-11-11T12:51:34.795Z'
+ updated_at: '2021-11-11T12:51:34.795Z'
public_metadata: {}
private_metadata: {}
- display_amount_used: "$0.00"
display_amount: "$150.00"
+ display_amount_used: "$0.00"
relationships:
user:
data:
@@ -10402,12 +11442,12 @@ paths:
currency: USD
amount_authorized: '0.0'
originator_type:
- created_at: '2021-11-10T10:24:12.066Z'
- updated_at: '2021-11-10T10:24:12.066Z'
+ created_at: '2021-11-11T12:51:34.802Z'
+ updated_at: '2021-11-11T12:51:34.802Z'
public_metadata: {}
private_metadata: {}
- display_amount_used: "$0.00"
display_amount: "$150.00"
+ display_amount_used: "$0.00"
relationships:
user:
data:
@@ -10486,12 +11526,12 @@ paths:
currency: USD
amount_authorized: '0.0'
originator_type:
- created_at: '2021-11-10T10:24:12.223Z'
- updated_at: '2021-11-10T10:24:12.223Z'
+ created_at: '2021-11-11T12:51:34.891Z'
+ updated_at: '2021-11-11T12:51:34.891Z'
public_metadata: {}
private_metadata: {}
- display_amount_used: "$0.00"
display_amount: "$150.00"
+ display_amount_used: "$0.00"
relationships:
user:
data:
@@ -10591,12 +11631,12 @@ paths:
currency: USD
amount_authorized: '0.0'
originator_type:
- created_at: '2021-11-10T10:24:12.328Z'
- updated_at: '2021-11-10T10:24:12.328Z'
+ created_at: '2021-11-11T12:51:34.942Z'
+ updated_at: '2021-11-11T12:51:34.942Z'
public_metadata: {}
private_metadata: {}
- display_amount_used: "$0.00"
display_amount: "$150.00"
+ display_amount_used: "$0.00"
relationships:
user:
data:
@@ -10680,13 +11720,13 @@ paths:
currency: CAD
amount_authorized: '0.0'
originator_type:
- created_at: '2021-11-10T10:24:12.498Z'
- updated_at: '2021-11-10T10:24:12.519Z'
+ created_at: '2021-11-11T12:51:35.026Z'
+ updated_at: '2021-11-11T12:51:35.037Z'
public_metadata:
loyalty_reward: true
private_metadata: {}
- display_amount_used: "$0.00"
display_amount: "$500.00"
+ display_amount_used: "$0.00"
relationships:
user:
data:
@@ -10844,29 +11884,30 @@ paths:
Example:
value:
data:
- - id: '126'
+ - id: '123'
type: tax_category
attributes:
- name: TaxCategory - 975559
- description: Nulla ipsum sunt voluptatem iusto non dignissimos
- rerum.
+ name: TaxCategory - 542439
+ description: Tempore voluptas reiciendis eaque illum et expedita
+ optio adipisci.
is_default: false
deleted_at:
- created_at: '2021-11-10T10:24:13.133Z'
- updated_at: '2021-11-10T10:24:13.133Z'
+ created_at: '2021-11-11T12:51:35.224Z'
+ updated_at: '2021-11-11T12:51:35.224Z'
tax_code:
relationships:
tax_rates:
data: []
- - id: '127'
+ - id: '124'
type: tax_category
attributes:
- name: TaxCategory - 680458
- description: Hic repellendus ipsum optio exercitationem accusamus.
+ name: TaxCategory - 26941
+ description: Quibusdam perferendis expedita dicta eaque rem
+ quam quia hic.
is_default: false
deleted_at:
- created_at: '2021-11-10T10:24:13.158Z'
- updated_at: '2021-11-10T10:24:13.158Z'
+ created_at: '2021-11-11T12:51:35.225Z'
+ updated_at: '2021-11-11T12:51:35.225Z'
tax_code:
relationships:
tax_rates:
@@ -10918,15 +11959,15 @@ paths:
Example:
value:
data:
- id: '130'
+ id: '127'
type: tax_category
attributes:
- name: TaxCategory - 787712
- description: A neque corrupti occaecati beatae.
+ name: TaxCategory - 883230
+ description: Quos incidunt eveniet nostrum nam quis.
is_default: false
deleted_at:
- created_at: '2021-11-10T10:24:13.691Z'
- updated_at: '2021-11-10T10:24:13.691Z'
+ created_at: '2021-11-11T12:51:35.284Z'
+ updated_at: '2021-11-11T12:51:35.284Z'
tax_code:
relationships:
tax_rates:
@@ -10982,16 +12023,15 @@ paths:
Example:
value:
data:
- id: '131'
+ id: '128'
type: tax_category
attributes:
- name: TaxCategory - 23027
- description: Repellendus laboriosam commodi hic eius quas
- nostrum dolorum.
+ name: TaxCategory - 982747
+ description: Adipisci fugit modi soluta necessitatibus maiores.
is_default: false
deleted_at:
- created_at: '2021-11-10T10:24:13.760Z'
- updated_at: '2021-11-10T10:24:13.760Z'
+ created_at: '2021-11-11T12:51:35.362Z'
+ updated_at: '2021-11-11T12:51:35.362Z'
tax_code:
relationships:
tax_rates:
@@ -11048,15 +12088,15 @@ paths:
Example:
value:
data:
- id: '133'
+ id: '130'
type: tax_category
attributes:
name: Clothing
description: Men's, women's and children's clothing
is_default: true
deleted_at:
- created_at: '2021-11-10T10:24:13.921Z'
- updated_at: '2021-11-10T10:24:13.932Z'
+ created_at: '2021-11-11T12:51:35.429Z'
+ updated_at: '2021-11-11T12:51:35.437Z'
tax_code: 1233K
relationships:
tax_rates:
@@ -11197,8 +12237,8 @@ paths:
attributes:
amount: '0.1'
included_in_price: false
- created_at: '2021-11-10T10:24:14.218Z'
- updated_at: '2021-11-10T10:24:14.218Z'
+ created_at: '2021-11-11T12:51:35.585Z'
+ updated_at: '2021-11-11T12:51:35.585Z'
name:
show_rate_in_label: true
deleted_at:
@@ -11209,15 +12249,15 @@ paths:
type: zone
tax_category:
data:
- id: '138'
+ id: '135'
type: tax_category
- id: '13'
type: tax_rate
attributes:
amount: '0.1'
included_in_price: false
- created_at: '2021-11-10T10:24:14.223Z'
- updated_at: '2021-11-10T10:24:14.223Z'
+ created_at: '2021-11-11T12:51:35.589Z'
+ updated_at: '2021-11-11T12:51:35.589Z'
name:
show_rate_in_label: true
deleted_at:
@@ -11228,7 +12268,7 @@ paths:
type: zone
tax_category:
data:
- id: '138'
+ id: '135'
type: tax_category
meta:
count: 2
@@ -11282,8 +12322,8 @@ paths:
attributes:
amount: '0.1'
included_in_price: false
- created_at: '2021-11-10T10:24:14.352Z'
- updated_at: '2021-11-10T10:24:14.352Z'
+ created_at: '2021-11-11T12:51:35.660Z'
+ updated_at: '2021-11-11T12:51:35.660Z'
name:
show_rate_in_label: true
deleted_at:
@@ -11292,7 +12332,7 @@ paths:
data:
tax_category:
data:
- id: '140'
+ id: '137'
type: tax_category
schema:
"$ref": "#/components/schemas/resource"
@@ -11355,8 +12395,8 @@ paths:
attributes:
amount: '0.1'
included_in_price: false
- created_at: '2021-11-10T10:24:14.463Z'
- updated_at: '2021-11-10T10:24:14.463Z'
+ created_at: '2021-11-11T12:51:35.790Z'
+ updated_at: '2021-11-11T12:51:35.790Z'
name:
show_rate_in_label: true
deleted_at:
@@ -11367,7 +12407,7 @@ paths:
type: zone
tax_category:
data:
- id: '141'
+ id: '138'
type: tax_category
schema:
"$ref": "#/components/schemas/resource"
@@ -11426,8 +12466,8 @@ paths:
attributes:
amount: '25.9'
included_in_price: true
- created_at: '2021-11-10T10:24:14.673Z'
- updated_at: '2021-11-10T10:24:14.688Z'
+ created_at: '2021-11-11T12:51:35.863Z'
+ updated_at: '2021-11-11T12:51:35.872Z'
name:
show_rate_in_label: true
deleted_at:
@@ -11438,7 +12478,7 @@ paths:
type: zone
tax_category:
data:
- id: '143'
+ id: '140'
type: tax_category
schema:
"$ref": "#/components/schemas/resource"
@@ -11565,99 +12605,99 @@ paths:
Example:
value:
data:
- - id: '32'
+ - id: '26'
type: taxon
attributes:
position: 0
- name: taxon_16
- permalink: taxonomy-16/taxon-16
+ name: taxon_13
+ permalink: taxonomy-13/taxon-13
lft: 2
rgt: 3
description:
- created_at: '2021-11-10T10:24:15.112Z'
- updated_at: '2021-11-10T10:24:15.119Z'
+ created_at: '2021-11-11T12:51:36.103Z'
+ updated_at: '2021-11-11T12:51:36.107Z'
meta_title:
meta_description:
meta_keywords:
depth: 1
public_metadata: {}
private_metadata: {}
- pretty_name: taxonomy_16 -> taxon_16
- seo_title: taxon_16
+ pretty_name: taxonomy_13 -> taxon_13
+ seo_title: taxon_13
is_root: false
is_child: true
is_leaf: true
relationships:
parent:
data:
- id: '31'
+ id: '25'
type: taxon
taxonomy:
data:
- id: '16'
+ id: '13'
type: taxonomy
children:
data: []
image:
data:
- id: '92'
+ id: '89'
type: taxon_image
- - id: '33'
+ - id: '27'
type: taxon
attributes:
position: 0
- name: taxon_17
- permalink: taxonomy-16/taxon-17
+ name: taxon_14
+ permalink: taxonomy-13/taxon-14
lft: 4
rgt: 5
description:
- created_at: '2021-11-10T10:24:15.217Z'
- updated_at: '2021-11-10T10:24:15.223Z'
+ created_at: '2021-11-11T12:51:36.163Z'
+ updated_at: '2021-11-11T12:51:36.166Z'
meta_title:
meta_description:
meta_keywords:
depth: 1
public_metadata: {}
private_metadata: {}
- pretty_name: taxonomy_16 -> taxon_17
- seo_title: taxon_17
+ pretty_name: taxonomy_13 -> taxon_14
+ seo_title: taxon_14
is_root: false
is_child: true
is_leaf: true
relationships:
parent:
data:
- id: '31'
+ id: '25'
type: taxon
taxonomy:
data:
- id: '16'
+ id: '13'
type: taxonomy
children:
data: []
image:
data:
- id: '93'
+ id: '90'
type: taxon_image
- - id: '31'
+ - id: '25'
type: taxon
attributes:
position: 0
- name: taxonomy_16
- permalink: taxonomy-16
+ name: taxonomy_13
+ permalink: taxonomy-13
lft: 1
rgt: 6
description:
- created_at: '2021-11-10T10:24:15.004Z'
- updated_at: '2021-11-10T10:24:15.238Z'
+ created_at: '2021-11-11T12:51:36.047Z'
+ updated_at: '2021-11-11T12:51:36.177Z'
meta_title:
meta_description:
meta_keywords:
depth: 0
public_metadata: {}
private_metadata: {}
- pretty_name: taxonomy_16
- seo_title: taxonomy_16
+ pretty_name: taxonomy_13
+ seo_title: taxonomy_13
is_root: true
is_child: false
is_leaf: false
@@ -11666,13 +12706,13 @@ paths:
data:
taxonomy:
data:
- id: '16'
+ id: '13'
type: taxonomy
children:
data:
- - id: '32'
+ - id: '26'
type: taxon
- - id: '33'
+ - id: '27'
type: taxon
image:
data:
@@ -11723,36 +12763,36 @@ paths:
Example:
value:
data:
- id: '38'
+ id: '32'
type: taxon
attributes:
position: 0
- name: taxon_20
- permalink: taxonomy-18/taxon-20
+ name: taxon_17
+ permalink: taxonomy-15/taxon-17
lft: 2
rgt: 3
description:
- created_at: '2021-11-10T10:24:15.638Z'
- updated_at: '2021-11-10T10:24:15.645Z'
+ created_at: '2021-11-11T12:51:36.412Z'
+ updated_at: '2021-11-11T12:51:36.416Z'
meta_title:
meta_description:
meta_keywords:
depth: 1
public_metadata: {}
private_metadata: {}
- pretty_name: taxonomy_18 -> taxon_20
- seo_title: taxon_20
+ pretty_name: taxonomy_15 -> taxon_17
+ seo_title: taxon_17
is_root: false
is_child: true
is_leaf: true
relationships:
parent:
data:
- id: '37'
+ id: '31'
type: taxon
taxonomy:
data:
- id: '18'
+ id: '15'
type: taxonomy
children:
data: []
@@ -11811,36 +12851,36 @@ paths:
Example:
value:
data:
- id: '40'
+ id: '34'
type: taxon
attributes:
position: 0
- name: taxon_21
- permalink: taxonomy-19/taxon-21
+ name: taxon_18
+ permalink: taxonomy-16/taxon-18
lft: 2
rgt: 3
description:
- created_at: '2021-11-10T10:24:15.838Z'
- updated_at: '2021-11-10T10:24:15.843Z'
+ created_at: '2021-11-11T12:51:36.531Z'
+ updated_at: '2021-11-11T12:51:36.535Z'
meta_title:
meta_description:
meta_keywords:
depth: 1
public_metadata: {}
private_metadata: {}
- pretty_name: taxonomy_19 -> taxon_21
- seo_title: taxon_21
+ pretty_name: taxonomy_16 -> taxon_18
+ seo_title: taxon_18
is_root: false
is_child: true
is_leaf: true
relationships:
parent:
data:
- id: '39'
+ id: '33'
type: taxon
taxonomy:
data:
- id: '19'
+ id: '16'
type: taxonomy
children:
data: []
@@ -11848,7 +12888,7 @@ paths:
data: []
image:
data:
- id: '96'
+ id: '93'
type: taxon_image
schema:
"$ref": "#/components/schemas/resource"
@@ -11902,17 +12942,17 @@ paths:
Example:
value:
data:
- id: '44'
+ id: '38'
type: taxon
attributes:
position: 0
name: T-Shirts
- permalink: taxonomy-21/taxon-23
+ permalink: taxonomy-18/taxon-20
lft: 2
rgt: 3
description:
- created_at: '2021-11-10T10:24:16.225Z'
- updated_at: '2021-11-10T10:24:16.271Z'
+ created_at: '2021-11-11T12:51:36.765Z'
+ updated_at: '2021-11-11T12:51:36.790Z'
meta_title:
meta_description:
meta_keywords:
@@ -11920,7 +12960,7 @@ paths:
public_metadata:
profitability: 3
private_metadata: {}
- pretty_name: taxonomy_21 -> T-Shirts
+ pretty_name: taxonomy_18 -> T-Shirts
seo_title: T-Shirts
is_root: false
is_child: true
@@ -11928,17 +12968,17 @@ paths:
relationships:
parent:
data:
- id: '43'
+ id: '37'
type: taxon
taxonomy:
data:
- id: '21'
+ id: '18'
type: taxonomy
children:
data: []
image:
data:
- id: '98'
+ id: '95'
type: taxon_image
schema:
"$ref": "#/components/schemas/resource"
@@ -12068,9 +13108,9 @@ paths:
- id: '119'
type: user
attributes:
- created_at: '2021-11-10T10:24:17.096Z'
- updated_at: '2021-11-10T10:24:17.096Z'
+ created_at: '2021-11-11T12:51:37.297Z'
+ updated_at: '2021-11-11T12:51:37.297Z'
public_metadata: {}
private_metadata: {}
average_order_value: []
@@ -12084,9 +13124,9 @@ paths:
- id: '120'
type: user
attributes:
- created_at: '2021-11-10T10:24:17.107Z'
- updated_at: '2021-11-10T10:24:17.107Z'
+ created_at: '2021-11-11T12:51:37.303Z'
+ updated_at: '2021-11-11T12:51:37.303Z'
public_metadata: {}
private_metadata: {}
average_order_value: []
@@ -12100,9 +13140,9 @@ paths:
- id: '121'
type: user
attributes:
- created_at: '2021-11-10T10:24:17.110Z'
- updated_at: '2021-11-10T10:24:17.110Z'
+ created_at: '2021-11-11T12:51:37.304Z'
+ updated_at: '2021-11-11T12:51:37.304Z'
public_metadata: {}
private_metadata: {}
average_order_value: []
@@ -12163,9 +13203,9 @@ paths:
id: '126'
type: user
attributes:
- created_at: '2021-11-10T10:24:17.252Z'
- updated_at: '2021-11-10T10:24:17.252Z'
+ created_at: '2021-11-11T12:51:37.389Z'
+ updated_at: '2021-11-11T12:51:37.389Z'
public_metadata: {}
private_metadata: {}
average_order_value: []
@@ -12230,9 +13270,9 @@ paths:
id: '129'
type: user
attributes:
- created_at: '2021-11-10T10:24:17.348Z'
- updated_at: '2021-11-10T10:24:17.348Z'
+ created_at: '2021-11-11T12:51:37.443Z'
+ updated_at: '2021-11-11T12:51:37.443Z'
public_metadata: {}
private_metadata: {}
average_order_value: []
@@ -12299,8 +13339,8 @@ paths:
type: user
attributes:
- created_at: '2021-11-10T10:24:17.492Z'
- updated_at: '2021-11-10T10:24:17.504Z'
+ created_at: '2021-11-11T12:51:37.529Z'
+ updated_at: '2021-11-11T12:51:37.537Z'
public_metadata: {}
private_metadata: {}
average_order_value: []
@@ -12436,10 +13476,10 @@ paths:
Example:
value:
data:
- - id: '248'
+ - id: '245'
type: variant
attributes:
- sku: SKU-248
+ sku: SKU-245
weight: '0.0'
height:
depth:
@@ -12449,14 +13489,14 @@ paths:
position: 1
cost_currency: USD
track_inventory: true
- updated_at: '2021-11-10T10:24:17.859Z'
+ updated_at: '2021-11-11T12:51:37.767Z'
discontinue_on:
- created_at: '2021-11-10T10:24:17.848Z'
+ created_at: '2021-11-11T12:51:37.762Z'
public_metadata: {}
private_metadata: {}
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #181 - 6947'
+ name: 'Product #178 - 504'
options_text: ''
total_on_hand: 0
purchasable: true
@@ -12469,7 +13509,7 @@ paths:
relationships:
product:
data:
- id: '181'
+ id: '178'
type: product
tax_category:
data:
@@ -12481,33 +13521,33 @@ paths:
data: []
stock_items:
data:
- - id: '303'
+ - id: '300'
type: stock_item
stock_locations:
data:
- - id: '173'
+ - id: '170'
type: stock_location
- - id: '249'
+ - id: '246'
type: variant
attributes:
- sku: SKU-249
- weight: '23.36'
- height: '100.91'
- depth: '61.29'
+ sku: SKU-246
+ weight: '96.7'
+ height: '2.73'
+ depth: '199.94'
deleted_at:
is_master: false
cost_price: '17.0'
position: 2
cost_currency: USD
track_inventory: true
- updated_at: '2021-11-10T10:24:17.906Z'
+ updated_at: '2021-11-11T12:51:37.796Z'
discontinue_on:
- created_at: '2021-11-10T10:24:17.897Z'
+ created_at: '2021-11-11T12:51:37.790Z'
public_metadata: {}
private_metadata: {}
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #181 - 6947'
+ name: 'Product #178 - 504'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -12520,7 +13560,7 @@ paths:
relationships:
product:
data:
- id: '181'
+ id: '178'
type: product
tax_category:
data:
@@ -12534,33 +13574,33 @@ paths:
type: option_value
stock_items:
data:
- - id: '304'
+ - id: '301'
type: stock_item
stock_locations:
data:
- - id: '173'
+ - id: '170'
type: stock_location
- - id: '250'
+ - id: '247'
type: variant
attributes:
- sku: SKU-250
- weight: '112.75'
- height: '155.64'
- depth: '4.63'
+ sku: SKU-247
+ weight: '20.67'
+ height: '66.16'
+ depth: '42.18'
deleted_at:
is_master: false
cost_price: '17.0'
position: 3
cost_currency: USD
track_inventory: true
- updated_at: '2021-11-10T10:24:17.939Z'
+ updated_at: '2021-11-11T12:51:37.816Z'
discontinue_on:
- created_at: '2021-11-10T10:24:17.929Z'
+ created_at: '2021-11-11T12:51:37.810Z'
public_metadata: {}
private_metadata: {}
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #181 - 6947'
+ name: 'Product #178 - 504'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -12573,7 +13613,7 @@ paths:
relationships:
product:
data:
- id: '181'
+ id: '178'
type: product
tax_category:
data:
@@ -12587,11 +13627,11 @@ paths:
type: option_value
stock_items:
data:
- - id: '305'
+ - id: '302'
type: stock_item
stock_locations:
data:
- - id: '173'
+ - id: '170'
type: stock_location
meta:
count: 3
@@ -12646,27 +13686,27 @@ paths:
Example:
value:
data:
- id: '255'
+ id: '252'
type: variant
attributes:
- sku: SKU-255
- weight: '50.58'
- height: '35.51'
- depth: '38.9'
+ sku: SKU-252
+ weight: '47.6'
+ height: '51.5'
+ depth: '158.75'
deleted_at:
is_master: false
cost_price: '17.0'
position: 2
cost_currency: USD
track_inventory: true
- updated_at: '2021-11-10T10:24:18.311Z'
+ updated_at: '2021-11-11T12:51:38.127Z'
discontinue_on:
- created_at: '2021-11-10T10:24:18.302Z'
+ created_at: '2021-11-11T12:51:38.121Z'
public_metadata: {}
private_metadata: {}
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #183 - 1923'
+ name: 'Product #180 - 3834'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -12679,7 +13719,7 @@ paths:
relationships:
product:
data:
- id: '183'
+ id: '180'
type: product
tax_category:
data:
@@ -12693,11 +13733,11 @@ paths:
type: option_value
stock_items:
data:
- - id: '310'
+ - id: '307'
type: stock_item
stock_locations:
data:
- - id: '175'
+ - id: '172'
type: stock_location
schema:
"$ref": "#/components/schemas/resource"
@@ -12827,14 +13867,14 @@ paths:
- id: '1'
type: event
attributes:
- execution_time: 19417
+ execution_time: 80577
name: order.canceled
request_errors: ''
response_code: '200'
success: true
url: https://www.url1.com/
- created_at: '2021-11-10T10:24:18.883Z'
- updated_at: '2021-11-10T10:24:18.883Z'
+ created_at: '2021-11-11T12:51:38.489Z'
+ updated_at: '2021-11-11T12:51:38.489Z'
relationships:
subscriber:
data:
@@ -12843,14 +13883,14 @@ paths:
- id: '2'
type: event
attributes:
- execution_time: 59686
+ execution_time: 65949
name: order.canceled
request_errors: ''
response_code: '200'
success: true
url: https://www.url2.com/
- created_at: '2021-11-10T10:24:18.886Z'
- updated_at: '2021-11-10T10:24:18.886Z'
+ created_at: '2021-11-11T12:51:38.493Z'
+ updated_at: '2021-11-11T12:51:38.493Z'
relationships:
subscriber:
data:
@@ -12926,8 +13966,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-11-10T10:24:18.978Z'
- updated_at: '2021-11-10T10:24:18.978Z'
+ created_at: '2021-11-11T12:51:38.552Z'
+ updated_at: '2021-11-11T12:51:38.552Z'
- id: '6'
type: subscriber
attributes:
@@ -12935,8 +13975,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-11-10T10:24:18.980Z'
- updated_at: '2021-11-10T10:24:18.980Z'
+ created_at: '2021-11-11T12:51:38.553Z'
+ updated_at: '2021-11-11T12:51:38.553Z'
meta:
count: 2
total_count: 2
@@ -12984,8 +14024,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-11-10T10:24:19.077Z'
- updated_at: '2021-11-10T10:24:19.077Z'
+ created_at: '2021-11-11T12:51:38.616Z'
+ updated_at: '2021-11-11T12:51:38.616Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -13040,8 +14080,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-11-10T10:24:19.141Z'
- updated_at: '2021-11-10T10:24:19.141Z'
+ created_at: '2021-11-11T12:51:38.655Z'
+ updated_at: '2021-11-11T12:51:38.655Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -13094,8 +14134,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-11-10T10:24:19.259Z'
- updated_at: '2021-11-10T10:24:19.259Z'
+ created_at: '2021-11-11T12:51:38.805Z'
+ updated_at: '2021-11-11T12:51:38.805Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -13216,61 +14256,61 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-11-10T10:24:19.716Z'
- updated_at: '2021-11-10T10:24:19.716Z'
- display_total: "$19.99"
+ created_at: '2021-11-11T12:51:39.081Z'
+ updated_at: '2021-11-11T12:51:39.081Z'
display_price: "$19.99"
+ display_total: "$19.99"
price: '19.99'
total: '19.99'
relationships:
variant:
data:
- id: '265'
+ id: '262'
type: variant
- id: '2'
type: wished_item
attributes:
quantity: 1
- created_at: '2021-11-10T10:24:19.804Z'
- updated_at: '2021-11-10T10:24:19.804Z'
- display_total: "$19.99"
+ created_at: '2021-11-11T12:51:39.129Z'
+ updated_at: '2021-11-11T12:51:39.129Z'
display_price: "$19.99"
+ display_total: "$19.99"
price: '19.99'
total: '19.99'
relationships:
variant:
data:
- id: '267'
+ id: '264'
type: variant
- id: '3'
type: wished_item
attributes:
quantity: 1
- created_at: '2021-11-10T10:24:19.891Z'
- updated_at: '2021-11-10T10:24:19.891Z'
- display_total: "$19.99"
+ created_at: '2021-11-11T12:51:39.175Z'
+ updated_at: '2021-11-11T12:51:39.175Z'
display_price: "$19.99"
+ display_total: "$19.99"
price: '19.99'
total: '19.99'
relationships:
variant:
data:
- id: '269'
+ id: '266'
type: variant
- id: '4'
type: wished_item
attributes:
quantity: 1
- created_at: '2021-11-10T10:24:19.972Z'
- updated_at: '2021-11-10T10:24:19.972Z'
- display_total: "$19.99"
+ created_at: '2021-11-11T12:51:39.222Z'
+ updated_at: '2021-11-11T12:51:39.222Z'
display_price: "$19.99"
+ display_total: "$19.99"
price: '19.99'
total: '19.99'
relationships:
variant:
data:
- id: '271'
+ id: '268'
type: variant
meta:
count: 4
@@ -13323,16 +14363,16 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-11-10T10:24:20.665Z'
- updated_at: '2021-11-10T10:24:20.665Z'
- display_total: "$19.99"
+ created_at: '2021-11-11T12:51:39.681Z'
+ updated_at: '2021-11-11T12:51:39.681Z'
display_price: "$19.99"
+ display_total: "$19.99"
price: '19.99'
total: '19.99'
relationships:
variant:
data:
- id: '283'
+ id: '280'
type: variant
schema:
"$ref": "#/components/schemas/resource"
@@ -13394,16 +14434,16 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-11-10T10:24:21.236Z'
- updated_at: '2021-11-10T10:24:21.236Z'
- display_total: "$19.99"
+ created_at: '2021-11-11T12:51:39.885Z'
+ updated_at: '2021-11-11T12:51:39.885Z'
display_price: "$19.99"
+ display_total: "$19.99"
price: '19.99'
total: '19.99'
relationships:
variant:
data:
- id: '289'
+ id: '286'
type: variant
schema:
"$ref": "#/components/schemas/resource"
@@ -13461,16 +14501,16 @@ paths:
type: wished_item
attributes:
quantity: 3
- created_at: '2021-11-10T10:24:21.874Z'
- updated_at: '2021-11-10T10:24:21.885Z'
- display_total: "$59.97"
+ created_at: '2021-11-11T12:51:40.234Z'
+ updated_at: '2021-11-11T12:51:40.242Z'
display_price: "$19.99"
+ display_total: "$59.97"
price: '19.99'
total: '59.97'
relationships:
variant:
data:
- id: '299'
+ id: '296'
type: variant
schema:
"$ref": "#/components/schemas/resource"
@@ -13597,9 +14637,9 @@ paths:
name: Black Friday
is_private: true
is_default: false
- created_at: '2021-11-10T10:24:23.307Z'
- updated_at: '2021-11-10T10:24:23.307Z'
- token: yFd8XPCVM8zcxTxcmQnw1g3C
+ created_at: '2021-11-11T12:51:40.934Z'
+ updated_at: '2021-11-11T12:51:40.934Z'
+ token: sn2bVFiKqyRsWq1k84LgrtNp
variant_included: false
relationships:
wished_items:
@@ -13614,9 +14654,9 @@ paths:
name: Birthday
is_private: true
is_default: false
- created_at: '2021-11-10T10:24:23.310Z'
- updated_at: '2021-11-10T10:24:23.310Z'
- token: S5dTXFMJzpm2XTBK3Tk5Ar1p
+ created_at: '2021-11-11T12:51:40.935Z'
+ updated_at: '2021-11-11T12:51:40.935Z'
+ token: KvD9whqEDx1LsmFtDqk7bCXH
variant_included: false
relationships:
wished_items:
@@ -13678,9 +14718,9 @@ paths:
name: Wishlist_26
is_private: true
is_default: false
- created_at: '2021-11-10T10:24:24.187Z'
- updated_at: '2021-11-10T10:24:24.187Z'
- token: uQssf4strbTnnvfobvVKs6ei
+ created_at: '2021-11-11T12:51:41.386Z'
+ updated_at: '2021-11-11T12:51:41.386Z'
+ token: ukJ4rT3yWset9uoSpg3opsSH
variant_included: false
relationships:
wished_items:
@@ -13744,9 +14784,9 @@ paths:
name: My Wishlist
is_private: true
is_default: false
- created_at: '2021-11-10T10:24:24.276Z'
- updated_at: '2021-11-10T10:24:24.276Z'
- token: 7tomSZ2xS7k6czj3GAsC1jAw
+ created_at: '2021-11-11T12:51:41.434Z'
+ updated_at: '2021-11-11T12:51:41.434Z'
+ token: x7qgDNmu26Nj6xvjguSEaTxs
variant_included: false
relationships:
wished_items:
@@ -13809,9 +14849,9 @@ paths:
name: My Super Wishlist
is_private: true
is_default: false
- created_at: '2021-11-10T10:24:24.409Z'
- updated_at: '2021-11-10T10:24:24.421Z'
- token: tSxpUCVVUzQk1fjhThrj5oDP
+ created_at: '2021-11-11T12:51:41.506Z'
+ updated_at: '2021-11-11T12:51:41.514Z'
+ token: DVBj87Vd33aymLq48yeQWvh6
variant_included: false
relationships:
wished_items:
@@ -13938,13 +14978,13 @@ paths:
- id: '96'
type: zone
attributes:
- name: Suscipit deleniti tempora alias quae nihil sunt placeat.
- description: Adipisci optio deleniti consequuntur doloremque
- totam voluptate eos.
+ name: Magnam earum possimus dolorem omnis aliquam quos.
+ description: Explicabo doloribus omnis enim impedit ut beatae
+ earum.
default_tax: false
zone_members_count: 0
- created_at: '2021-11-10T10:24:24.680Z'
- updated_at: '2021-11-10T10:24:24.680Z'
+ created_at: '2021-11-11T12:51:41.674Z'
+ updated_at: '2021-11-11T12:51:41.674Z'
kind: state
relationships:
zone_members:
@@ -13952,12 +14992,12 @@ paths:
- id: '97'
type: zone
attributes:
- name: Voluptatem aliquam quos quaerat autem itaque tenetur.
- description: Placeat natus adipisci vel vero voluptates unde.
+ name: Mollitia nemo molestiae quam quaerat.
+ description: Incidunt fuga ad beatae nesciunt dicta vel cumque.
default_tax: false
zone_members_count: 0
- created_at: '2021-11-10T10:24:24.682Z'
- updated_at: '2021-11-10T10:24:24.682Z'
+ created_at: '2021-11-11T12:51:41.675Z'
+ updated_at: '2021-11-11T12:51:41.675Z'
kind: state
relationships:
zone_members:
@@ -14012,12 +15052,13 @@ paths:
id: '100'
type: zone
attributes:
- name: Atque dolorum ipsa sed pariatur temporibus.
- description: Iure ex excepturi laudantium itaque nostrum.
+ name: Quas sit quis dicta vitae sed.
+ description: Error mollitia dignissimos reiciendis quis nobis
+ nostrum perspiciatis quam.
default_tax: false
zone_members_count: 0
- created_at: '2021-11-10T10:24:24.780Z'
- updated_at: '2021-11-10T10:24:24.780Z'
+ created_at: '2021-11-11T12:51:41.731Z'
+ updated_at: '2021-11-11T12:51:41.731Z'
kind: state
relationships:
zone_members:
@@ -14076,12 +15117,13 @@ paths:
id: '101'
type: zone
attributes:
- name: Iste dolores incidunt laboriosam aliquid unde ut facilis.
- description: Nihil fugiat impedit delectus quisquam.
+ name: Porro neque molestiae voluptatum illo.
+ description: Veniam adipisci minima voluptatibus autem rerum
+ repellat.
default_tax: false
zone_members_count: 0
- created_at: '2021-11-10T10:24:24.858Z'
- updated_at: '2021-11-10T10:24:24.858Z'
+ created_at: '2021-11-11T12:51:41.771Z'
+ updated_at: '2021-11-11T12:51:41.771Z'
kind: state
relationships:
zone_members:
@@ -14145,8 +15187,8 @@ paths:
description: The zone containing all EU countries
default_tax: false
zone_members_count: 0
- created_at: '2021-11-10T10:24:24.973Z'
- updated_at: '2021-11-10T10:24:24.985Z'
+ created_at: '2021-11-11T12:51:41.833Z'
+ updated_at: '2021-11-11T12:51:41.839Z'
kind: state
relationships:
zone_members:
@@ -14250,7 +15292,10 @@ tags:
- name: Orders
- name: Payments
- name: Payment Methods
+- name: Promotions
+- name: Promotion Actions
- name: Promotion Categories
+- name: Promotion Rules
- name: Roles
- name: Shipments
- name: Shipping Categories
@@ -14893,7 +15938,7 @@ components:
type: string
example: Shop Today
description: Create a title for the Hero Section.
- digital[image_one]:
+ cms_section[image_one]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
@@ -15028,11 +16073,11 @@ components:
- No Gutters
description: This value is used by front end developers for styling
the section padding.
- digital[image_one]:
+ cms_section[image_one]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
- digital[image_two]:
+ cms_section[image_two]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
@@ -15144,15 +16189,15 @@ components:
- Hide
description: This value is used by front end developers for showing
and hiding the label on the images.
- digital[image_one]:
+ cms_section[image_one]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
- digital[image_two]:
+ cms_section[image_two]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
- digital[image_three]:
+ cms_section[image_three]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
@@ -15351,7 +16396,7 @@ components:
type: string
example: Shop Today
description: Update the title for this section.
- digital[image_one]:
+ cms_section[image_one]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
@@ -15482,11 +16527,11 @@ components:
- No Gutters
description: This value is used by front end developers for styling
the section padding.
- digital[image_one]:
+ cms_section[image_one]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
- digital[image_two]:
+ cms_section[image_two]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
@@ -15596,15 +16641,15 @@ components:
- Hide
description: This value is used by front end developers for showing
and hiding the label on the images.
- digital[image_one]:
+ cms_section[image_one]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
- digital[image_two]:
+ cms_section[image_two]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
- digital[image_three]:
+ cms_section[image_three]:
type: string
format: binary
description: Use a `multipart/form-data` request to upload assets.
@@ -16152,7 +17197,7 @@ components:
completed_at:
type: string
format: date_time
- example: 2021-11-10 10:23:15 UTC
+ example: 2021-11-11 12:51:00 UTC
bill_address_id:
type: string
example: '1'
@@ -16220,7 +17265,7 @@ components:
approved_at:
type: string
format: date_time
- example: 2021-11-10 10:23:15 UTC
+ example: 2021-11-11 12:51:00 UTC
confirmation_delivered:
type: boolean
example: true
@@ -16291,7 +17336,7 @@ components:
completed_at:
type: string
format: date_time
- example: 2021-11-10 10:23:15 UTC
+ example: 2021-11-11 12:51:00 UTC
bill_address_id:
type: string
example: '1'
@@ -16359,7 +17404,7 @@ components:
approved_at:
type: string
format: date_time
- example: 2021-11-10 10:23:15 UTC
+ example: 2021-11-11 12:51:00 UTC
confirmation_delivered:
type: boolean
example: true
@@ -16625,6 +17670,357 @@ components:
required:
- product
x-internal: true
+ create_promotion_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ example: Promotions Used in 2021
+ description: Give the promotion a name.
+ code:
+ type: string
+ example: BLK-FRI
+ nullable: true
+ description: Set the promotion code. Promotions without a code are automatically
+ applied if the order meets the Promotion Rule requirements.
+ description:
+ type: string
+ example: Save today with discount code XYZ at checkout.
+ nullable: true
+ description: Give the promotion a description.
+ usage_limit:
+ type: integer
+ example: 100
+ nullable: true
+ description: If you wish you can set a usage limit for this promotion.
+ advertise:
+ type: boolean
+ starts_at:
+ type: string
+ format: date_time
+ nullable: true
+ description: Set a date and time that this promotion begins.
+ ends_at:
+ type: string
+ format: date_time
+ nullable: true
+ description: Set a date and time that this promotion ends.
+ store_ids:
+ type: array
+ items:
+ allOf:
+ - type: string
+ example: '2'
+ required:
+ - promotion
+ title: Create a Promotion
+ x-internal: true
+ update_promotion_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ name:
+ type: string
+ example: Promotions Used in 2021
+ description: Change the promotion a name.
+ code:
+ type: string
+ example: CYB-MON
+ nullable: true
+ description: Change or remove the promotion code. Promotions without
+ a code are automatically applied if the order meets the Promotion
+ Rule requirements.
+ description:
+ type: string
+ example: Save today with discount code XYZ at checkout.
+ nullable: true
+ description: Update the promotion a description.
+ usage_limit:
+ type: integer
+ example: 100
+ nullable: true
+ description: If you wish you can set a usage limit for this promotion.
+ advertise:
+ type: boolean
+ starts_at:
+ type: string
+ format: date_time
+ nullable: true
+ description: Set a date and time that this promotion begins.
+ ends_at:
+ type: string
+ format: date_time
+ nullable: true
+ description: Set a date and time that this promotion ends.
+ store_ids:
+ type: array
+ items:
+ allOf:
+ - type: string
+ example: '2'
+ required:
+ - promotion
+ title: Update a Promotion
+ x-internal: true
+ update_promotion_add_rule_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ promotion_rules_attributes:
+ type: array
+ items:
+ allOf:
+ - properties:
+ type:
+ type: string
+ example: Spree::Promotion::Rules::Country
+ enum:
+ - Spree::Promotion::Rules::Country
+ - Spree::Promotion::Rules::ItemTotal
+ - Spree::Promotion::Rules::Product
+ - Spree::Promotion::Rules::User
+ - Spree::Promotion::Rules::FirstOrder
+ - Spree::Promotion::Rules::UserLoggedIn
+ - Spree::Promotion::Rules::OneUsePerUser
+ - Spree::Promotion::Rules::Taxon
+ - Spree::Promotion::Rules::OptionValue
+ description: Set the Promotion Rule type.
+ preferred_country_id:
+ type: integer
+ example: 122
+ description: 'Each rule type has its own preferred attributes.
+ In this example we are setting the ID of the Country this
+ rule applies to. To learn more about Spree preferences visit
+ TODO: [LINK].'
+ required:
+ - promotion
+ title: Add a Rule to a Promotion
+ x-internal: true
+ update_promotion_update_rule_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ promotion_rules_attributes:
+ type: array
+ items:
+ allOf:
+ - properties:
+ id:
+ type: string
+ example: '22'
+ description: To update an existing Promotion Rule, you are required
+ to pass the ID of the rule you are updating.
+ type:
+ type: string
+ example: Spree::Promotion::Rules::Country
+ enum:
+ - Spree::Promotion::Rules::Country
+ - Spree::Promotion::Rules::ItemTotal
+ - Spree::Promotion::Rules::Product
+ - Spree::Promotion::Rules::User
+ - Spree::Promotion::Rules::FirstOrder
+ - Spree::Promotion::Rules::UserLoggedIn
+ - Spree::Promotion::Rules::OneUsePerUser
+ - Spree::Promotion::Rules::Taxon
+ - Spree::Promotion::Rules::OptionValue
+ description: Set the Promotion Rule type.
+ preferred_country_id:
+ type: integer
+ example: 143
+ description: 'Each rule type has its own preferred attributes.
+ In this example we are changing the ID of the Country this
+ rule applies to. To learn more about Spree preferences visit
+ TODO: [LINK].'
+ required:
+ - promotion
+ title: Update an existing Rule
+ x-internal: true
+ update_promotion_add_action_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ promotion_actions_attributes:
+ type: array
+ items:
+ allOf:
+ - properties:
+ type:
+ type: string
+ example: Spree::Promotion::Actions::CreateAdjustment
+ enum:
+ - Spree::Promotion::Actions::CreateAdjustment
+ - Spree::Promotion::Actions::CreateItemAdjustments
+ - Spree::Promotion::Actions::FreeShipping
+ - Spree::Promotion::Actions::CreateLineItems
+ description: Set the Promotion Action Type.
+ required:
+ - promotion
+ title: Add an Action to a Promotion
+ x-internal: true
+ update_promotion_action_calculator_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ promotion_actions_attributes:
+ type: array
+ items:
+ allOf:
+ - properties:
+ id:
+ type: string
+ example: '22'
+ description: To update an existing Promotion Action, you are
+ required to pass the ID of the action you wish to update.
+ calculator_attributes:
+ properties:
+ id:
+ type: string
+ example: '19'
+ description: To update an existing Action Calculator, you
+ are required to pass the ID of the calculator.
+ type:
+ type: string
+ example: Promotion::Actions::CreateAdjustment
+ enum:
+ - Promotion::Actions::CreateAdjustment
+ - Promotion::Actions::CreateItemAdjustments
+ - Promotion::Actions::CreateLineItems
+ - Promotion::Actions::FreeShipping
+ description: Set the Type of Promotion Action you wish to
+ use.
+ preferred_flat_percent:
+ type: integer
+ example: 10
+ description: In this example we are setting the preferred
+ flat percentage to `10`.
+ required:
+ - promotion
+ title: Update an Action Calculator
+ x-internal: true
+ update_promotion_change_calculator_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ promotion_actions_attributes:
+ type: array
+ items:
+ allOf:
+ - properties:
+ id:
+ type: string
+ example: '22'
+ description: To update an existing Promotion Action, you are
+ required to pass the ID of the Promotion Action.
+ calculator_attributes:
+ properties:
+ type:
+ type: string
+ example: Spree::Calculator::FlatPercentItemTotal
+ enum:
+ - Spree::Calculator::FlatPercentItemTotal
+ - Spree::Calculator::FlatRate
+ - Spree::Calculator::FlexiRate
+ - Spree::Calculator::TieredPercent
+ - Spree::Calculator::TieredFlatRate
+ - Spree::Calculator::PercentOnLineItem
+ description: 'To set the Promotion Action Calculator pass
+ the calculator type. Each Promotion action has certain
+ Calculators available, to learn more visit TODO: [LINK]'
+ required:
+ - promotion
+ title: Change an Action Calculator
+ x-internal: true
+ update_promotion_change_action_params:
+ type: object
+ properties:
+ promotion:
+ type: object
+ properties:
+ promotion_actions_attributes:
+ type: array
+ items:
+ allOf:
+ - properties:
+ id:
+ type: string
+ example: '22'
+ description: To update an existing Promotion Action, you are
+ required to pass the ID of the Promotion Action.
+ type:
+ type: string
+ example: Promotion::Actions::CreateAdjustment
+ enum:
+ - Promotion::Actions::CreateAdjustment
+ - Promotion::Actions::CreateItemAdjustments
+ - Promotion::Actions::CreateLineItems
+ - Promotion::Actions::FreeShipping
+ description: Set the Type of Promotion Action you wish to use.
+ required:
+ - promotion
+ title: Change an Action Type
+ x-internal: true
+ create_promotion_action_params:
+ type: object
+ properties:
+ promotion_action:
+ type: object
+ required:
+ - type
+ - promotion_id
+ properties:
+ type:
+ type: string
+ example: Promotion::Actions::CreateAdjustment
+ enum:
+ - Promotion::Actions::CreateAdjustment
+ - Promotion::Actions::CreateItemAdjustments
+ - Promotion::Actions::CreateLineItems
+ - Promotion::Actions::FreeShipping
+ description: Set the Type of Promotion Action you wish to use.
+ promotion_id:
+ type: string
+ example: '22'
+ description: Set the ID of the promotion this action belongs to.
+ required:
+ - promotion_action
+ title: Create a Promotion Action
+ x-internal: true
+ update_promotion_action_params:
+ type: object
+ properties:
+ promotion_action:
+ type: object
+ properties:
+ type:
+ type: string
+ example: Promotion::Actions::CreateAdjustment
+ enum:
+ - Promotion::Actions::CreateAdjustment
+ - Promotion::Actions::CreateItemAdjustments
+ - Promotion::Actions::CreateLineItems
+ - Promotion::Actions::FreeShipping
+ description: Set the Type of Promotion Action you wish to use.
+ required:
+ - promotion_action
+ title: Create a Promotion Action
+ x-internal: true
create_promotion_category_params:
type: object
properties:
@@ -16636,9 +18032,12 @@ components:
name:
type: string
example: Promotions Used in 2021
+ description: Give this Promotion Category a name.
code:
type: string
example: 2021-PROMOS
+ nullable: true
+ description: Give this promotion category a code.
required:
- promotion_category
x-internal: true
@@ -16653,12 +18052,71 @@ components:
name:
type: string
example: Promotions Used in 2021
+ description: Update the name of this Promotion Category.
code:
type: string
example: 2021-PROMOS
+ nullable: true
+ description: Change or remove the code for this Promotion Category.
required:
- promotion_category
x-internal: true
+ create_promotion_rule_params:
+ type: object
+ properties:
+ promotion_rule:
+ type: object
+ required:
+ - type
+ - promotion_id
+ properties:
+ promotion_id:
+ type: string
+ example: '22'
+ description: Set the ID of the promotion this Promotion Rule belongs
+ to.
+ type:
+ type: string
+ example: Spree::Promotion::Rules::Country
+ enum:
+ - Spree::Promotion::Rules::Country
+ - Spree::Promotion::Rules::ItemTotal
+ - Spree::Promotion::Rules::Product
+ - Spree::Promotion::Rules::User
+ - Spree::Promotion::Rules::FirstOrder
+ - Spree::Promotion::Rules::UserLoggedIn
+ - Spree::Promotion::Rules::OneUsePerUser
+ - Spree::Promotion::Rules::Taxon
+ - Spree::Promotion::Rules::OptionValue
+ description: Set the Promotion Rule type.
+ required:
+ - promotion_rule
+ title: Create a Promotion Rule
+ x-internal: true
+ update_promotion_rule_params:
+ type: object
+ properties:
+ promotion_rule:
+ type: object
+ properties:
+ type:
+ type: string
+ example: Spree::Promotion::Rules::Country
+ enum:
+ - Spree::Promotion::Rules::Country
+ - Spree::Promotion::Rules::ItemTotal
+ - Spree::Promotion::Rules::Product
+ - Spree::Promotion::Rules::User
+ - Spree::Promotion::Rules::FirstOrder
+ - Spree::Promotion::Rules::UserLoggedIn
+ - Spree::Promotion::Rules::OneUsePerUser
+ - Spree::Promotion::Rules::Taxon
+ - Spree::Promotion::Rules::OptionValue
+ description: Set the Promotion Rule type.
+ required:
+ - promotion_rule
+ title: Create a Promotion Rule
+ x-internal: true
create_role_params:
type: object
properties:
diff --git a/api/lib/spree/api/testing_support/v2/platform_contexts.rb b/api/lib/spree/api/testing_support/v2/platform_contexts.rb
index f1f5f35eae..6cc22ba6d1 100644
--- a/api/lib/spree/api/testing_support/v2/platform_contexts.rb
+++ b/api/lib/spree/api/testing_support/v2/platform_contexts.rb
@@ -192,7 +192,7 @@ shared_examples 'POST create record' do |resource_name, **options|
let(param_name) { valid_create_param_value }
it_behaves_like 'record created'
- it_behaves_like 'invalid request', param_name
+ it_behaves_like 'invalid request', param_name unless options[:skip_invalid_params] == true
end
end
@@ -226,7 +226,7 @@ shared_examples 'PATCH update record' do |resource_name, **options|
let(param_name) { valid_update_param_value }
it_behaves_like 'record updated'
- it_behaves_like 'invalid request', param_name
+ it_behaves_like 'invalid request', param_name unless options[:skip_invalid_params] == true
it_behaves_like 'record not found'
it_behaves_like 'authentication failed'
end
diff --git a/api/spec/integration/api/v2/platform/promotion_actions_spec.rb b/api/spec/integration/api/v2/platform/promotion_actions_spec.rb
new file mode 100644
index 0000000000..c6fa34df3f
--- /dev/null
+++ b/api/spec/integration/api/v2/platform/promotion_actions_spec.rb
@@ -0,0 +1,25 @@
+require 'swagger_helper'
+
+describe 'Promotion Actions API', swagger: true do
+ include_context 'Platform API v2'
+
+ resource_name = 'Promotion Action'
+ options = {
+ skip_invalid_params: true,
+ include_example: 'calculator',
+ filter_examples: [{ name: 'filter[type_eq]', example: 'Spree::Promotion::Actions::CreateAdjustment' }]
+ }
+
+ let(:promotion) { create(:promotion) }
+
+ let(:id) { create(:promotion_action, promotion: promotion).id }
+ let(:records_list) { create_list(:promotion_action, 2, promotion: promotion) }
+ let(:valid_create_param_value) { build(:promotion_action, promotion: promotion).attributes }
+ let(:valid_update_param_value) do
+ {
+ type: 'Spree::Promotion::Actions::CreateAdjustment'
+ }
+ end
+
+ include_examples 'CRUD examples', resource_name, options
+end
diff --git a/api/spec/integration/api/v2/platform/promotion_rules_spec.rb b/api/spec/integration/api/v2/platform/promotion_rules_spec.rb
new file mode 100644
index 0000000000..75c25a5114
--- /dev/null
+++ b/api/spec/integration/api/v2/platform/promotion_rules_spec.rb
@@ -0,0 +1,25 @@
+require 'swagger_helper'
+
+describe 'Promotion Rules API', swagger: true do
+ include_context 'Platform API v2'
+
+ resource_name = 'Promotion Rule'
+ options = {
+ skip_invalid_params: true,
+ include_example: 'user',
+ filter_examples: [{ name: 'filter[type_eq]', example: 'Spree::Promotion::Rules::Product' }]
+ }
+
+ let(:promotion) { create(:promotion) }
+
+ let(:id) { create(:promotion_rule, promotion: promotion).id }
+ let(:records_list) { create_list(:promotion_rule, 2, promotion: promotion) }
+ let(:valid_create_param_value) { build(:promotion_rule, promotion: promotion).attributes }
+ let(:valid_update_param_value) do
+ {
+ type: 'Spree::Promotion::Rules::Country'
+ }
+ end
+
+ include_examples 'CRUD examples', resource_name, options
+end
diff --git a/api/spec/integration/api/v2/platform/promotions_spec.rb b/api/spec/integration/api/v2/platform/promotions_spec.rb
new file mode 100644
index 0000000000..0724688e71
--- /dev/null
+++ b/api/spec/integration/api/v2/platform/promotions_spec.rb
@@ -0,0 +1,89 @@
+require 'swagger_helper'
+
+describe 'Promotions API', swagger: true do
+ include_context 'Platform API v2'
+
+ resource_name = 'Promotion'
+ options = {
+ include_example: 'promotion_category,promotion_rules,promotion_actions,stores',
+ filter_examples: [{ name: 'filter[code_eq]', example: 'BLK-FRI' },
+ { name: 'filter[name_cont]', example: 'New Customer' }],
+ custom_update_params: {
+ oneOf: [
+ { '$ref' => '#/components/schemas/update_promotion_params' },
+ { '$ref' => '#/components/schemas/update_promotion_add_rule_params' },
+ { '$ref' => '#/components/schemas/update_promotion_update_rule_params' },
+
+ { '$ref' => '#/components/schemas/update_promotion_add_action_params' },
+ { '$ref' => '#/components/schemas/update_promotion_change_action_params' },
+
+ { '$ref' => '#/components/schemas/update_promotion_action_calculator_params' },
+ { '$ref' => '#/components/schemas/update_promotion_change_calculator_params' }
+ ]
+ }
+ }
+
+ let!(:store) { Spree::Store.default }
+ let!(:store_two) { create(:store) }
+ let!(:store_three) { create(:store) }
+
+ let(:promotion_category) { create(:promotion_category) }
+ let(:promotion_rule) { create(:promotion_rule) }
+
+ let(:id) { create(:promotion_with_item_adjustment, promotion_category: promotion_category, promotion_rules: [promotion_rule]).id }
+ let!(:records_list) { create_list(:promotion_with_item_adjustment, 3, promotion_category: promotion_category, promotion_rules: [promotion_rule]) }
+
+ let!(:promotion_attibutes) do
+ {
+ promotion: {
+ name: 'Black Friday 20% Off',
+ code: 'BLK-20',
+ promotion_category_id: promotion_category.id.to_s,
+ match_policy: 'any',
+ type: 'Spree::Promotion',
+ description: 'First 1000 Customers Save 20%',
+ starts_at: Time.current,
+ expires_at: Time.current + 4.days,
+ usage_limit: 1000,
+ path: '/black-fri/today',
+ advertise: true,
+ store_ids: [store_two.id.to_s, store_three.id.to_s]
+ }
+ }
+ end
+
+ let(:valid_create_param_value) do
+ promotion_attibutes.merge(
+ promotion_rules_attributes: [
+ attributes_for(:promotion_rule, code: 'ESJD',
+ user_id: '223',
+ product_group_id: '3',
+ type: 'Spree::Promotion::Rules::User')
+ ],
+ promotion_actions_attributes: [
+ {
+ type: 'Spree::Promotion::Actions::FreeShipping',
+ position: 1
+
+ }
+ ]
+ )
+ end
+
+ let(:valid_update_param_value) do
+ {
+ name: '10% OFF',
+ code: 'RAND-10',
+ description: 'This is the new updated promo',
+ advertise: false
+ }
+ end
+
+ let(:invalid_param_value) do
+ {
+ name: ''
+ }
+ end
+
+ include_examples 'CRUD examples', resource_name, options
+end
diff --git a/api/spec/requests/spree/api/v2/platform/promotions_spec.rb b/api/spec/requests/spree/api/v2/platform/promotions_spec.rb
new file mode 100644
index 0000000000..9b7012f852
--- /dev/null
+++ b/api/spec/requests/spree/api/v2/platform/promotions_spec.rb
@@ -0,0 +1,148 @@
+require 'spec_helper'
+
+describe 'Promotion API v2 spec', type: :request do
+ include_context 'API v2 tokens'
+ include_context 'Platform API v2'
+
+ let(:bearer_token) { { 'Authorization' => valid_authorization } }
+ let!(:store) { Spree::Store.default }
+ let!(:second_store) { create(:store) }
+ let!(:third_store) { create(:store) }
+
+ let(:promotion_rule) { create(:promotion_rule) }
+ let(:existing_promotion) { create(:promotion_with_item_adjustment, promotion_rules: [promotion_rule]) }
+ let(:promotion_category) { create(:promotion_category, code: 'o8ehG', name: 'Super Saver Promotions') }
+ let(:promotion_category_two) { create(:promotion_category, code: 'XiP83df-u', name: 'Promotions From 2018') }
+
+ let(:new_promotion_attributes) do
+ {
+ name: 'Cyber Monday Sale',
+ code: 'CM-20',
+ promotion_category_id: promotion_category.id.to_s,
+ match_policy: 'all',
+ type: 'Spree::Promotion',
+ description: 'Save big this Cyber Monday - First 100 Customers save 20%',
+ starts_at: '2021-10-20 13:09:00 UTC',
+ expires_at: '2021-10-25 13:09:00 UTC',
+ usage_limit: 100,
+ path: '/cyber-monday/today',
+ advertise: true,
+ store_ids: [second_store.id.to_s],
+ promotion_rules_attributes: [
+ {
+ code: 'ESJD',
+ type: 'Spree::Promotion::Rules::User'
+ }
+ ],
+ promotion_actions_attributes: [
+ {
+ type: 'Spree::Promotion::Actions::FreeShipping',
+ position: 1
+ }
+ ]
+ }
+ end
+
+ let(:update_promotion_attributes) do
+ {
+ name: 'Black Friday Sale',
+ code: 'BF-20',
+ promotion_category_id: promotion_category.id.to_s,
+ match_policy: 'any',
+ type: 'Spree::Promotion',
+ description: 'Black Friday Saver - First 100 Customers save 20%',
+ starts_at: '2021-10-20 13:09:00 UTC',
+ expires_at: '2021-10-25 13:09:00 UTC',
+ usage_limit: 100,
+ path: '/black-fri/today',
+ advertise: true,
+ store_ids: [second_store.id.to_s, third_store.id.to_s],
+ promotion_rules_attributes: [
+ {
+ id: existing_promotion.promotion_rules.first.id.to_s,
+ code: 'PliDp9328',
+ type: 'Spree::Promotion::Rules::User'
+ }
+ ],
+ promotion_actions_attributes: [
+ {
+ id: existing_promotion.promotion_actions.first.id.to_s,
+ type: 'Spree::Promotion::Actions::FreeShipping'
+ }
+ ]
+ }
+ end
+
+ describe 'promotions#create' do
+ context 'with valid params' do
+ before { post '/api/v2/platform/promotions?include=promotion_category,promotion_actions,promotion_rules,stores', params: params, headers: bearer_token }
+
+ let(:params) { { promotion: new_promotion_attributes } }
+
+ it 'creates and returns a promotion' do
+ # promotion
+ expect(json_response['data']).to have_attribute(:name).with_value(new_promotion_attributes[:name])
+ expect(json_response['data']).to have_attribute(:code).with_value(new_promotion_attributes[:code])
+ expect(json_response['data']).to have_attribute(:match_policy).with_value(new_promotion_attributes[:match_policy])
+ expect(json_response['data']).to have_attribute(:type).with_value(new_promotion_attributes[:type])
+ expect(json_response['data']).to have_attribute(:description).with_value(new_promotion_attributes[:description])
+ expect(json_response['data']).to have_attribute(:starts_at).with_value('2021-10-20T13:09:00.000Z')
+ expect(json_response['data']).to have_attribute(:expires_at).with_value('2021-10-25T13:09:00.000Z')
+ expect(json_response['data']).to have_attribute(:usage_limit).with_value(new_promotion_attributes[:usage_limit])
+ expect(json_response['data']).to have_attribute(:path).with_value(new_promotion_attributes[:path])
+ expect(json_response['data']).to have_attribute(:advertise).with_value(new_promotion_attributes[:advertise])
+
+ # included promotion_category
+ expect(json_response['included']).to include(have_type('promotion_category'))
+ expect(json_response['included'][0]).to eq(Spree::Api::V2::Platform::PromotionCategorySerializer.new(promotion_category).as_json['data'])
+
+ # included promotion_action
+ expect(json_response['included']).to include(have_type('promotion_action'))
+ expect(json_response['included'][1]).to have_attribute(:type).with_value('Spree::Promotion::Actions::FreeShipping')
+
+ # included promotion_rule
+ expect(json_response['included']).to include(have_type('promotion_rule'))
+ expect(json_response['included'][2]).to have_attribute(:type).with_value('Spree::Promotion::Rules::User')
+ expect(json_response['included'][2]).to have_attribute(:code).with_value('ESJD')
+
+ expect(json_response['included'].size).to eq 5
+ end
+ end
+
+ describe 'promotions#update' do
+ before { patch "/api/v2/platform/promotions/#{existing_promotion.id}?include=promotion_category,promotion_actions,promotion_rules,stores", params: params, headers: bearer_token }
+
+ let(:params) { { promotion: update_promotion_attributes } }
+
+ it 'updates and returns a promotion' do
+ # promotion
+ expect(json_response['data']).to have_attribute(:name).with_value(update_promotion_attributes[:name])
+ expect(json_response['data']).to have_attribute(:code).with_value(update_promotion_attributes[:code])
+ expect(json_response['data']).to have_attribute(:match_policy).with_value(update_promotion_attributes[:match_policy])
+ expect(json_response['data']).to have_attribute(:type).with_value(update_promotion_attributes[:type])
+ expect(json_response['data']).to have_attribute(:description).with_value(update_promotion_attributes[:description])
+ expect(json_response['data']).to have_attribute(:starts_at).with_value('2021-10-20T13:09:00.000Z')
+ expect(json_response['data']).to have_attribute(:expires_at).with_value('2021-10-25T13:09:00.000Z')
+ expect(json_response['data']).to have_attribute(:usage_limit).with_value(update_promotion_attributes[:usage_limit])
+ expect(json_response['data']).to have_attribute(:path).with_value(update_promotion_attributes[:path])
+ expect(json_response['data']).to have_attribute(:advertise).with_value(update_promotion_attributes[:advertise])
+
+ # included promotion_category
+ expect(json_response['included']).to include(have_type('promotion_category'))
+ expect(json_response['included'][0]).to eq(Spree::Api::V2::Platform::PromotionCategorySerializer.new(promotion_category).as_json['data'])
+ end
+
+ it 'updates and returns the nested resources' do
+ # included promotion_action
+ expect(json_response['included']).to include(have_type('promotion_action'))
+ expect(json_response['included'][1]).to have_attribute(:type).with_value('Spree::Promotion::Actions::FreeShipping')
+
+ # # included promotion_rule
+ expect(json_response['included']).to include(have_type('promotion_rule'))
+ expect(json_response['included'][2]).to have_attribute(:type).with_value('Spree::Promotion::Rules::User')
+ expect(json_response['included'][2]).to have_attribute(:code).with_value('PliDp9328')
+ expect(json_response['included'].size).to eq 6
+ end
+ end
+ end
+end
diff --git a/api/spec/requests/spree/api/v2/storefront/cms_pages_spec.rb b/api/spec/requests/spree/api/v2/storefront/cms_pages_spec.rb
index ef00ed61c7..7da3a3d078 100644
--- a/api/spec/requests/spree/api/v2/storefront/cms_pages_spec.rb
+++ b/api/spec/requests/spree/api/v2/storefront/cms_pages_spec.rb
@@ -120,6 +120,8 @@ describe 'Storefront API v2 CMS Pages spec', type: :request do
it_behaves_like 'returns proper JSON structure'
it 'returns sections and their associations' do
+ page.reload
+
expect(json_response['included']).to include(have_type('taxon').and(have_id(taxon.id.to_s)))
expect(json_response['included']).to include(
have_type('cms_section').
@@ -127,10 +129,10 @@ describe 'Storefront API v2 CMS Pages spec', type: :request do
have_id(cms_section.id.to_s).
and(have_relationship(:linked_resource)).
and(have_jsonapi_attributes(
- :name, :content, :settings, :link, :fit, :type, :position, :is_fullscreen,
- :img_one_sm, :img_one_md, :img_one_lg, :img_two_sm, :img_two_md, :img_two_lg,
- :img_three_sm, :img_three_md, :img_three_lg
- ))
+ :name, :content, :settings, :link, :fit, :type, :position, :is_fullscreen,
+ :img_one_sm, :img_one_md, :img_one_lg, :img_two_sm, :img_two_md, :img_two_lg,
+ :img_three_sm, :img_three_md, :img_three_lg
+ ))
)
)
end
diff --git a/api/spec/serializers/spree/api/v2/platform/promotion_serializer_spec.rb b/api/spec/serializers/spree/api/v2/platform/promotion_serializer_spec.rb
index d724f18fe0..99ecc2f424 100644
--- a/api/spec/serializers/spree/api/v2/platform/promotion_serializer_spec.rb
+++ b/api/spec/serializers/spree/api/v2/platform/promotion_serializer_spec.rb
@@ -1,11 +1,71 @@
require 'spec_helper'
describe Spree::Api::V2::Platform::PromotionSerializer do
- include_context 'API v2 serializers params'
-
subject { described_class.new(resource, params: serializer_params) }
+ include_context 'API v2 serializers params'
- let(:resource) { create(:promotion) }
+ let(:promotion_category) { create(:promotion_category) }
+ let(:promotion_rule) { create(:promotion_rule) }
+ let(:resource) { create(:promotion_with_item_adjustment, promotion_category: promotion_category, promotion_rules: [promotion_rule]) }
it { expect(subject.serializable_hash).to be_kind_of(Hash) }
+
+ it do
+ expect(subject.serializable_hash).to eq(
+ {
+ data: {
+ id: resource.id.to_s,
+ type: :promotion,
+ attributes: {
+ description: resource.description,
+ expires_at: resource.expires_at,
+ starts_at: resource.starts_at,
+ name: resource.name,
+ type: resource.type,
+ usage_limit: resource.usage_limit,
+ match_policy: resource.match_policy,
+ code: resource.code,
+ advertise: resource.advertise,
+ path: resource.path,
+ public_metadata: {},
+ private_metadata: {},
+ created_at: resource.created_at,
+ updated_at: resource.updated_at
+ },
+ relationships: {
+ promotion_category: {
+ data: {
+ id: resource.promotion_category.id.to_s,
+ type: :promotion_category
+ },
+ },
+ promotion_rules: {
+ data: [
+ {
+ id: resource.promotion_rules.first.id.to_s,
+ type: :promotion_rule
+ }
+ ]
+ },
+ promotion_actions: {
+ data: [
+ {
+ id: resource.promotion_actions.first.id.to_s,
+ type: :promotion_action
+ }
+ ]
+ },
+ stores: {
+ data: [
+ {
+ id: resource.stores.first.id.to_s,
+ type: :store
+ }
+ ]
+ }
+ }
+ }
+ }
+ )
+ end
end
diff --git a/api/spec/swagger_helper.rb b/api/spec/swagger_helper.rb
index 660abfd4c9..40ef65a886 100644
--- a/api/spec/swagger_helper.rb
+++ b/api/spec/swagger_helper.rb
@@ -56,7 +56,10 @@ RSpec.configure do |config|
{ name: 'Orders' },
{ name: 'Payments' },
{ name: 'Payment Methods' },
+ { name: 'Promotions' },
+ { name: 'Promotion Actions' },
{ name: 'Promotion Categories' },
+ { name: 'Promotion Rules' },
{ name: 'Roles' },
{ name: 'Shipments' },
{ name: 'Shipping Categories' },
@@ -368,7 +371,7 @@ RSpec.configure do |config|
gutters: { type: :string, example: 'No Gutters', enum: ['Gutters', 'No Gutters'], description: 'This value is used by front end developers for styling the section padding.' },
button_text: { type: :string, example: 'Click Here', description: 'Set the text value of the button used in this section.' },
title: { type: :string, example: 'Shop Today', description: 'Create a title for the Hero Section.' },
- 'digital[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
+ 'cms_section[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
}
}
},
@@ -416,8 +419,8 @@ RSpec.configure do |config|
subtitle_one: { type: :string, example: 'Save 50% today', nullable: true, description: 'Set the subtitle used in image one.' },
subtitle_two: { type: :string, example: 'Save 50% today', nullable: true, description: 'Set the subtitle used in image two.' },
gutters: { type: :string, example: 'No Gutters', enum: ['Gutters', 'No Gutters'], description: 'This value is used by front end developers for styling the section padding.' },
- 'digital[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
- 'digital[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
+ 'cms_section[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
+ 'cms_section[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
}
}
},
@@ -448,9 +451,9 @@ RSpec.configure do |config|
fit: { type: :string, example: 'Screen', enum: ['Screen', 'Container'], description: 'This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.' },
layout_style: { type: :string, example: 'Default', enum: ['Default', 'Reversed'], description: 'This value is used by front end developers for styling the order the images appear.' },
display_labels: { type: :string, example: 'Show', enum: ['Show', 'Hide'], description: 'This value is used by front end developers for showing and hiding the label on the images.' },
- 'digital[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
- 'digital[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
- 'digital[image_three]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
+ 'cms_section[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
+ 'cms_section[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
+ 'cms_section[image_three]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
}
}
},
@@ -519,7 +522,7 @@ RSpec.configure do |config|
gutters: { type: :string, example: 'No Gutters', enum: ['Gutters', 'No Gutters'], description: 'This value is used by front end developers for styling the section padding.' },
button_text: { type: :string, example: 'Click Here', description: 'Update the text value of the button used in this section.' },
title: { type: :string, example: 'Shop Today', description: 'Update the title for this section.' },
- 'digital[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
+ 'cms_section[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
}
}
@@ -564,8 +567,8 @@ RSpec.configure do |config|
subtitle_one: { type: :string, example: 'Save 50% today', nullable: true, description: 'Update the subtitle used in image one.' },
subtitle_two: { type: :string, example: 'Save 50% today', nullable: true, description: 'Update the subtitle used in image two.' },
gutters: { type: :string, example: 'No Gutters', enum: ['Gutters', 'No Gutters'], description: 'This value is used by front end developers for styling the section padding.' },
- 'digital[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
- 'digital[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
+ 'cms_section[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
+ 'cms_section[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
}
}
},
@@ -594,9 +597,9 @@ RSpec.configure do |config|
fit: { type: :string, example: 'Screen', enum: ['Screen', 'Container'], description: 'This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.' },
layout_style: { type: :string, example: 'Default', enum: ['Default', 'Reversed'], description: 'This value is used by front end developers for styling the order the images appear.' },
display_labels: { type: :string, example: 'Show', enum: ['Show', 'Hide'], description: 'This value is used by front end developers for showing and hiding the label on the images.' },
- 'digital[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
- 'digital[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
- 'digital[image_three]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
+ 'cms_section[image_one]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
+ 'cms_section[image_two]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' },
+ 'cms_section[image_three]': { type: :string, format: :binary, description: 'Use a `multipart/form-data` request to upload assets.' }
}
}
},
@@ -776,7 +779,7 @@ RSpec.configure do |config|
type: :object,
required: %w[name menu_id],
properties: {
- name: { type: :string, example: 'T-Shirts', description: 'The name of this Menu Item'},
+ name: { type: :string, example: 'T-Shirts', description: 'The name of this Menu Item' },
code: { type: :string, nullable: true, example: 'MEN-TS', description: 'Give this Menu Item a code to identify this Menu Item from others. This is especially useful when using Container type Menu Items to group items.' },
subtitle: { type: :string, nullable: true, example: "Shop men's T-Shirts", description: 'Set an optional subtitle for the Menu Item, this is useful if your menu has promotional links that require more than just a link name.' },
destination: { type: :string, nullable: true, example: 'https://getvendo.com', description: 'Used when the linked_resource_type is set to: URL' },
@@ -798,7 +801,7 @@ RSpec.configure do |config|
menu_item: {
type: :object,
properties: {
- name: { type: :string, example: 'T-Shirts', description: 'Update the name of this Menu Item'},
+ name: { type: :string, example: 'T-Shirts', description: 'Update the name of this Menu Item' },
code: { type: :string, nullable: true, example: 'MEN-TS', description: 'The Menu Item a code to identifies this Menu Item from others. This is especially useful when using Container type Menu Items to group items.' },
subtitle: { type: :string, nullable: true, example: "Shop men's T-Shirts", description: 'Set an optional subtitle for the Menu Item, this is useful if your menu has promotional links that require more than just a link name.' },
destination: { type: :string, nullable: true, example: 'https://getvendo.com', description: 'Used when the linked_resource_type is set to: URL' },
@@ -1158,6 +1161,251 @@ RSpec.configure do |config|
'x-internal': true
},
+ # Promotion
+ create_promotion_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ required: %w[name],
+ properties: {
+ name: { type: :string, example: 'Promotions Used in 2021', description: 'Give the promotion a name.' },
+ code: { type: :string, example: 'BLK-FRI', nullable: true, description: 'Set the promotion code. Promotions without a code are automatically applied if the order meets the Promotion Rule requirements.' },
+ description: { type: :string, example: 'Save today with discount code XYZ at checkout.', nullable: true, description: 'Give the promotion a description.' },
+ usage_limit: { type: :integer, example: 100, nullable: true, description: 'If you wish you can set a usage limit for this promotion.' },
+ advertise: { type: :boolean },
+ starts_at: { type: :string, format: :date_time, nullable: true, description: 'Set a date and time that this promotion begins.' },
+ ends_at: { type: :string, format: :date_time, nullable: true, description: 'Set a date and time that this promotion ends.' },
+ store_ids: {
+ type: :array,
+ items: {
+ allOf: [
+ { type: :string, example: '2' }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Create a Promotion',
+ 'x-internal': true
+ },
+ update_promotion_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ name: { type: :string, example: 'Promotions Used in 2021', description: 'Change the promotion a name.' },
+ code: { type: :string, example: 'CYB-MON', nullable: true, description: 'Change or remove the promotion code. Promotions without a code are automatically applied if the order meets the Promotion Rule requirements.' },
+ description: { type: :string, example: 'Save today with discount code XYZ at checkout.', nullable: true, description: 'Update the promotion a description.' },
+ usage_limit: { type: :integer, example: 100, nullable: true, description: 'If you wish you can set a usage limit for this promotion.' },
+ advertise: { type: :boolean },
+ starts_at: { type: :string, format: :date_time, nullable: true, description: 'Set a date and time that this promotion begins.' },
+ ends_at: { type: :string, format: :date_time, nullable: true, description: 'Set a date and time that this promotion ends.' },
+ store_ids: {
+ type: :array,
+ items: {
+ allOf: [
+ { type: :string, example: '2' }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Update a Promotion',
+ 'x-internal': true
+ },
+ update_promotion_add_rule_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ promotion_rules_attributes: {
+ type: :array,
+ items: {
+ allOf: [
+ properties: {
+ type: { type: :string, example: 'Spree::Promotion::Rules::Country', enum: ['Spree::Promotion::Rules::Country', 'Spree::Promotion::Rules::ItemTotal', 'Spree::Promotion::Rules::Product', 'Spree::Promotion::Rules::User', 'Spree::Promotion::Rules::FirstOrder', 'Spree::Promotion::Rules::UserLoggedIn', 'Spree::Promotion::Rules::OneUsePerUser', 'Spree::Promotion::Rules::Taxon', 'Spree::Promotion::Rules::OptionValue'], description: 'Set the Promotion Rule type.' },
+ preferred_country_id: { type: :integer, example: 122, description: 'Each rule type has its own preferred attributes. In this example we are setting the ID of the Country this rule applies to. To learn more about Spree preferences visit TODO: [LINK].' },
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Add a Rule to a Promotion',
+ 'x-internal': true
+ },
+ update_promotion_update_rule_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ promotion_rules_attributes: {
+ type: :array,
+ items: {
+ allOf: [
+ properties: {
+ id: { type: :string, example: '22', description: 'To update an existing Promotion Rule, you are required to pass the ID of the rule you are updating.' },
+ type: { type: :string, example: 'Spree::Promotion::Rules::Country', enum: ['Spree::Promotion::Rules::Country', 'Spree::Promotion::Rules::ItemTotal', 'Spree::Promotion::Rules::Product', 'Spree::Promotion::Rules::User', 'Spree::Promotion::Rules::FirstOrder', 'Spree::Promotion::Rules::UserLoggedIn', 'Spree::Promotion::Rules::OneUsePerUser', 'Spree::Promotion::Rules::Taxon', 'Spree::Promotion::Rules::OptionValue'], description: 'Set the Promotion Rule type.' },
+ preferred_country_id: { type: :integer, example: 143, description: 'Each rule type has its own preferred attributes. In this example we are changing the ID of the Country this rule applies to. To learn more about Spree preferences visit TODO: [LINK].' }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Update an existing Rule',
+ 'x-internal': true
+ },
+ update_promotion_add_action_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ promotion_actions_attributes: {
+ type: :array,
+ items: {
+ allOf: [
+ properties: {
+ type: { type: :string, example: 'Spree::Promotion::Actions::CreateAdjustment', enum: ['Spree::Promotion::Actions::CreateAdjustment', 'Spree::Promotion::Actions::CreateItemAdjustments', 'Spree::Promotion::Actions::FreeShipping', 'Spree::Promotion::Actions::CreateLineItems'], description: 'Set the Promotion Action Type.' },
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Add an Action to a Promotion',
+ 'x-internal': true
+ },
+ update_promotion_action_calculator_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ promotion_actions_attributes: {
+ type: :array,
+ items: {
+ allOf: [
+ properties: {
+ id: { type: :string, example: '22', description: 'To update an existing Promotion Action, you are required to pass the ID of the action you wish to update.' },
+ calculator_attributes: {
+ properties: {
+ id: { type: :string, example: '19', description: 'To update an existing Action Calculator, you are required to pass the ID of the calculator.' },
+ type: { type: :string, example: 'Promotion::Actions::CreateAdjustment', enum: ['Promotion::Actions::CreateAdjustment', 'Promotion::Actions::CreateItemAdjustments', 'Promotion::Actions::CreateLineItems', 'Promotion::Actions::FreeShipping'], description: 'Set the Type of Promotion Action you wish to use.' },
+ preferred_flat_percent: { type: :integer, example: 10, description: 'In this example we are setting the preferred flat percentage to `10`.' }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Update an Action Calculator',
+ 'x-internal': true
+ },
+ update_promotion_change_calculator_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ promotion_actions_attributes: {
+ type: :array,
+ items: {
+ allOf: [
+ properties: {
+ id: { type: :string, example: '22', description: 'To update an existing Promotion Action, you are required to pass the ID of the Promotion Action.' },
+ calculator_attributes: {
+ properties: {
+ type: { type: :string, example: 'Spree::Calculator::FlatPercentItemTotal', enum: ['Spree::Calculator::FlatPercentItemTotal', 'Spree::Calculator::FlatRate', 'Spree::Calculator::FlexiRate', 'Spree::Calculator::TieredPercent', 'Spree::Calculator::TieredFlatRate', 'Spree::Calculator::PercentOnLineItem'], description: 'To set the Promotion Action Calculator pass the calculator type. Each Promotion action has certain Calculators available, to learn more visit TODO: [LINK]' },
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Change an Action Calculator',
+ 'x-internal': true
+ },
+ update_promotion_change_action_params: {
+ type: :object,
+ properties: {
+ promotion: {
+ type: :object,
+ properties: {
+ promotion_actions_attributes: {
+ type: :array,
+ items: {
+ allOf: [
+ properties: {
+ id: { type: :string, example: '22', description: 'To update an existing Promotion Action, you are required to pass the ID of the Promotion Action.' },
+ type: { type: :string, example: 'Promotion::Actions::CreateAdjustment', enum: ['Promotion::Actions::CreateAdjustment', 'Promotion::Actions::CreateItemAdjustments', 'Promotion::Actions::CreateLineItems', 'Promotion::Actions::FreeShipping'], description: 'Set the Type of Promotion Action you wish to use.' },
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[promotion],
+ title: 'Change an Action Type',
+ 'x-internal': true
+ },
+
+ # Promotion Action
+ create_promotion_action_params: {
+ type: :object,
+ properties: {
+ promotion_action: {
+ type: :object,
+ required: %w[type promotion_id],
+ properties: {
+ type: { type: :string, example: 'Promotion::Actions::CreateAdjustment', enum: ['Promotion::Actions::CreateAdjustment', 'Promotion::Actions::CreateItemAdjustments', 'Promotion::Actions::CreateLineItems', 'Promotion::Actions::FreeShipping'], description: 'Set the Type of Promotion Action you wish to use.' },
+ promotion_id: {type: :string, example: '22', description: 'Set the ID of the promotion this action belongs to.'}
+ }
+ }
+ },
+ required: %w[promotion_action],
+ title: 'Create a Promotion Action',
+ 'x-internal': true
+ },
+ update_promotion_action_params: {
+ type: :object,
+ properties: {
+ promotion_action: {
+ type: :object,
+ properties: {
+ type: { type: :string, example: 'Promotion::Actions::CreateAdjustment', enum: ['Promotion::Actions::CreateAdjustment', 'Promotion::Actions::CreateItemAdjustments', 'Promotion::Actions::CreateLineItems', 'Promotion::Actions::FreeShipping'], description: 'Set the Type of Promotion Action you wish to use.' }
+ }
+ }
+ },
+ required: %w[promotion_action],
+ title: 'Create a Promotion Action',
+ 'x-internal': true
+ },
+
# Promotion Category
create_promotion_category_params: {
type: :object,
@@ -1166,8 +1414,8 @@ RSpec.configure do |config|
type: :object,
required: %w[name],
properties: {
- name: { type: :string, example: 'Promotions Used in 2021' },
- code: { type: :string, example: '2021-PROMOS' }
+ name: { type: :string, example: 'Promotions Used in 2021', description: 'Give this Promotion Category a name.' },
+ code: { type: :string, example: '2021-PROMOS', nullable: true, description: 'Give this promotion category a code.' }
}
}
},
@@ -1181,8 +1429,8 @@ RSpec.configure do |config|
type: :object,
required: %w[name],
properties: {
- name: { type: :string, example: 'Promotions Used in 2021' },
- code: { type: :string, example: '2021-PROMOS' }
+ name: { type: :string, example: 'Promotions Used in 2021', description: 'Update the name of this Promotion Category.' },
+ code: { type: :string, example: '2021-PROMOS', nullable: true, description: 'Change or remove the code for this Promotion Category.' }
}
}
},
@@ -1190,6 +1438,38 @@ RSpec.configure do |config|
'x-internal': true
},
+ # Promotion Rule
+ create_promotion_rule_params: {
+ type: :object,
+ properties: {
+ promotion_rule: {
+ type: :object,
+ required: %w[type promotion_id],
+ properties: {
+ promotion_id: {type: :string, example: '22', description: 'Set the ID of the promotion this Promotion Rule belongs to.'},
+ type: { type: :string, example: 'Spree::Promotion::Rules::Country', enum: ['Spree::Promotion::Rules::Country', 'Spree::Promotion::Rules::ItemTotal', 'Spree::Promotion::Rules::Product', 'Spree::Promotion::Rules::User', 'Spree::Promotion::Rules::FirstOrder', 'Spree::Promotion::Rules::UserLoggedIn', 'Spree::Promotion::Rules::OneUsePerUser', 'Spree::Promotion::Rules::Taxon', 'Spree::Promotion::Rules::OptionValue'], description: 'Set the Promotion Rule type.' },
+ }
+ }
+ },
+ required: %w[promotion_rule],
+ title: 'Create a Promotion Rule',
+ 'x-internal': true
+ },
+ update_promotion_rule_params: {
+ type: :object,
+ properties: {
+ promotion_rule: {
+ type: :object,
+ properties: {
+ type: { type: :string, example: 'Spree::Promotion::Rules::Country', enum: ['Spree::Promotion::Rules::Country', 'Spree::Promotion::Rules::ItemTotal', 'Spree::Promotion::Rules::Product', 'Spree::Promotion::Rules::User', 'Spree::Promotion::Rules::FirstOrder', 'Spree::Promotion::Rules::UserLoggedIn', 'Spree::Promotion::Rules::OneUsePerUser', 'Spree::Promotion::Rules::Taxon', 'Spree::Promotion::Rules::OptionValue'], description: 'Set the Promotion Rule type.' },
+ }
+ }
+ },
+ required: %w[promotion_rule],
+ title: 'Create a Promotion Rule',
+ 'x-internal': true
+ },
+
# Role
create_role_params: {
type: :object,
diff --git a/core/lib/spree/testing_support/factories/promotion_action_factory.rb b/core/lib/spree/testing_support/factories/promotion_action_factory.rb
new file mode 100644
index 0000000000..6d78bc86d8
--- /dev/null
+++ b/core/lib/spree/testing_support/factories/promotion_action_factory.rb
@@ -0,0 +1,5 @@
+FactoryBot.define do
+ factory :promotion_action, class: Spree::PromotionAction do
+ association :promotion
+ end
+end