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-1496] - Add Payment Method endpoints to Platform API (#11437)

Matthew Kennedy36e72a5c1265
diff --git a/api/app/controllers/spree/api/v2/platform/payment_methods_controller.rb b/api/app/controllers/spree/api/v2/platform/payment_methods_controller.rb
new file mode 100644
index 0000000000..5a439c2c72
--- /dev/null
+++ b/api/app/controllers/spree/api/v2/platform/payment_methods_controller.rb
@@ -0,0 +1,27 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ class PaymentMethodsController < ResourceController
+ private
+
+ def model_class
+ Spree::PaymentMethod
+ end
+
+ def spree_permitted_attributes
+ preferred_attributes = []
+
+ if action_name == 'update'
+ resource.defined_preferences.each do |preference|
+ preferred_attributes << "preferred_#{preference}".to_sym
+ end
+ end
+
+ super + preferred_attributes
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/app/controllers/spree/api/v2/platform/resource_controller.rb b/api/app/controllers/spree/api/v2/platform/resource_controller.rb
index 6c8977e49d..ceb16cc016 100644
--- a/api/app/controllers/spree/api/v2/platform/resource_controller.rb
+++ b/api/app/controllers/spree/api/v2/platform/resource_controller.rb
@@ -104,7 +104,13 @@ module Spree
end
def spree_permitted_attributes
- model_class.json_api_permitted_attributes
+ store_ids = if model_class.method_defined?(:stores)
+ [{ store_ids: [] }]
+ else
+ []
+ end
+
+ model_class.json_api_permitted_attributes + store_ids
end
def permitted_resource_params
diff --git a/api/app/serializers/spree/api/v2/platform/payment_method_serializer.rb b/api/app/serializers/spree/api/v2/platform/payment_method_serializer.rb
index 10aaa1f937..0ad2f1d003 100644
--- a/api/app/serializers/spree/api/v2/platform/payment_method_serializer.rb
+++ b/api/app/serializers/spree/api/v2/platform/payment_method_serializer.rb
@@ -3,7 +3,13 @@ module Spree
module V2
module Platform
class PaymentMethodSerializer < BaseSerializer
- include ResourceSerializerConcern
+ attributes :name, :type, :description, :active, :display_on, :auto_capture, :position, :created_at, :updated_at, :deleted_at
+
+ attribute :preferences do |payment_method|
+ payment_method.preferences
+ end
+
+ has_many :stores
end
end
end
diff --git a/api/config/routes.rb b/api/config/routes.rb
index a9197c6296..27cade3e44 100644
--- a/api/config/routes.rb
+++ b/api/config/routes.rb
@@ -304,6 +304,7 @@ Spree::Core::Engine.add_routes do
resources :stores
# Configurations API
+ resources :payment_methods
resources :shipping_categories
resources :shipping_methods
diff --git a/api/docs/v2/platform/index.yaml b/api/docs/v2/platform/index.yaml
index d1a00fa223..e58ad7f40c 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-10-30T11:23:56.203Z'
- updated_at: '2021-10-30T11:23:56.203Z'
+ created_at: '2021-11-01T16:15:03.922Z'
+ updated_at: '2021-11-01T16:15:03.922Z'
deleted_at:
label:
relationships:
@@ -98,8 +98,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-30T11:23:56.207Z'
- updated_at: '2021-10-30T11:23:56.207Z'
+ created_at: '2021-11-01T16:15:03.926Z'
+ updated_at: '2021-11-01T16:15:03.926Z'
deleted_at:
label:
relationships:
@@ -173,8 +173,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-30T11:23:56.417Z'
- updated_at: '2021-10-30T11:23:56.417Z'
+ created_at: '2021-11-01T16:15:04.134Z'
+ updated_at: '2021-11-01T16:15:04.134Z'
deleted_at:
label:
relationships:
@@ -268,8 +268,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-30T11:23:56.452Z'
- updated_at: '2021-10-30T11:23:56.452Z'
+ created_at: '2021-11-01T16:15:04.177Z'
+ updated_at: '2021-11-01T16:15:04.177Z'
deleted_at:
label:
relationships:
@@ -348,8 +348,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-30T11:23:56.512Z'
- updated_at: '2021-10-30T11:23:56.520Z'
+ created_at: '2021-11-01T16:15:04.235Z'
+ updated_at: '2021-11-01T16:15:04.243Z'
deleted_at:
label:
relationships:
@@ -493,8 +493,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-30T11:23:56.742Z'
- updated_at: '2021-10-30T11:23:56.742Z'
+ created_at: '2021-11-01T16:15:04.480Z'
+ updated_at: '2021-11-01T16:15:04.480Z'
state: open
included: false
display_amount: "$100.00"
@@ -520,8 +520,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-30T11:23:56.763Z'
- updated_at: '2021-10-30T11:23:56.763Z'
+ created_at: '2021-11-01T16:15:04.502Z'
+ updated_at: '2021-11-01T16:15:04.502Z'
state: open
included: false
display_amount: "$100.00"
@@ -594,8 +594,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-30T11:23:57.062Z'
- updated_at: '2021-10-30T11:23:57.062Z'
+ created_at: '2021-11-01T16:15:04.838Z'
+ updated_at: '2021-11-01T16:15:04.838Z'
state: open
included: false
display_amount: "$100.00"
@@ -677,8 +677,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-30T11:23:57.159Z'
- updated_at: '2021-10-30T11:23:57.163Z'
+ created_at: '2021-11-01T16:15:04.951Z'
+ updated_at: '2021-11-01T16:15:04.956Z'
state: open
included: false
display_amount: "$1.00"
@@ -756,8 +756,8 @@ paths:
label: New label
mandatory:
eligible: true
- created_at: '2021-10-30T11:23:57.360Z'
- updated_at: '2021-10-30T11:23:57.375Z'
+ created_at: '2021-11-01T16:15:05.142Z'
+ updated_at: '2021-11-01T16:15:05.155Z'
state: open
included: false
display_amount: "$15.00"
@@ -897,8 +897,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-30T11:23:57.951Z'
- updated_at: '2021-10-30T11:23:57.951Z'
+ created_at: '2021-11-01T16:15:05.678Z'
+ updated_at: '2021-11-01T16:15:05.678Z'
relationships:
product:
data:
@@ -912,8 +912,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-30T11:23:58.029Z'
- updated_at: '2021-10-30T11:23:58.029Z'
+ created_at: '2021-11-01T16:15:05.758Z'
+ updated_at: '2021-11-01T16:15:05.758Z'
relationships:
product:
data:
@@ -974,8 +974,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-30T11:23:58.503Z'
- updated_at: '2021-10-30T11:23:58.503Z'
+ created_at: '2021-11-01T16:15:06.218Z'
+ updated_at: '2021-11-01T16:15:06.218Z'
relationships:
product:
data:
@@ -1042,8 +1042,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-30T11:23:58.664Z'
- updated_at: '2021-10-30T11:23:58.664Z'
+ created_at: '2021-11-01T16:15:06.387Z'
+ updated_at: '2021-11-01T16:15:06.387Z'
relationships:
product:
data:
@@ -1109,8 +1109,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-30T11:23:58.936Z'
- updated_at: '2021-10-30T11:23:58.936Z'
+ created_at: '2021-11-01T16:15:06.675Z'
+ updated_at: '2021-11-01T16:15:06.675Z'
relationships:
product:
data:
@@ -1232,8 +1232,8 @@ paths:
type: classification
attributes:
position: 2
- created_at: '2021-10-30T11:23:59.739Z'
- updated_at: '2021-10-30T11:23:59.761Z'
+ created_at: '2021-11-01T16:15:07.436Z'
+ updated_at: '2021-11-01T16:15:07.460Z'
relationships:
product:
data:
@@ -1332,34 +1332,35 @@ paths:
- id: '1'
type: cms_page
attributes:
- title: Cupiditate unde voluptatibus labore voluptates.
+ title: Sequi ipsa ipsum perferendis suscipit.
meta_title:
content:
meta_description:
visible: true
- slug: cupiditate-unde-voluptatibus-labore-voluptates
+ slug: sequi-ipsa-ipsum-perferendis-suscipit
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-30T11:24:00.097Z'
- updated_at: '2021-10-30T11:24:00.097Z'
+ created_at: '2021-11-01T16:15:07.808Z'
+ updated_at: '2021-11-01T16:15:07.808Z'
relationships:
cms_sections:
data: []
- id: '2'
type: cms_page
attributes:
- title: Quidem quasi nobis optio fuga a.
+ title: Ab labore corrupti at laboriosam officiis laborum provident
+ veritatis.
meta_title:
content:
meta_description:
visible: true
- slug: quidem-quasi-nobis-optio-fuga-a
+ slug: ab-labore-corrupti-at-laboriosam-officiis-laborum-provident-veritatis
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-30T11:24:00.101Z'
- updated_at: '2021-10-30T11:24:00.101Z'
+ created_at: '2021-11-01T16:15:07.812Z'
+ updated_at: '2021-11-01T16:15:07.812Z'
relationships:
cms_sections:
data: []
@@ -1413,17 +1414,17 @@ paths:
id: '5'
type: cms_page
attributes:
- title: Provident aliquam maxime natus sunt minus consequatur.
+ title: Id eveniet sit deleniti facilis possimus error.
meta_title:
content:
meta_description:
visible: true
- slug: provident-aliquam-maxime-natus-sunt-minus-consequatur
+ slug: id-eveniet-sit-deleniti-facilis-possimus-error
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-30T11:24:00.183Z'
- updated_at: '2021-10-30T11:24:00.183Z'
+ created_at: '2021-11-01T16:15:07.890Z'
+ updated_at: '2021-11-01T16:15:07.890Z'
relationships:
cms_sections:
data: []
@@ -1483,17 +1484,17 @@ paths:
id: '6'
type: cms_page
attributes:
- title: Consectetur ab quibusdam ratione asperiores sapiente.
+ title: Tempore dolores accusamus velit harum.
meta_title:
content:
meta_description:
visible: true
- slug: consectetur-ab-quibusdam-ratione-asperiores-sapiente
+ slug: tempore-dolores-accusamus-velit-harum
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-30T11:24:00.224Z'
- updated_at: '2021-10-30T11:24:00.224Z'
+ created_at: '2021-11-01T16:15:07.928Z'
+ updated_at: '2021-11-01T16:15:07.928Z'
relationships:
cms_sections:
data: []
@@ -1557,12 +1558,12 @@ paths:
content:
meta_description:
visible: true
- slug: iusto-vel-sapiente-delectus-explicabo
+ slug: optio-illum-veniam-unde-repellendus-tenetur-vitae-harum-totam
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-30T11:24:00.281Z'
- updated_at: '2021-10-30T11:24:00.290Z'
+ created_at: '2021-11-01T16:15:07.993Z'
+ updated_at: '2021-11-01T16:15:08.002Z'
relationships:
cms_sections:
data: []
@@ -1688,8 +1689,7 @@ paths:
- id: '1'
type: cms_section
attributes:
- name: Doloremque pariatur exercitationem unde laborum ab doloribus
- id.
+ name: Necessitatibus iste in fugit cumque.
content: {}
settings:
gutters: No Gutters
@@ -1698,8 +1698,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 1
linked_resource_type: Spree::Taxon
- created_at: '2021-10-30T11:24:00.466Z'
- updated_at: '2021-10-30T11:24:00.466Z'
+ created_at: '2021-11-01T16:15:08.165Z'
+ updated_at: '2021-11-01T16:15:08.165Z'
relationships:
cms_page:
data:
@@ -1710,7 +1710,7 @@ paths:
- id: '2'
type: cms_section
attributes:
- name: Voluptatum eius quam optio repudiandae.
+ name: Quibusdam nihil nesciunt maxime accusantium vitae.
content:
link_type_one: Spree::Taxon
link_type_two: Spree::Taxon
@@ -1722,8 +1722,8 @@ paths:
type: Spree::Cms::Sections::ImageGallery
position: 2
linked_resource_type:
- created_at: '2021-10-30T11:24:00.471Z'
- updated_at: '2021-10-30T11:24:00.471Z'
+ created_at: '2021-11-01T16:15:08.168Z'
+ updated_at: '2021-11-01T16:15:08.168Z'
relationships:
cms_page:
data:
@@ -1734,7 +1734,7 @@ paths:
- id: '3'
type: cms_section
attributes:
- name: Eaque maiores quos cum pariatur.
+ name: Ab soluta laboriosam qui repudiandae voluptas neque.
content: {}
settings:
gutters: No Gutters
@@ -1743,8 +1743,8 @@ paths:
type: Spree::Cms::Sections::FeaturedArticle
position: 3
linked_resource_type: Spree::Taxon
- created_at: '2021-10-30T11:24:00.479Z'
- updated_at: '2021-10-30T11:24:00.479Z'
+ created_at: '2021-11-01T16:15:08.176Z'
+ updated_at: '2021-11-01T16:15:08.176Z'
relationships:
cms_page:
data:
@@ -1755,8 +1755,8 @@ paths:
- id: '4'
type: cms_section
attributes:
- name: Aliquam ipsam nostrum esse fugit beatae laboriosam consequatur
- quo.
+ name: Assumenda aperiam veniam enim minima sed magni sunt
+ similique.
content: {}
settings:
gutters: No Gutters
@@ -1765,8 +1765,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-30T11:24:00.487Z'
- updated_at: '2021-10-30T11:24:00.487Z'
+ created_at: '2021-11-01T16:15:08.184Z'
+ updated_at: '2021-11-01T16:15:08.184Z'
relationships:
cms_page:
data:
@@ -1779,7 +1779,7 @@ paths:
- id: '5'
type: cms_section
attributes:
- name: Officia nulla suscipit illo repudiandae quia harum.
+ name: Exercitationem placeat ducimus cumque ipsa eius cum.
content: {}
settings:
gutters: No Gutters
@@ -1788,8 +1788,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 5
linked_resource_type: Spree::Product
- created_at: '2021-10-30T11:24:00.494Z'
- updated_at: '2021-10-30T11:24:00.494Z'
+ created_at: '2021-11-01T16:15:08.191Z'
+ updated_at: '2021-11-01T16:15:08.191Z'
relationships:
cms_page:
data:
@@ -1849,7 +1849,7 @@ paths:
id: '14'
type: cms_section
attributes:
- name: Architecto pariatur incidunt vitae reprehenderit.
+ name: Itaque soluta exercitationem id minus dolore ab.
content: {}
settings:
gutters: No Gutters
@@ -1858,8 +1858,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-30T11:24:00.658Z'
- updated_at: '2021-10-30T11:24:00.658Z'
+ created_at: '2021-11-01T16:15:08.343Z'
+ updated_at: '2021-11-01T16:15:08.343Z'
relationships:
cms_page:
data:
@@ -1925,7 +1925,7 @@ paths:
id: '21'
type: cms_section
attributes:
- name: Quia enim minima eos unde.
+ name: Aliquid velit illo rem eaque ullam.
content: {}
settings:
gutters: No Gutters
@@ -1934,8 +1934,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-30T11:24:00.847Z'
- updated_at: '2021-10-30T11:24:00.847Z'
+ created_at: '2021-11-01T16:15:08.477Z'
+ updated_at: '2021-11-01T16:15:08.477Z'
relationships:
cms_page:
data:
@@ -2009,8 +2009,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 1
linked_resource_type: Spree::Product
- created_at: '2021-10-30T11:24:01.093Z'
- updated_at: '2021-10-30T11:24:01.103Z'
+ created_at: '2021-11-01T16:15:08.745Z'
+ updated_at: '2021-11-01T16:15:08.757Z'
relationships:
cms_page:
data:
@@ -2124,9 +2124,9 @@ paths:
name: United States of America
numcode: 840
states_required: true
- updated_at: '2021-10-30T11:24:01.541Z'
+ updated_at: '2021-11-01T16:15:09.217Z'
zipcode_required: true
- created_at: '2021-10-30T11:24:01.541Z'
+ created_at: '2021-11-01T16:15:09.217Z'
relationships:
states:
data: []
@@ -2139,9 +2139,9 @@ paths:
name: NAME_2
numcode: 840
states_required: false
- updated_at: '2021-10-30T11:24:01.547Z'
+ updated_at: '2021-11-01T16:15:09.222Z'
zipcode_required: true
- created_at: '2021-10-30T11:24:01.547Z'
+ created_at: '2021-11-01T16:15:09.222Z'
relationships:
states:
data: []
@@ -2154,9 +2154,9 @@ paths:
name: NAME_3
numcode: 840
states_required: false
- updated_at: '2021-10-30T11:24:01.549Z'
+ updated_at: '2021-11-01T16:15:09.225Z'
zipcode_required: true
- created_at: '2021-10-30T11:24:01.549Z'
+ created_at: '2021-11-01T16:15:09.225Z'
relationships:
states:
data: []
@@ -2215,9 +2215,9 @@ paths:
name: NAME_6
numcode: 840
states_required: false
- updated_at: '2021-10-30T11:24:01.594Z'
+ updated_at: '2021-11-01T16:15:09.272Z'
zipcode_required: true
- created_at: '2021-10-30T11:24:01.594Z'
+ created_at: '2021-11-01T16:15:09.272Z'
relationships:
states:
data: []
@@ -2275,7 +2275,7 @@ paths:
- id: '1'
type: digital_link
attributes:
- token: gM423vgvEH6uTsZJwSQUgAK7
+ token: Zj7hsmXmii7dM2UD6xVcpUjG
access_counter: 0
relationships:
digital:
@@ -2289,7 +2289,7 @@ paths:
- id: '2'
type: digital_link
attributes:
- token: 6T9u9yg9a5Dd6773XuWFKA7M
+ token: HtEFjzNuVqN6j5WUF57M7bjB
access_counter: 0
relationships:
digital:
@@ -2343,7 +2343,7 @@ paths:
id: '5'
type: digital_link
attributes:
- token: uvCoMeo2zoV48Ftua8ZE2muq
+ token: AyHGXBxouVACPr7icfFGa7ZA
access_counter: 0
relationships:
digital:
@@ -2406,7 +2406,7 @@ paths:
id: '6'
type: digital_link
attributes:
- token: p5gy4qoFkXZLsFnK5M3spHhp
+ token: VL22EXnhQBx6VSWP4KV3JoX5
access_counter: 0
relationships:
digital:
@@ -2465,7 +2465,7 @@ paths:
id: '8'
type: digital_link
attributes:
- token: wa4App964XNTNk2t91ee2Sxk
+ token: bR4yj43Y45tQ7fQc95ZkHz2o
access_counter: 0
relationships:
digital:
@@ -2580,7 +2580,7 @@ paths:
id: '13'
type: digital_link
attributes:
- token: ximJRCSRsJwSKm39q9HrZw6X
+ token: e94qfYCroztiknaz9crvxMbU
access_counter: 0
relationships:
digital:
@@ -2652,7 +2652,7 @@ paths:
- id: '15'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBJdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--f14650a9994470bcb7c0a964cd5bc7d56cbbac59/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBJdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--c47dbf57af644f5ee532f1a0e204a3f2877dad4c/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
@@ -2664,7 +2664,7 @@ paths:
- id: '16'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7f2523fc28b8bc14157d9675d73645e1ae9c0ee4/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5966e723deb197b98be65665b695881d9bf77ce6/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
@@ -2676,7 +2676,7 @@ paths:
- id: '17'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--46b3dca9b7adeed95934c5892f881f797da9794d/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBKUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--128cb27a673c4157d05f7e8836100b74c4d841dd/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
@@ -2735,7 +2735,7 @@ paths:
id: '24'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--ba81f6449f6dac6676e5053bb8549f1c40d2cf15/icon_256x256.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--9809c0317f79dda41a81c0af07fddd7da97abd8f/icon_256x256.jpg"
content_type: image/png
filename: icon_256x256.jpg
byte_size: 818
@@ -2800,7 +2800,7 @@ paths:
id: '28'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBNQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--822b2cc8bb89a8a18c7c5d19f1659f9eb503f754/thinking-cat.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBNQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--efba9825dfa43ed3c60de95598803a804aee86ff/thinking-cat.jpg"
content_type: image/jpeg
filename: thinking-cat.jpg
byte_size: 18090
@@ -2864,7 +2864,7 @@ paths:
id: '36'
type: digital
attributes:
- url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBPdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0d81ac6a6fef66af302bc640bc8a235902925cc2/icon_256x256.jpg"
+ url: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBPdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--b476a895c0bc6c1c789ca9f1206cf5a829871e60/icon_256x256.jpg"
content_type: image/png
filename: icon_256x256.jpg
byte_size: 818
@@ -2997,8 +2997,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-30T11:24:08.519Z'
- updated_at: '2021-10-30T11:24:08.536Z'
+ created_at: '2021-11-01T16:15:16.594Z'
+ updated_at: '2021-11-01T16:15:16.602Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3008,9 +3008,6 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_included_tax_total: "$0.00"
- display_pre_tax_amount: "$10.00"
- display_adjustment_total: "$0.00"
display_price: "$10.00"
single_display_amount: "$10.00"
display_discounted_amount: "$10.00"
@@ -3018,8 +3015,11 @@ paths:
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
+ display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_amount: "$10.00"
relationships:
order:
data:
@@ -3044,8 +3044,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-30T11:24:08.578Z'
- updated_at: '2021-10-30T11:24:08.584Z'
+ created_at: '2021-11-01T16:15:16.633Z'
+ updated_at: '2021-11-01T16:15:16.637Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3055,9 +3055,6 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_included_tax_total: "$0.00"
- display_pre_tax_amount: "$10.00"
- display_adjustment_total: "$0.00"
display_price: "$10.00"
single_display_amount: "$10.00"
display_discounted_amount: "$10.00"
@@ -3065,8 +3062,11 @@ paths:
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
+ display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_amount: "$10.00"
relationships:
order:
data:
@@ -3138,8 +3138,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-30T11:24:08.805Z'
- updated_at: '2021-10-30T11:24:08.841Z'
+ created_at: '2021-11-01T16:15:16.862Z'
+ updated_at: '2021-11-01T16:15:16.908Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3149,9 +3149,6 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_included_tax_total: "$0.00"
- display_pre_tax_amount: "$10.00"
- display_adjustment_total: "$0.00"
display_price: "$10.00"
single_display_amount: "$10.00"
display_discounted_amount: "$10.00"
@@ -3159,8 +3156,11 @@ paths:
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
+ display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_amount: "$10.00"
relationships:
order:
data:
@@ -3241,8 +3241,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-30T11:24:08.989Z'
- updated_at: '2021-10-30T11:24:08.997Z'
+ created_at: '2021-11-01T16:15:17.051Z'
+ updated_at: '2021-11-01T16:15:17.058Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3252,9 +3252,6 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_included_tax_total: "$0.00"
- display_pre_tax_amount: "$10.00"
- display_adjustment_total: "$0.00"
display_price: "$10.00"
single_display_amount: "$10.00"
display_discounted_amount: "$10.00"
@@ -3262,8 +3259,11 @@ paths:
display_amount: "$10.00"
display_subtotal: "$10.00"
display_final_amount: "$10.00"
+ display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_amount: "$10.00"
relationships:
order:
data:
@@ -3340,8 +3340,8 @@ paths:
attributes:
quantity: 4
price: '10.0'
- created_at: '2021-10-30T11:24:09.235Z'
- updated_at: '2021-10-30T11:24:09.274Z'
+ created_at: '2021-11-01T16:15:17.283Z'
+ updated_at: '2021-11-01T16:15:17.322Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3351,9 +3351,6 @@ paths:
pre_tax_amount: '40.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_included_tax_total: "$0.00"
- display_pre_tax_amount: "$40.00"
- display_adjustment_total: "$0.00"
display_price: "$10.00"
single_display_amount: "$10.00"
display_discounted_amount: "$40.00"
@@ -3361,8 +3358,11 @@ paths:
display_amount: "$40.00"
display_subtotal: "$40.00"
display_final_amount: "$40.00"
+ display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_amount: "$40.00"
relationships:
order:
data:
@@ -3391,10 +3391,10 @@ paths:
examples:
Example:
value:
- error: 'Quantity selected of "Product #130 - 5356" is not available.'
+ error: 'Quantity selected of "Product #130 - 8962" is not available.'
errors:
quantity:
- - 'selected of "Product #130 - 5356" is not available.'
+ - 'selected of "Product #130 - 8962" is not available.'
schema:
"$ref": "#/components/schemas/validation_errors"
'404':
@@ -3514,8 +3514,8 @@ paths:
lft: 2
rgt: 3
depth: 1
- created_at: '2021-10-30T11:24:09.968Z'
- updated_at: '2021-10-30T11:24:09.972Z'
+ created_at: '2021-11-01T16:15:17.997Z'
+ updated_at: '2021-11-01T16:15:18.001Z'
link:
is_container: false
is_root: false
@@ -3551,8 +3551,8 @@ paths:
lft: 4
rgt: 5
depth: 1
- created_at: '2021-10-30T11:24:10.023Z'
- updated_at: '2021-10-30T11:24:10.026Z'
+ created_at: '2021-11-01T16:15:18.061Z'
+ updated_at: '2021-11-01T16:15:18.066Z'
link:
is_container: false
is_root: false
@@ -3588,8 +3588,8 @@ paths:
lft: 6
rgt: 7
depth: 1
- created_at: '2021-10-30T11:24:10.077Z'
- updated_at: '2021-10-30T11:24:10.081Z'
+ created_at: '2021-11-01T16:15:18.122Z'
+ updated_at: '2021-11-01T16:15:18.127Z'
link:
is_container: false
is_root: false
@@ -3625,8 +3625,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-30T11:24:10.128Z'
- updated_at: '2021-10-30T11:24:10.132Z'
+ created_at: '2021-11-01T16:15:18.185Z'
+ updated_at: '2021-11-01T16:15:18.190Z'
link:
is_container: false
is_root: false
@@ -3662,8 +3662,8 @@ paths:
lft: 10
rgt: 11
depth: 1
- created_at: '2021-10-30T11:24:10.177Z'
- updated_at: '2021-10-30T11:24:10.182Z'
+ created_at: '2021-11-01T16:15:18.248Z'
+ updated_at: '2021-11-01T16:15:18.252Z'
link:
is_container: false
is_root: false
@@ -3699,8 +3699,8 @@ paths:
lft: 12
rgt: 13
depth: 1
- created_at: '2021-10-30T11:24:10.230Z'
- updated_at: '2021-10-30T11:24:10.234Z'
+ created_at: '2021-11-01T16:15:18.311Z'
+ updated_at: '2021-11-01T16:15:18.315Z'
link:
is_container: false
is_root: false
@@ -3736,8 +3736,8 @@ paths:
lft: 14
rgt: 15
depth: 1
- created_at: '2021-10-30T11:24:10.281Z'
- updated_at: '2021-10-30T11:24:10.285Z'
+ created_at: '2021-11-01T16:15:18.372Z'
+ updated_at: '2021-11-01T16:15:18.376Z'
link:
is_container: false
is_root: false
@@ -3763,7 +3763,7 @@ paths:
- id: '1'
type: menu_item
attributes:
- name: Nulla eligendi ratione vero tempora hic quae saepe ducimus.
+ name: Quasi quos rem ratione optio error ipsam provident.
subtitle:
destination:
new_window: false
@@ -3773,8 +3773,8 @@ paths:
lft: 1
rgt: 16
depth: 0
- created_at: '2021-10-30T11:24:09.914Z'
- updated_at: '2021-10-30T11:24:10.295Z'
+ created_at: '2021-11-01T16:15:17.934Z'
+ updated_at: '2021-11-01T16:15:18.396Z'
link:
is_container: true
is_root: true
@@ -3867,8 +3867,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-30T11:24:10.898Z'
- updated_at: '2021-10-30T11:24:10.902Z'
+ created_at: '2021-11-01T16:15:19.114Z'
+ updated_at: '2021-11-01T16:15:19.117Z'
link:
is_container: false
is_root: false
@@ -3958,8 +3958,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-30T11:24:11.332Z'
- updated_at: '2021-10-30T11:24:11.337Z'
+ created_at: '2021-11-01T16:15:19.599Z'
+ updated_at: '2021-11-01T16:15:19.603Z'
link:
is_container: false
is_root: false
@@ -4047,8 +4047,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-30T11:24:11.986Z'
- updated_at: '2021-10-30T11:24:12.008Z'
+ created_at: '2021-11-01T16:15:20.372Z'
+ updated_at: '2021-11-01T16:15:20.398Z'
link:
is_container: false
is_root: false
@@ -4185,8 +4185,8 @@ paths:
lft: 5
rgt: 6
depth: 2
- created_at: '2021-10-30T11:24:13.546Z'
- updated_at: '2021-10-30T11:24:13.570Z'
+ created_at: '2021-11-01T16:15:22.185Z'
+ updated_at: '2021-11-01T16:15:22.212Z'
link:
is_container: false
is_root: false
@@ -4284,8 +4284,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-30T11:24:14.010Z'
- updated_at: '2021-10-30T11:24:14.119Z'
+ created_at: '2021-11-01T16:15:22.724Z'
+ updated_at: '2021-11-01T16:15:22.852Z'
relationships:
menu_items:
data:
@@ -4301,8 +4301,8 @@ paths:
name: Footer Menu
location: footer
locale: en
- created_at: '2021-10-30T11:24:14.019Z'
- updated_at: '2021-10-30T11:24:14.221Z'
+ created_at: '2021-11-01T16:15:22.733Z'
+ updated_at: '2021-11-01T16:15:22.973Z'
relationships:
menu_items:
data:
@@ -4365,8 +4365,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-30T11:24:14.512Z'
- updated_at: '2021-10-30T11:24:14.518Z'
+ created_at: '2021-11-01T16:15:23.324Z'
+ updated_at: '2021-11-01T16:15:23.331Z'
relationships:
menu_items:
data:
@@ -4434,8 +4434,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-30T11:24:14.559Z'
- updated_at: '2021-10-30T11:24:14.565Z'
+ created_at: '2021-11-01T16:15:23.368Z'
+ updated_at: '2021-11-01T16:15:23.374Z'
relationships:
menu_items:
data:
@@ -4499,8 +4499,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-30T11:24:14.635Z'
- updated_at: '2021-10-30T11:24:14.642Z'
+ created_at: '2021-11-01T16:15:23.445Z'
+ updated_at: '2021-11-01T16:15:23.452Z'
relationships:
menu_items:
data:
@@ -4635,8 +4635,8 @@ paths:
name: foo-size-68
presentation: Size
position: 1
- created_at: '2021-10-30T11:24:14.818Z'
- updated_at: '2021-10-30T11:24:14.818Z'
+ created_at: '2021-11-01T16:15:23.618Z'
+ updated_at: '2021-11-01T16:15:23.618Z'
filterable: true
relationships:
option_values:
@@ -4647,8 +4647,8 @@ paths:
name: foo-size-69
presentation: Size
position: 2
- created_at: '2021-10-30T11:24:14.820Z'
- updated_at: '2021-10-30T11:24:14.820Z'
+ created_at: '2021-11-01T16:15:23.620Z'
+ updated_at: '2021-11-01T16:15:23.620Z'
filterable: true
relationships:
option_values:
@@ -4699,8 +4699,8 @@ paths:
name: foo-size-72
presentation: Size
position: 1
- created_at: '2021-10-30T11:24:14.868Z'
- updated_at: '2021-10-30T11:24:14.868Z'
+ created_at: '2021-11-01T16:15:23.676Z'
+ updated_at: '2021-11-01T16:15:23.676Z'
filterable: true
relationships:
option_values:
@@ -4757,8 +4757,8 @@ paths:
name: foo-size-73
presentation: Size
position: 1
- created_at: '2021-10-30T11:24:14.899Z'
- updated_at: '2021-10-30T11:24:14.899Z'
+ created_at: '2021-11-01T16:15:23.707Z'
+ updated_at: '2021-11-01T16:15:23.707Z'
filterable: true
relationships:
option_values:
@@ -4814,8 +4814,8 @@ paths:
name: Size-X
presentation: Size
position: 1
- created_at: '2021-10-30T11:24:14.948Z'
- updated_at: '2021-10-30T11:24:14.954Z'
+ created_at: '2021-11-01T16:15:23.756Z'
+ updated_at: '2021-11-01T16:15:23.763Z'
filterable: true
relationships:
option_values:
@@ -4951,8 +4951,8 @@ paths:
position: 1
name: Size-68
presentation: S
- created_at: '2021-10-30T11:24:15.071Z'
- updated_at: '2021-10-30T11:24:15.071Z'
+ created_at: '2021-11-01T16:15:23.883Z'
+ updated_at: '2021-11-01T16:15:23.883Z'
relationships:
option_type:
data:
@@ -4964,8 +4964,8 @@ paths:
position: 1
name: Size-69
presentation: S
- created_at: '2021-10-30T11:24:15.077Z'
- updated_at: '2021-10-30T11:24:15.077Z'
+ created_at: '2021-11-01T16:15:23.890Z'
+ updated_at: '2021-11-01T16:15:23.890Z'
relationships:
option_type:
data:
@@ -5024,8 +5024,8 @@ paths:
position: 1
name: Size-72
presentation: S
- created_at: '2021-10-30T11:24:15.135Z'
- updated_at: '2021-10-30T11:24:15.135Z'
+ created_at: '2021-11-01T16:15:23.953Z'
+ updated_at: '2021-11-01T16:15:23.953Z'
relationships:
option_type:
data:
@@ -5088,8 +5088,8 @@ paths:
position: 1
name: Size-73
presentation: S
- created_at: '2021-10-30T11:24:15.169Z'
- updated_at: '2021-10-30T11:24:15.169Z'
+ created_at: '2021-11-01T16:15:23.987Z'
+ updated_at: '2021-11-01T16:15:23.987Z'
relationships:
option_type:
data:
@@ -5153,8 +5153,8 @@ paths:
position: 1
name: M
presentation: S
- created_at: '2021-10-30T11:24:15.237Z'
- updated_at: '2021-10-30T11:24:15.245Z'
+ created_at: '2021-11-01T16:15:24.045Z'
+ updated_at: '2021-11-01T16:15:24.054Z'
relationships:
option_type:
data:
@@ -5282,7 +5282,7 @@ paths:
- id: '40'
type: order
attributes:
- number: R849292836
+ number: R767427603
item_total: '0.0'
total: '0.0'
state: cart
@@ -5291,10 +5291,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:15.396Z'
- updated_at: '2021-10-30T11:24:15.396Z'
+ created_at: '2021-11-01T16:15:24.200Z'
+ updated_at: '2021-11-01T16:15:24.200Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5310,11 +5310,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$0.00"
- display_ship_total: "$0.00"
- display_shipment_total: "$0.00"
- display_total: "$0.00"
display_outstanding_balance: "$0.00"
display_item_total: "$0.00"
display_tax_total: "$0.00"
@@ -5323,6 +5318,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$0.00"
+ 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"
@@ -5366,7 +5366,7 @@ paths:
- id: '41'
type: order
attributes:
- number: R861172977
+ number: R860381766
item_total: '0.0'
total: '0.0'
state: cart
@@ -5375,10 +5375,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:15.405Z'
- updated_at: '2021-10-30T11:24:15.405Z'
+ created_at: '2021-11-01T16:15:24.208Z'
+ updated_at: '2021-11-01T16:15:24.208Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5394,11 +5394,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$0.00"
- display_ship_total: "$0.00"
- display_shipment_total: "$0.00"
- display_total: "$0.00"
display_outstanding_balance: "$0.00"
display_item_total: "$0.00"
display_tax_total: "$0.00"
@@ -5407,6 +5402,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$0.00"
+ 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"
@@ -5497,7 +5497,7 @@ paths:
id: '44'
type: order
attributes:
- number: R068850488
+ number: R827438171
item_total: '0.0'
total: '0.0'
state: cart
@@ -5508,8 +5508,8 @@ paths:
payment_state:
email:
special_instructions:
- created_at: '2021-10-30T11:24:15.710Z'
- updated_at: '2021-10-30T11:24:15.730Z'
+ created_at: '2021-11-01T16:15:24.523Z'
+ updated_at: '2021-11-01T16:15:24.592Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5525,11 +5525,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$20.00"
- display_ship_total: "$0.00"
- display_shipment_total: "$0.00"
- display_total: "$0.00"
display_outstanding_balance: "$0.00"
display_item_total: "$0.00"
display_tax_total: "$0.00"
@@ -5538,6 +5533,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$20.00"
+ 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"
@@ -5623,7 +5623,7 @@ paths:
id: '45'
type: order
attributes:
- number: R090923044
+ number: R621193222
item_total: '10.0'
total: '110.0'
state: delivery
@@ -5632,10 +5632,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:15.793Z'
- updated_at: '2021-10-30T11:24:15.927Z'
+ created_at: '2021-11-01T16:15:24.649Z'
+ updated_at: '2021-11-01T16:15:24.807Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5651,11 +5651,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$10.00"
- display_ship_total: "$100.00"
- display_shipment_total: "$100.00"
- display_total: "$110.00"
display_outstanding_balance: "$110.00"
display_item_total: "$10.00"
display_tax_total: "$0.00"
@@ -5664,6 +5659,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$10.00"
+ 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"
@@ -5765,7 +5765,7 @@ paths:
id: '47'
type: order
attributes:
- number: R250595441
+ number: R108854973
item_total: '10.0'
total: '110.0'
state: delivery
@@ -5776,8 +5776,8 @@ paths:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:16.098Z'
- updated_at: '2021-10-30T11:24:16.188Z'
+ created_at: '2021-11-01T16:15:24.989Z'
+ updated_at: '2021-11-01T16:15:25.081Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5793,11 +5793,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$10.00"
- display_ship_total: "$100.00"
- display_shipment_total: "$100.00"
- display_total: "$110.00"
display_outstanding_balance: "$110.00"
display_item_total: "$10.00"
display_tax_total: "$0.00"
@@ -5806,6 +5801,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$10.00"
+ 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"
@@ -5963,7 +5963,7 @@ paths:
id: '52'
type: order
attributes:
- number: R326211346
+ number: R613373980
item_total: '10.0'
total: '110.0'
state: payment
@@ -5972,10 +5972,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:16.735Z'
- updated_at: '2021-10-30T11:24:16.867Z'
+ created_at: '2021-11-01T16:15:25.740Z'
+ updated_at: '2021-11-01T16:15:25.887Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5991,11 +5991,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$110.00"
- display_ship_total: "$100.00"
- display_shipment_total: "$100.00"
- display_total: "$110.00"
display_outstanding_balance: "$110.00"
display_item_total: "$10.00"
display_tax_total: "$0.00"
@@ -6004,6 +5999,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$110.00"
+ 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"
@@ -6108,7 +6108,7 @@ paths:
id: '54'
type: order
attributes:
- number: R611595544
+ number: R555606296
item_total: '10.0'
total: '110.0'
state: payment
@@ -6117,10 +6117,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:17.047Z'
- updated_at: '2021-10-30T11:24:17.172Z'
+ created_at: '2021-11-01T16:15:26.058Z'
+ updated_at: '2021-11-01T16:15:26.187Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6136,11 +6136,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$110.00"
- display_ship_total: "$100.00"
- display_shipment_total: "$100.00"
- display_total: "$110.00"
display_outstanding_balance: "$110.00"
display_item_total: "$10.00"
display_tax_total: "$0.00"
@@ -6149,6 +6144,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$110.00"
+ 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"
@@ -6253,19 +6253,19 @@ paths:
id: '56'
type: order
attributes:
- number: R770832984
+ number: R437940802
item_total: '10.0'
total: '110.0'
state: complete
adjustment_total: '0.0'
- completed_at: '2021-10-30T11:24:17.543Z'
+ completed_at: '2021-11-01T16:15:26.559Z'
payment_total: '0.0'
shipment_state: pending
payment_state: balance_due
special_instructions:
- created_at: '2021-10-30T11:24:17.346Z'
- updated_at: '2021-10-30T11:24:17.543Z'
+ created_at: '2021-11-01T16:15:26.345Z'
+ updated_at: '2021-11-01T16:15:26.559Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6281,11 +6281,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$110.00"
- display_ship_total: "$100.00"
- display_shipment_total: "$100.00"
- display_total: "$110.00"
display_outstanding_balance: "$110.00"
display_item_total: "$10.00"
display_tax_total: "$0.00"
@@ -6294,6 +6289,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$110.00"
+ 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"
@@ -6409,7 +6409,7 @@ paths:
id: '59'
type: order
attributes:
- number: R425191745
+ number: R583410208
item_total: '0.0'
total: '0.0'
state: cart
@@ -6418,10 +6418,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:17.832Z'
- updated_at: '2021-10-30T11:24:17.926Z'
+ created_at: '2021-11-01T16:15:26.853Z'
+ updated_at: '2021-11-01T16:15:26.952Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -6437,11 +6437,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$0.00"
- display_ship_total: "$0.00"
- display_shipment_total: "$0.00"
- display_total: "$0.00"
display_outstanding_balance: "$0.00"
display_item_total: "$0.00"
display_tax_total: "$0.00"
@@ -6450,6 +6445,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$0.00"
+ 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"
@@ -6549,7 +6549,7 @@ paths:
id: '61'
type: order
attributes:
- number: R009106072
+ number: R007488347
item_total: '10.0'
total: '110.0'
state: delivery
@@ -6558,10 +6558,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-30T11:24:18.078Z'
- updated_at: '2021-10-30T11:24:18.159Z'
+ created_at: '2021-11-01T16:15:27.112Z'
+ updated_at: '2021-11-01T16:15:27.190Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6577,11 +6577,6 @@ paths:
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
store_owner_notification_delivered:
- display_included_tax_total: "$0.00"
- display_pre_tax_total: "$10.00"
- display_ship_total: "$100.00"
- display_shipment_total: "$100.00"
- display_total: "$110.00"
display_outstanding_balance: "$110.00"
display_item_total: "$10.00"
display_tax_total: "$0.00"
@@ -6590,6 +6585,11 @@ paths:
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
display_promo_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_pre_tax_total: "$10.00"
+ 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"
@@ -6637,37 +6637,422 @@ paths:
order_promotions:
data: []
schema:
- "$ref": "#/components/schemas/resource"
- '404':
- description: Record not found
+ "$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"
+ "/api/v2/platform/orders/{id}/cancel":
+ patch:
+ summary: Cancels an Order
+ tags:
+ - Orders
+ security:
+ - bearer_auth: []
+ description: Cancels an Order, when using a token created for a user, it will
+ save this user as the canceler
+ operationId: cancel-order
+ 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: line_items,variants,product
+ schema:
+ type: string
+ responses:
+ '200':
+ description: record canceled
+ '422':
+ description: cannot be canceled
+ '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/orders/{id}/use_store_credit":
+ patch:
+ summary: Use Store Credit for an Order
+ tags:
+ - Orders
+ security:
+ - bearer_auth: []
+ description: Creates Store Credit payment for an Order
+ operationId: use-store-credit-order
+ 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: line_items,variants,product
+ schema:
+ type: string
+ responses:
+ '200':
+ description: store credit payment created
+ '422':
+ description: user does not have store credit available
+ '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/amount_param"
+ "/api/v2/platform/orders/{id}/apply_coupon_code":
+ patch:
+ summary: Apply Coupon Code for an Order
+ tags:
+ - Orders
+ security:
+ - bearer_auth: []
+ description: Creates Store Credit payment for an Order
+ operationId: apply-coupon-code-order
+ 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: line_items,variants,product
+ schema:
+ type: string
+ responses:
+ '200':
+ description: coupon code applied
+ '422':
+ description: coupon code couldn't be applied
+ '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/coupon_code_param"
+ "/api/v2/platform/payment_methods":
+ get:
+ summary: Return a list of Payment Methods
+ tags:
+ - Payment Methods
+ security:
+ - bearer_auth: []
+ description: Returns a list of Payment Methods
+ operationId: payment-methods-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: stores
+ schema:
+ type: string
+ - name: filter[name]
+ in: query
+ description: ''
+ example: Stripe
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Records returned
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ - id: '12'
+ type: payment_method
+ attributes:
+ name: Test
+ type: Spree::PaymentMethod
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 1
+ created_at: '2021-11-01T16:15:28.804Z'
+ updated_at: '2021-11-01T16:15:28.804Z'
+ deleted_at:
+ preferences: {}
+ relationships:
+ stores:
+ data:
+ - id: '291'
+ type: store
+ - id: '13'
+ type: payment_method
+ attributes:
+ name: Test
+ type: Spree::PaymentMethod
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 2
+ created_at: '2021-11-01T16:15:28.810Z'
+ updated_at: '2021-11-01T16:15:28.810Z'
+ deleted_at:
+ preferences: {}
+ relationships:
+ stores:
+ data:
+ - id: '291'
+ type: store
+ - id: '14'
+ type: payment_method
+ attributes:
+ name: Test
+ type: Spree::PaymentMethod
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 3
+ created_at: '2021-11-01T16:15:28.813Z'
+ updated_at: '2021-11-01T16:15:28.813Z'
+ deleted_at:
+ preferences: {}
+ relationships:
+ stores:
+ data:
+ - id: '291'
+ type: store
+ - id: '15'
+ type: payment_method
+ attributes:
+ name: Credit Card
+ type: Spree::Gateway::Bogus
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 4
+ created_at: '2021-11-01T16:15:28.817Z'
+ updated_at: '2021-11-01T16:15:28.817Z'
+ deleted_at:
+ preferences:
+ dummy_key: PUBLICKEY123
+ server: test
+ test_mode: true
+ relationships:
+ stores:
+ data:
+ - id: '291'
+ type: store
+ - id: '16'
+ type: payment_method
+ attributes:
+ name: Credit Card
+ type: Spree::Gateway::Bogus
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 5
+ created_at: '2021-11-01T16:15:28.820Z'
+ updated_at: '2021-11-01T16:15:28.820Z'
+ deleted_at:
+ preferences:
+ dummy_key: PUBLICKEY123
+ server: test
+ test_mode: true
+ relationships:
+ stores:
+ data:
+ - id: '291'
+ type: store
+ meta:
+ count: 5
+ total_count: 5
+ total_pages: 1
+ links:
+ self: http://www.example.com/api/v2/platform/payment_methods?page=1&per_page=&include=&filter[name]=
+ next: http://www.example.com/api/v2/platform/payment_methods?filter%5Bname%5D=&include=&page=1&per_page=
+ prev: http://www.example.com/api/v2/platform/payment_methods?filter%5Bname%5D=&include=&page=1&per_page=
+ last: http://www.example.com/api/v2/platform/payment_methods?filter%5Bname%5D=&include=&page=1&per_page=
+ first: http://www.example.com/api/v2/platform/payment_methods?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 resource you were looking for could not be found.
+ error: The access token is invalid
schema:
"$ref": "#/components/schemas/error"
- '401':
- description: Authentication Failed
+ post:
+ summary: Create a Payment Method
+ tags:
+ - Payment Methods
+ security:
+ - bearer_auth: []
+ description: Creates a Payment Method
+ operationId: create-payment-method
+ 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: stores
+ schema:
+ type: string
+ responses:
+ '201':
+ description: Record created
content:
application/vnd.api+json:
examples:
Example:
value:
- error: The access token is invalid
+ data:
+ id: '24'
+ type: payment_method
+ attributes:
+ name: API Bogus
+ type: Spree::Gateway::Bogus
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 3
+ created_at: '2021-11-01T16:15:28.931Z'
+ updated_at: '2021-11-01T16:15:28.931Z'
+ deleted_at:
+ preferences:
+ dummy_key: PUBLICKEY123
+ server: test
+ test_mode: true
+ relationships:
+ stores:
+ data:
+ - id: '295'
+ type: store
+ - id: '296'
+ type: store
schema:
- "$ref": "#/components/schemas/error"
- "/api/v2/platform/orders/{id}/cancel":
- patch:
- summary: Cancels an Order
+ "$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_payment_method_params"
+ "/api/v2/platform/payment_methods/{id}":
+ get:
+ summary: Return a Payment Method
tags:
- - Orders
+ - Payment Methods
security:
- bearer_auth: []
- description: Cancels an Order, when using a token created for a user, it will
- save this user as the canceler
- operationId: cancel-order
+ description: Returns a Payment Method
+ operationId: show-payment-method
parameters:
- name: id
in: path
@@ -6678,14 +7063,42 @@ 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: line_items,variants,product
+ example: stores
schema:
type: string
responses:
'200':
- description: record canceled
- '422':
- description: cannot be canceled
+ description: Record found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '30'
+ type: payment_method
+ attributes:
+ name: Credit Card
+ type: Spree::Gateway::Bogus
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 4
+ created_at: '2021-11-01T16:15:29.018Z'
+ updated_at: '2021-11-01T16:15:29.018Z'
+ deleted_at:
+ preferences:
+ dummy_key: PUBLICKEY123
+ server: test
+ test_mode: true
+ relationships:
+ stores:
+ data:
+ - id: '299'
+ type: store
+ schema:
+ "$ref": "#/components/schemas/resource"
'404':
description: Record not found
content:
@@ -6706,15 +7119,14 @@ paths:
error: The access token is invalid
schema:
"$ref": "#/components/schemas/error"
- "/api/v2/platform/orders/{id}/use_store_credit":
patch:
- summary: Use Store Credit for an Order
+ summary: Update a Payment Method
tags:
- - Orders
+ - Payment Methods
security:
- bearer_auth: []
- description: Creates Store Credit payment for an Order
- operationId: use-store-credit-order
+ description: Updates a Payment Method
+ operationId: update-payment-method
parameters:
- name: id
in: path
@@ -6725,14 +7137,55 @@ 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: line_items,variants,product
+ example: stores
schema:
type: string
responses:
'200':
- description: store credit payment created
+ description: Record updated
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '40'
+ type: payment_method
+ attributes:
+ name: Credit Card
+ type: Spree::Gateway::Bogus
+ description:
+ active: true
+ display_on: both
+ auto_capture:
+ position: 3
+ created_at: '2021-11-01T16:15:29.151Z'
+ updated_at: '2021-11-01T16:15:29.161Z'
+ deleted_at:
+ preferences:
+ dummy_key: UPDATED-DUMMY-KEY-123
+ server: production
+ test_mode: false
+ relationships:
+ stores:
+ data:
+ - id: '305'
+ type: store
+ schema:
+ "$ref": "#/components/schemas/resource"
'422':
- description: user does not have store credit available
+ 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:
@@ -6757,34 +7210,26 @@ paths:
content:
application/json:
schema:
- "$ref": "#/components/schemas/amount_param"
- "/api/v2/platform/orders/{id}/apply_coupon_code":
- patch:
- summary: Apply Coupon Code for an Order
+ oneOf:
+ - "$ref": "#/components/schemas/update_payment_method_params"
+ - "$ref": "#/components/schemas/update_payment_method_params_bogus_gateway"
+ delete:
+ summary: Delete a Payment Method
tags:
- - Orders
+ - Payment Methods
security:
- bearer_auth: []
- description: Creates Store Credit payment for an Order
- operationId: apply-coupon-code-order
+ description: Deletes a Payment Method
+ operationId: delete-payment-method
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: line_items,variants,product
- schema:
- type: string
responses:
- '200':
- description: coupon code applied
- '422':
- description: coupon code couldn't be applied
+ '204':
+ description: Record deleted
'404':
description: Record not found
content:
@@ -6805,11 +7250,6 @@ paths:
error: The access token is invalid
schema:
"$ref": "#/components/schemas/error"
- requestBody:
- content:
- application/json:
- schema:
- "$ref": "#/components/schemas/coupon_code_param"
"/api/v2/platform/payments":
get:
summary: Return a list of Payments
@@ -6866,9 +7306,9 @@ paths:
state: invalid
response_code: '12345'
avs_response:
- created_at: '2021-10-30T11:24:19.722Z'
- updated_at: '2021-10-30T11:24:19.740Z'
- number: PWPUO6XD
+ created_at: '2021-11-01T16:15:29.420Z'
+ updated_at: '2021-11-01T16:15:29.436Z'
+ number: PDYDZDPY
cvv_response_code:
cvv_response_message:
display_amount: "$45.75"
@@ -6879,7 +7319,7 @@ paths:
type: order
payment_method:
data:
- id: '12'
+ id: '60'
type: payment_method
source:
data:
@@ -6903,9 +7343,9 @@ paths:
state: checkout
response_code: '12345'
avs_response:
- created_at: '2021-10-30T11:24:19.737Z'
- updated_at: '2021-10-30T11:24:19.737Z'
- number: PDOORC4E
+ created_at: '2021-11-01T16:15:29.433Z'
+ updated_at: '2021-11-01T16:15:29.433Z'
+ number: P5T0GV41
cvv_response_code:
cvv_response_message:
display_amount: "$45.75"
@@ -6916,7 +7356,7 @@ paths:
type: order
payment_method:
data:
- id: '12'
+ id: '60'
type: payment_method
source:
data:
@@ -6991,9 +7431,9 @@ paths:
state: checkout
response_code: '12345'
avs_response:
- created_at: '2021-10-30T11:24:19.905Z'
- updated_at: '2021-10-30T11:24:19.905Z'
- number: PAMGJ03K
+ created_at: '2021-11-01T16:15:29.602Z'
+ updated_at: '2021-11-01T16:15:29.602Z'
+ number: PR4F6556
cvv_response_code:
cvv_response_message:
display_amount: "$45.75"
@@ -7004,7 +7444,7 @@ paths:
type: order
payment_method:
data:
- id: '18'
+ id: '66'
type: payment_method
source:
data:
@@ -7129,8 +7569,8 @@ paths:
type: promotion_category
attributes:
name: Promotion Category
- created_at: '2021-10-30T11:24:20.118Z'
- updated_at: '2021-10-30T11:24:20.118Z'
+ created_at: '2021-11-01T16:15:29.811Z'
+ updated_at: '2021-11-01T16:15:29.811Z'
code: POP123
relationships:
promotions:
@@ -7139,8 +7579,8 @@ paths:
type: promotion_category
attributes:
name: Promotion Category
- created_at: '2021-10-30T11:24:20.120Z'
- updated_at: '2021-10-30T11:24:20.120Z'
+ created_at: '2021-11-01T16:15:29.813Z'
+ updated_at: '2021-11-01T16:15:29.813Z'
code: POP123
relationships:
promotions:
@@ -7196,8 +7636,8 @@ paths:
type: promotion_category
attributes:
name: Promotion Category
- created_at: '2021-10-30T11:24:20.173Z'
- updated_at: '2021-10-30T11:24:20.173Z'
+ created_at: '2021-11-01T16:15:29.861Z'
+ updated_at: '2021-11-01T16:15:29.861Z'
code: 2021-BFM
relationships:
promotions:
@@ -7257,8 +7697,8 @@ paths:
type: promotion_category
attributes:
name: Promotion Category
- created_at: '2021-10-30T11:24:20.204Z'
- updated_at: '2021-10-30T11:24:20.204Z'
+ created_at: '2021-11-01T16:15:29.897Z'
+ updated_at: '2021-11-01T16:15:29.897Z'
code: MJO
relationships:
promotions:
@@ -7319,8 +7759,8 @@ paths:
type: promotion_category
attributes:
name: 2021 Promotions
- created_at: '2021-10-30T11:24:20.265Z'
- updated_at: '2021-10-30T11:24:20.272Z'
+ created_at: '2021-11-01T16:15:29.949Z'
+ updated_at: '2021-11-01T16:15:29.955Z'
code: 2021-Promos
relationships:
promotions:
@@ -7448,12 +7888,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H80713946891
+ number: H88505663024
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-10-30T11:24:20.410Z'
- updated_at: '2021-10-30T11:24:20.413Z'
+ created_at: '2021-11-01T16:15:30.080Z'
+ updated_at: '2021-11-01T16:15:30.083Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -7461,11 +7901,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -7495,12 +7935,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H61878101094
+ number: H98428238361
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-10-30T11:24:20.439Z'
- updated_at: '2021-10-30T11:24:20.442Z'
+ created_at: '2021-11-01T16:15:30.110Z'
+ updated_at: '2021-11-01T16:15:30.113Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -7508,11 +7948,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -7595,12 +8035,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H14154299516
+ number: H36188312911
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-10-30T11:24:20.722Z'
- updated_at: '2021-10-30T11:24:20.739Z'
+ created_at: '2021-11-01T16:15:30.406Z'
+ updated_at: '2021-11-01T16:15:30.424Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -7608,11 +8048,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -7734,12 +8174,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H51615482546
+ number: H71866168944
cost: '100.0'
shipped_at:
state: ready
- created_at: '2021-10-30T11:24:21.589Z'
- updated_at: '2021-10-30T11:24:21.618Z'
+ created_at: '2021-11-01T16:15:31.307Z'
+ updated_at: '2021-11-01T16:15:31.336Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -7747,11 +8187,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -7838,12 +8278,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H46674457264
+ number: H73130150181
cost: '100.0'
- shipped_at: '2021-10-30T11:24:22.066Z'
+ shipped_at: '2021-11-01T16:15:31.759Z'
state: shipped
- created_at: '2021-10-30T11:24:22.030Z'
- updated_at: '2021-10-30T11:24:22.066Z'
+ created_at: '2021-11-01T16:15:31.726Z'
+ updated_at: '2021-11-01T16:15:31.759Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -7851,11 +8291,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -7942,12 +8382,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H29918026100
+ number: H00303001213
cost: '100.0'
shipped_at:
state: canceled
- created_at: '2021-10-30T11:24:22.460Z'
- updated_at: '2021-10-30T11:24:22.487Z'
+ created_at: '2021-11-01T16:15:32.142Z'
+ updated_at: '2021-11-01T16:15:32.173Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -7955,11 +8395,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -8046,12 +8486,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H95956106156
+ number: H57719834983
cost: '100.0'
shipped_at:
state: ready
- created_at: '2021-10-30T11:24:23.036Z'
- updated_at: '2021-10-30T11:24:23.061Z'
+ created_at: '2021-11-01T16:15:32.566Z'
+ updated_at: '2021-11-01T16:15:32.594Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8059,11 +8499,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -8150,12 +8590,12 @@ paths:
type: shipment
attributes:
tracking: U10000
- number: H25165182614
+ number: H41747708365
cost: '100.0'
shipped_at:
state: pending
- created_at: '2021-10-30T11:24:23.480Z'
- updated_at: '2021-10-30T11:24:23.507Z'
+ created_at: '2021-11-01T16:15:32.990Z'
+ updated_at: '2021-11-01T16:15:33.017Z'
adjustment_total: '0.0'
additional_tax_total: '0.0'
promo_total: '0.0'
@@ -8163,11 +8603,11 @@ paths:
pre_tax_amount: '0.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
+ display_final_price: "$100.00"
+ 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:
@@ -8258,14 +8698,14 @@ paths:
type: shipping_category
attributes:
name: 'ShippingCategory #116'
- created_at: '2021-10-30T11:24:23.744Z'
- updated_at: '2021-10-30T11:24:23.744Z'
+ created_at: '2021-11-01T16:15:33.247Z'
+ updated_at: '2021-11-01T16:15:33.247Z'
- id: '117'
type: shipping_category
attributes:
name: 'ShippingCategory #117'
- created_at: '2021-10-30T11:24:23.746Z'
- updated_at: '2021-10-30T11:24:23.746Z'
+ created_at: '2021-11-01T16:15:33.248Z'
+ updated_at: '2021-11-01T16:15:33.248Z'
meta:
count: 2
total_count: 2
@@ -8310,8 +8750,8 @@ paths:
type: shipping_category
attributes:
name: 'ShippingCategory #120'
- created_at: '2021-10-30T11:24:23.797Z'
- updated_at: '2021-10-30T11:24:23.797Z'
+ created_at: '2021-11-01T16:15:33.372Z'
+ updated_at: '2021-11-01T16:15:33.372Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -8360,8 +8800,8 @@ paths:
type: shipping_category
attributes:
name: 'ShippingCategory #121'
- created_at: '2021-10-30T11:24:23.841Z'
- updated_at: '2021-10-30T11:24:23.841Z'
+ created_at: '2021-11-01T16:15:33.405Z'
+ updated_at: '2021-11-01T16:15:33.405Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -8411,8 +8851,8 @@ paths:
type: shipping_category
attributes:
name: Default
- created_at: '2021-10-30T11:24:23.921Z'
- updated_at: '2021-10-30T11:24:23.928Z'
+ created_at: '2021-11-01T16:15:33.455Z'
+ updated_at: '2021-11-01T16:15:33.461Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -8546,8 +8986,8 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-10-30T11:24:24.064Z'
- updated_at: '2021-10-30T11:24:24.064Z'
+ created_at: '2021-11-01T16:15:33.579Z'
+ updated_at: '2021-11-01T16:15:33.579Z'
deleted_at:
relationships:
shipping_categories:
@@ -8570,8 +9010,8 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-10-30T11:24:24.074Z'
- updated_at: '2021-10-30T11:24:24.074Z'
+ created_at: '2021-11-01T16:15:33.588Z'
+ updated_at: '2021-11-01T16:15:33.588Z'
deleted_at:
relationships:
shipping_categories:
@@ -8641,8 +9081,8 @@ paths:
admin_name: DHL Express- Zone A
display_on: both
tracking_url:
- created_at: '2021-10-30T11:24:24.155Z'
- updated_at: '2021-10-30T11:24:24.155Z'
+ created_at: '2021-11-01T16:15:33.665Z'
+ updated_at: '2021-11-01T16:15:33.665Z'
deleted_at:
relationships:
shipping_categories:
@@ -8726,8 +9166,8 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-10-30T11:24:24.204Z'
- updated_at: '2021-10-30T11:24:24.204Z'
+ created_at: '2021-11-01T16:15:33.713Z'
+ updated_at: '2021-11-01T16:15:33.713Z'
deleted_at:
relationships:
shipping_categories:
@@ -8802,8 +9242,8 @@ paths:
admin_name:
display_on: both
tracking_url:
- created_at: '2021-10-30T11:24:24.298Z'
- updated_at: '2021-10-30T11:24:24.330Z'
+ created_at: '2021-11-01T16:15:33.787Z'
+ updated_at: '2021-11-01T16:15:33.801Z'
deleted_at:
relationships:
shipping_categories:
@@ -8952,8 +9392,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-30T11:24:24.590Z'
- updated_at: '2021-10-30T11:24:24.594Z'
+ created_at: '2021-11-01T16:15:34.031Z'
+ updated_at: '2021-11-01T16:15:34.035Z'
meta_title:
meta_description:
meta_keywords:
@@ -8987,8 +9427,8 @@ paths:
lft: 4
rgt: 5
description:
- created_at: '2021-10-30T11:24:24.644Z'
- updated_at: '2021-10-30T11:24:24.649Z'
+ created_at: '2021-11-01T16:15:34.091Z'
+ updated_at: '2021-11-01T16:15:34.094Z'
meta_title:
meta_description:
meta_keywords:
@@ -9022,8 +9462,8 @@ paths:
lft: 1
rgt: 6
description:
- created_at: '2021-10-30T11:24:24.516Z'
- updated_at: '2021-10-30T11:24:24.659Z'
+ created_at: '2021-11-01T16:15:33.968Z'
+ updated_at: '2021-11-01T16:15:34.105Z'
meta_title:
meta_description:
meta_keywords:
@@ -9104,8 +9544,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-30T11:24:24.905Z'
- updated_at: '2021-10-30T11:24:24.910Z'
+ created_at: '2021-11-01T16:15:34.342Z'
+ updated_at: '2021-11-01T16:15:34.346Z'
meta_title:
meta_description:
meta_keywords:
@@ -9190,8 +9630,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-30T11:24:25.011Z'
- updated_at: '2021-10-30T11:24:25.015Z'
+ created_at: '2021-11-01T16:15:34.456Z'
+ updated_at: '2021-11-01T16:15:34.460Z'
meta_title:
meta_description:
meta_keywords:
@@ -9279,8 +9719,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-30T11:24:25.260Z'
- updated_at: '2021-10-30T11:24:25.287Z'
+ created_at: '2021-11-01T16:15:34.685Z'
+ updated_at: '2021-11-01T16:15:34.711Z'
meta_title:
meta_description:
meta_keywords:
@@ -9433,9 +9873,9 @@ paths:
- id: '97'
type: user
attributes:
- created_at: '2021-10-30T11:24:25.785Z'
- updated_at: '2021-10-30T11:24:25.785Z'
+ created_at: '2021-11-01T16:15:35.204Z'
+ updated_at: '2021-11-01T16:15:35.204Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -9447,9 +9887,9 @@ paths:
- id: '98'
type: user
attributes:
- created_at: '2021-10-30T11:24:25.791Z'
- updated_at: '2021-10-30T11:24:25.791Z'
+ created_at: '2021-11-01T16:15:35.209Z'
+ updated_at: '2021-11-01T16:15:35.209Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -9461,9 +9901,9 @@ paths:
- id: '99'
type: user
attributes:
- created_at: '2021-10-30T11:24:25.792Z'
- updated_at: '2021-10-30T11:24:25.792Z'
+ created_at: '2021-11-01T16:15:35.210Z'
+ updated_at: '2021-11-01T16:15:35.210Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -9522,9 +9962,9 @@ paths:
id: '104'
type: user
attributes:
- created_at: '2021-10-30T11:24:25.866Z'
- updated_at: '2021-10-30T11:24:25.866Z'
+ created_at: '2021-11-01T16:15:35.288Z'
+ updated_at: '2021-11-01T16:15:35.288Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -9587,9 +10027,9 @@ paths:
id: '107'
type: user
attributes:
- created_at: '2021-10-30T11:24:25.923Z'
- updated_at: '2021-10-30T11:24:25.923Z'
+ created_at: '2021-11-01T16:15:35.335Z'
+ updated_at: '2021-11-01T16:15:35.335Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -9654,8 +10094,8 @@ paths:
type: user
attributes:
- created_at: '2021-10-30T11:24:25.996Z'
- updated_at: '2021-10-30T11:24:26.006Z'
+ created_at: '2021-11-01T16:15:35.406Z'
+ updated_at: '2021-11-01T16:15:35.415Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -9802,12 +10242,12 @@ paths:
position: 1
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-30T11:24:26.210Z'
+ updated_at: '2021-11-01T16:15:35.625Z'
discontinue_on:
- created_at: '2021-10-30T11:24:26.205Z'
+ created_at: '2021-11-01T16:15:35.620Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #181 - 6099'
+ name: 'Product #181 - 116'
options_text: ''
total_on_hand: 0
purchasable: true
@@ -9842,21 +10282,21 @@ paths:
type: variant
attributes:
sku: SKU-249
- weight: '47.79'
- height: '139.2'
- depth: '147.76'
+ weight: '104.23'
+ height: '146.44'
+ depth: '173.52'
deleted_at:
is_master: false
cost_price: '17.0'
position: 2
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-30T11:24:26.240Z'
+ updated_at: '2021-11-01T16:15:35.653Z'
discontinue_on:
- created_at: '2021-10-30T11:24:26.234Z'
+ created_at: '2021-11-01T16:15:35.647Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #181 - 6099'
+ name: 'Product #181 - 116'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -9893,21 +10333,21 @@ paths:
type: variant
attributes:
sku: SKU-250
- weight: '115.29'
- height: '71.69'
- depth: '132.58'
+ weight: '86.2'
+ height: '132.54'
+ depth: '194.2'
deleted_at:
is_master: false
cost_price: '17.0'
position: 3
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-30T11:24:26.261Z'
+ updated_at: '2021-11-01T16:15:35.672Z'
discontinue_on:
- created_at: '2021-10-30T11:24:26.255Z'
+ created_at: '2021-11-01T16:15:35.666Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #181 - 6099'
+ name: 'Product #181 - 116'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -9997,21 +10437,21 @@ paths:
type: variant
attributes:
sku: SKU-255
- weight: '71.15'
- height: '22.81'
- depth: '160.29'
+ weight: '195.68'
+ height: '31.86'
+ depth: '6.16'
deleted_at:
is_master: false
cost_price: '17.0'
position: 2
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-30T11:24:26.469Z'
+ updated_at: '2021-11-01T16:15:35.885Z'
discontinue_on:
- created_at: '2021-10-30T11:24:26.463Z'
+ created_at: '2021-11-01T16:15:35.879Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #183 - 1265'
+ name: 'Product #183 - 4666'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -10172,14 +10612,14 @@ paths:
- id: '1'
type: event
attributes:
- execution_time: 32374
+ execution_time: 2695
name: order.canceled
request_errors: ''
response_code: '200'
success: true
url: https://www.url1.com/
- created_at: '2021-10-30T11:24:26.797Z'
- updated_at: '2021-10-30T11:24:26.797Z'
+ created_at: '2021-11-01T16:15:36.301Z'
+ updated_at: '2021-11-01T16:15:36.301Z'
relationships:
subscriber:
data:
@@ -10188,14 +10628,14 @@ paths:
- id: '2'
type: event
attributes:
- execution_time: 81797
+ execution_time: 98173
name: order.canceled
request_errors: ''
response_code: '200'
success: true
url: https://www.url2.com/
- created_at: '2021-10-30T11:24:26.799Z'
- updated_at: '2021-10-30T11:24:26.799Z'
+ created_at: '2021-11-01T16:15:36.304Z'
+ updated_at: '2021-11-01T16:15:36.304Z'
relationships:
subscriber:
data:
@@ -10271,8 +10711,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-10-30T11:24:26.842Z'
- updated_at: '2021-10-30T11:24:26.842Z'
+ created_at: '2021-11-01T16:15:36.359Z'
+ updated_at: '2021-11-01T16:15:36.359Z'
- id: '6'
type: subscriber
attributes:
@@ -10280,8 +10720,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-10-30T11:24:26.843Z'
- updated_at: '2021-10-30T11:24:26.843Z'
+ created_at: '2021-11-01T16:15:36.360Z'
+ updated_at: '2021-11-01T16:15:36.360Z'
meta:
count: 2
total_count: 2
@@ -10329,8 +10769,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-10-30T11:24:26.887Z'
- updated_at: '2021-10-30T11:24:26.887Z'
+ created_at: '2021-11-01T16:15:36.408Z'
+ updated_at: '2021-11-01T16:15:36.408Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -10385,8 +10825,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-10-30T11:24:26.925Z'
- updated_at: '2021-10-30T11:24:26.925Z'
+ created_at: '2021-11-01T16:15:36.439Z'
+ updated_at: '2021-11-01T16:15:36.439Z'
schema:
"$ref": "#/components/schemas/resource"
'404':
@@ -10439,8 +10879,8 @@ paths:
active: true
subscriptions:
- "*"
- created_at: '2021-10-30T11:24:26.977Z'
- updated_at: '2021-10-30T11:24:26.977Z'
+ created_at: '2021-11-01T16:15:36.492Z'
+ updated_at: '2021-11-01T16:15:36.492Z'
schema:
"$ref": "#/components/schemas/resource"
'422':
@@ -10561,8 +11001,8 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-30T11:24:27.221Z'
- updated_at: '2021-10-30T11:24:27.221Z'
+ created_at: '2021-11-01T16:15:36.733Z'
+ updated_at: '2021-11-01T16:15:36.733Z'
display_total: "$19.99"
display_price: "$19.99"
price: '19.99'
@@ -10576,8 +11016,8 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-30T11:24:27.270Z'
- updated_at: '2021-10-30T11:24:27.270Z'
+ created_at: '2021-11-01T16:15:36.780Z'
+ updated_at: '2021-11-01T16:15:36.780Z'
display_total: "$19.99"
display_price: "$19.99"
price: '19.99'
@@ -10591,8 +11031,8 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-30T11:24:27.316Z'
- updated_at: '2021-10-30T11:24:27.316Z'
+ created_at: '2021-11-01T16:15:36.826Z'
+ updated_at: '2021-11-01T16:15:36.826Z'
display_total: "$19.99"
display_price: "$19.99"
price: '19.99'
@@ -10606,8 +11046,8 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-30T11:24:27.362Z'
- updated_at: '2021-10-30T11:24:27.362Z'
+ created_at: '2021-11-01T16:15:36.871Z'
+ updated_at: '2021-11-01T16:15:36.871Z'
display_total: "$19.99"
display_price: "$19.99"
price: '19.99'
@@ -10668,8 +11108,8 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-30T11:24:27.754Z'
- updated_at: '2021-10-30T11:24:27.754Z'
+ created_at: '2021-11-01T16:15:37.319Z'
+ updated_at: '2021-11-01T16:15:37.319Z'
display_total: "$19.99"
display_price: "$19.99"
price: '19.99'
@@ -10739,8 +11179,8 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-30T11:24:27.977Z'
- updated_at: '2021-10-30T11:24:27.977Z'
+ created_at: '2021-11-01T16:15:37.525Z'
+ updated_at: '2021-11-01T16:15:37.525Z'
display_total: "$19.99"
display_price: "$19.99"
price: '19.99'
@@ -10806,8 +11246,8 @@ paths:
type: wished_item
attributes:
quantity: 3
- created_at: '2021-10-30T11:24:28.342Z'
- updated_at: '2021-10-30T11:24:28.351Z'
+ created_at: '2021-11-01T16:15:37.859Z'
+ updated_at: '2021-11-01T16:15:37.867Z'
display_total: "$59.97"
display_price: "$19.99"
price: '19.99'
@@ -10942,9 +11382,9 @@ paths:
name: Black Friday
is_private: true
is_default: false
- created_at: '2021-10-30T11:24:29.057Z'
- updated_at: '2021-10-30T11:24:29.057Z'
- token: vRNxTLXPHygNAha3TX3WeSjw
+ created_at: '2021-11-01T16:15:38.537Z'
+ updated_at: '2021-11-01T16:15:38.537Z'
+ token: FWxVNirxSL8hyJDQJpZeBx4y
variant_included: false
relationships:
wished_items:
@@ -10959,9 +11399,9 @@ paths:
name: Birthday
is_private: true
is_default: false
- created_at: '2021-10-30T11:24:29.059Z'
- updated_at: '2021-10-30T11:24:29.059Z'
- token: yWj4WqUybGoBykJfjCgWiYbX
+ created_at: '2021-11-01T16:15:38.538Z'
+ updated_at: '2021-11-01T16:15:38.538Z'
+ token: u7ttyfedUjYCZjoKVkDnjEgG
variant_included: false
relationships:
wished_items:
@@ -11023,9 +11463,9 @@ paths:
name: Wishlist_26
is_private: true
is_default: false
- created_at: '2021-10-30T11:24:29.529Z'
- updated_at: '2021-10-30T11:24:29.529Z'
- token: Cmg2QJKEkhTXiwNVdM8k1L9o
+ created_at: '2021-11-01T16:15:38.982Z'
+ updated_at: '2021-11-01T16:15:38.982Z'
+ token: eYsnp8KKEYoDYC57kNAdqXR5
variant_included: false
relationships:
wished_items:
@@ -11089,9 +11529,9 @@ paths:
name: My Wishlist
is_private: true
is_default: false
- created_at: '2021-10-30T11:24:29.569Z'
- updated_at: '2021-10-30T11:24:29.569Z'
- token: L8XkKPNUEQmMDfwNWeK6AEBu
+ created_at: '2021-11-01T16:15:39.020Z'
+ updated_at: '2021-11-01T16:15:39.020Z'
+ token: HAqhVZZtc7hTXi4ndQid4WTJ
variant_included: false
relationships:
wished_items:
@@ -11154,9 +11594,9 @@ paths:
name: My Super Wishlist
is_private: true
is_default: false
- created_at: '2021-10-30T11:24:29.633Z'
- updated_at: '2021-10-30T11:24:29.641Z'
- token: jmp6WtwK9sjr7NyxEEdQQojc
+ created_at: '2021-11-01T16:15:39.080Z'
+ updated_at: '2021-11-01T16:15:39.087Z'
+ token: oKXZZsptL87xzBuk1G8uqkhE
variant_included: false
relationships:
wished_items:
@@ -11259,6 +11699,7 @@ tags:
- name: Option Values
- name: Orders
- name: Payments
+- name: Payment Methods
- name: Promotion Categories
- name: Shipments
- name: Shipping Categories
@@ -11935,7 +12376,7 @@ components:
completed_at:
type: string
format: date_time
- example: 2021-10-30 11:23:55 UTC
+ example: 2021-11-01 16:15:03 UTC
bill_address_id:
type: string
example: '1'
@@ -12003,7 +12444,7 @@ components:
approved_at:
type: string
format: date_time
- example: 2021-10-30 11:23:55 UTC
+ example: 2021-11-01 16:15:03 UTC
confirmation_delivered:
type: boolean
example: true
@@ -12070,7 +12511,7 @@ components:
completed_at:
type: string
format: date_time
- example: 2021-10-30 11:23:55 UTC
+ example: 2021-11-01 16:15:03 UTC
bill_address_id:
type: string
example: '1'
@@ -12138,7 +12579,7 @@ components:
approved_at:
type: string
format: date_time
- example: 2021-10-30 11:23:55 UTC
+ example: 2021-11-01 16:15:03 UTC
confirmation_delivered:
type: boolean
example: true
@@ -12173,6 +12614,103 @@ components:
required:
- order
x-internal: true
+ create_payment_method_params:
+ type: object
+ properties:
+ payment_method:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ example: Test Payment Method
+ active:
+ type: boolean
+ auto_capture:
+ type: boolean
+ description:
+ type: string
+ example: This is a test payment method
+ type:
+ type: string
+ example: Spree::Gateway::Bogus
+ enum:
+ - Spree::Gateway::Bogus
+ - Spree::PaymentMethod::Check
+ display_on:
+ type: string
+ example: both
+ enum:
+ - both
+ - back_end
+ - front_end
+ store_ids:
+ type: array
+ items:
+ allOf:
+ - type: string
+ example: '2'
+ required:
+ - payment_method
+ x-internal: true
+ update_payment_method_params:
+ type: object
+ properties:
+ payment_method:
+ type: object
+ properties:
+ name:
+ type: string
+ example: Test Payment Method
+ active:
+ type: boolean
+ auto_capture:
+ type: boolean
+ description:
+ type: string
+ example: This is a test payment method
+ type:
+ type: string
+ example: Spree::Gateway::Bogus
+ enum:
+ - Spree::Gateway::Bogus
+ - Spree::PaymentMethod::Check
+ display_on:
+ type: string
+ example: both
+ enum:
+ - both
+ - back_end
+ - front_end
+ store_ids:
+ type: array
+ items:
+ allOf:
+ - type: string
+ example: '2'
+ required:
+ - payment_method
+ x-internal: true
+ title: Update Payment Method
+ update_payment_method_params_bogus_gateway:
+ type: object
+ properties:
+ payment_method:
+ type: object
+ properties:
+ preferred_dummy_key:
+ type: string
+ example: UPDATED-DUMMY-KEY-123
+ preferred_server:
+ type: string
+ example: production
+ preferred_test_mode:
+ type: boolean
+ required:
+ - payment_method
+ x-internal: true
+ title: Update Bogus Gateway
create_product_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 47c7e96f33..f1f5f35eae 100644
--- a/api/lib/spree/api/testing_support/v2/platform_contexts.rb
+++ b/api/lib/spree/api/testing_support/v2/platform_contexts.rb
@@ -165,6 +165,7 @@ end
# create
shared_examples 'POST create record' do |resource_name, **options|
+ custom_create_params = options[:custom_create_params] || nil
endpoint_name = options[:custom_endpoint_name] || resource_name
param_name = resource_name.parameterize(separator: '_').to_sym
consumes_kind = options[:consumes_kind] || 'application/json'
@@ -181,7 +182,11 @@ shared_examples 'POST create record' do |resource_name, **options|
security [ bearer_auth: [] ]
description "Creates #{endpoint_name.articleize}"
operationId "create-#{resource_name.parameterize.to_sym}"
- parameter name: param_name, in: request_data_type, schema: { '$ref' => "#/components/schemas/create_#{param_name}_params" }
+ if custom_create_params
+ parameter name: param_name, in: request_data_type, schema: custom_create_params
+ else
+ parameter name: param_name, in: request_data_type, schema: { '$ref' => "#/components/schemas/create_#{param_name}_params" }
+ end
json_api_include_parameter(options[:include_example]) unless options[:include_example].nil?
let(param_name) { valid_create_param_value }
@@ -193,6 +198,7 @@ end
# update
shared_examples 'PATCH update record' do |resource_name, **options|
+ custom_update_params = options[:custom_update_params] || nil
endpoint_name = options[:custom_endpoint_name] || resource_name
param_name = resource_name.parameterize(separator: '_').to_sym
consumes_kind = options[:consumes_kind] || 'application/json'
@@ -210,7 +216,11 @@ shared_examples 'PATCH update record' do |resource_name, **options|
operationId "update-#{resource_name.parameterize.to_sym}"
consumes consumes_kind
parameter name: :id, in: :path, type: :string
- parameter name: param_name, in: request_data_type, schema: { '$ref' => "#/components/schemas/update_#{param_name}_params" }
+ if custom_update_params
+ parameter name: param_name, in: request_data_type, schema: custom_update_params
+ else
+ parameter name: param_name, in: request_data_type, schema: { '$ref' => "#/components/schemas/update_#{param_name}_params" }
+ end
json_api_include_parameter(options[:include_example]) unless options[:include_example].nil?
let(param_name) { valid_update_param_value }
diff --git a/api/spec/integration/api/v2/platform/payment_methods_spec.rb b/api/spec/integration/api/v2/platform/payment_methods_spec.rb
new file mode 100644
index 0000000000..586a7f737f
--- /dev/null
+++ b/api/spec/integration/api/v2/platform/payment_methods_spec.rb
@@ -0,0 +1,58 @@
+require 'swagger_helper'
+
+describe 'Payment Methods API', swagger: true do
+ include_context 'Platform API v2'
+
+ resource_name = 'Payment Method'
+ options = {
+ include_example: 'stores',
+ filter_examples: [{ name: 'filter[name]', example: 'Stripe' }],
+ custom_update_params: {
+ oneOf: [
+ { '$ref' => '#/components/schemas/update_payment_method_params' },
+ { '$ref' => '#/components/schemas/update_payment_method_params_bogus_gateway' }
+ ]
+ }
+ }
+
+ let!(:store) { Spree::Store.default }
+ let!(:store_two) { create(:store) }
+
+ let!(:payment_method) { create(:payment_method, stores: [store]) }
+ let!(:payment_method_two) { create(:payment_method, stores: [store]) }
+ let!(:payment_method_three) { create(:payment_method, stores: [store]) }
+
+ let(:id) { create(:credit_card_payment_method, stores: [store]).id }
+ let(:records_list) { create_list(:credit_card_payment_method, 2, stores: [store]) }
+
+ let(:valid_create_param_value) do
+ {
+ payment_method: {
+ name: 'API Bogus',
+ type: 'Spree::Gateway::Bogus',
+ display_on: 'both',
+ store_ids: [store.id.to_s, store_two.id.to_s]
+ }
+ }
+ end
+
+ let(:valid_update_param_value) do
+ {
+ payment_method: {
+ preferred_test_mode: false,
+ preferred_dummy_key: 'UPDATED-DUMMY-KEY-123',
+ preferred_server: 'production'
+ }
+ }
+ end
+
+ let(:invalid_param_value) do
+ {
+ payment_method: {
+ name: ''
+ }
+ }
+ end
+
+ include_examples 'CRUD examples', resource_name, options
+end
diff --git a/api/spec/requests/spree/api/v2/platform/cms_sections_spec.rb b/api/spec/requests/spree/api/v2/platform/cms_sections_spec.rb
index 040e0430de..1a6c33203c 100644
--- a/api/spec/requests/spree/api/v2/platform/cms_sections_spec.rb
+++ b/api/spec/requests/spree/api/v2/platform/cms_sections_spec.rb
@@ -6,15 +6,17 @@ describe 'Platform API v2 CmsSections', type: :request do
let!(:store) { Spree::Store.default }
let!(:page) { create(:cms_homepage, store: store) }
- let!(:section_a) { create(:cms_section, cms_page: page) }
- let!(:section_b) { create(:cms_section, cms_page: page) }
- let!(:section_c) { create(:cms_section, cms_page: page) }
- let!(:section_d) { create(:cms_section, cms_page: page) }
- let!(:section_e) { create(:cms_section, cms_page: page) }
+
+ let!(:resource_a) { create(:cms_section, cms_page: page) }
+ let!(:resource_b) { create(:cms_section, cms_page: page) }
+ let!(:resource_c) { create(:cms_section, cms_page: page) }
+ let!(:resource_d) { create(:cms_section, cms_page: page) }
+ let!(:resource_e) { create(:cms_section, cms_page: page) }
+
let(:bearer_token) { { 'Authorization' => valid_authorization } }
- describe 'cms_section#update' do
- context 'move section_a from position 1 down to position 5' do
+ describe 'cms_sections#update' do
+ context 'move resource_a from position 1 down to position 5' do
let(:params) do
{
cms_section: { position: 5 }
@@ -22,51 +24,51 @@ describe 'Platform API v2 CmsSections', type: :request do
end
before do
- patch "/api/v2/platform/cms_sections/#{section_a.id}", headers: bearer_token, params: params
+ patch "/api/v2/platform/cms_sections/#{resource_a.id}", headers: bearer_token, params: params
end
it_behaves_like 'returns 200 HTTP status'
- it 'moves section_a from position 1 to position 5 and updates the positions of the other sections accordingly' do
+ it 'moves resource_a from position 1 to position 5 and updates the positions of its siblings accordingly' do
reload_sections
- expect(section_b.position).to eq(1)
- expect(section_c.position).to eq(2)
- expect(section_d.position).to eq(3)
- expect(section_e.position).to eq(4)
- expect(section_a.position).to eq(5)
+ expect(resource_b.position).to eq(1)
+ expect(resource_c.position).to eq(2)
+ expect(resource_d.position).to eq(3)
+ expect(resource_e.position).to eq(4)
+ expect(resource_a.position).to eq(5)
end
end
- context 'can accept 0 and move the item to position 1' do
+ context 'can move position and update other attribute' do
let(:params) do
{
cms_section: {
- name: 'Rename section and update Position!',
- position: 0
+ name: 'Rename resource and update Position!',
+ position: 1
}
}
end
before do
- patch "/api/v2/platform/cms_sections/#{section_d.id}", headers: bearer_token, params: params
+ patch "/api/v2/platform/cms_sections/#{resource_d.id}", headers: bearer_token, params: params
end
it_behaves_like 'returns 200 HTTP status'
- it 'moves section_d from position 4 to position 1 by passing position: 0, and renames the section' do
+ it 'moves resource_d from position 4 to position 1, and updates the name' do
reload_sections
- expect(section_d.position).to eq(1)
- expect(section_d.name).to eq('Rename section and update Position!')
+ expect(resource_d.position).to eq(1)
+ expect(resource_d.name).to eq('Rename resource and update Position!')
end
end
def reload_sections
- section_a.reload
- section_b.reload
- section_c.reload
- section_d.reload
- section_e.reload
+ resource_a.reload
+ resource_b.reload
+ resource_c.reload
+ resource_d.reload
+ resource_e.reload
end
end
end
diff --git a/api/spec/requests/spree/api/v2/platform/payment_methods_spec.rb b/api/spec/requests/spree/api/v2/platform/payment_methods_spec.rb
new file mode 100644
index 0000000000..121090a18d
--- /dev/null
+++ b/api/spec/requests/spree/api/v2/platform/payment_methods_spec.rb
@@ -0,0 +1,73 @@
+require 'spec_helper'
+
+describe 'Platform API v2 Payment Methods', type: :request do
+ include_context 'API v2 tokens'
+ include_context 'Platform API v2'
+
+ let!(:store) { Spree::Store.default }
+
+ let!(:resource_a) { create(:payment_method, stores: [store]) }
+ let!(:resource_b) { create(:payment_method, stores: [store]) }
+ let!(:resource_c) { create(:payment_method, stores: [store]) }
+ let!(:resource_d) { create(:payment_method, stores: [store]) }
+ let!(:resource_e) { create(:payment_method, stores: [store]) }
+
+ let(:bearer_token) { { 'Authorization' => valid_authorization } }
+
+ describe 'payment_methods#update' do
+ context 'move resource_a from position 1 down to position 5' do
+ let(:params) do
+ {
+ payment_method: { position: 5 }
+ }
+ end
+
+ before do
+ patch "/api/v2/platform/payment_methods/#{resource_a.id}", headers: bearer_token, params: params
+ end
+
+ it_behaves_like 'returns 200 HTTP status'
+
+ it 'moves resource_a from position 1 to position 5 and updates the positions of its siblings accordingly' do
+ reload_sections
+
+ expect(resource_b.position).to eq(1)
+ expect(resource_c.position).to eq(2)
+ expect(resource_d.position).to eq(3)
+ expect(resource_e.position).to eq(4)
+ expect(resource_a.position).to eq(5)
+ end
+ end
+
+ context 'can move position and update other attribute' do
+ let(:params) do
+ {
+ payment_method: {
+ name: 'Rename resource and update Position!',
+ position: 1
+ }
+ }
+ end
+
+ before do
+ patch "/api/v2/platform/payment_methods/#{resource_d.id}", headers: bearer_token, params: params
+ end
+
+ it_behaves_like 'returns 200 HTTP status'
+
+ it 'moves resource_d from position 4 to position 1, and updates the name' do
+ reload_sections
+ expect(resource_d.position).to eq(1)
+ expect(resource_d.name).to eq('Rename resource and update Position!')
+ end
+ end
+
+ def reload_sections
+ resource_a.reload
+ resource_b.reload
+ resource_c.reload
+ resource_d.reload
+ resource_e.reload
+ end
+ end
+end
diff --git a/api/spec/requests/spree/api/v2/platform/resources_spec.rb b/api/spec/requests/spree/api/v2/platform/resources_spec.rb
index 99f33ef83c..b0682bf62f 100644
--- a/api/spec/requests/spree/api/v2/platform/resources_spec.rb
+++ b/api/spec/requests/spree/api/v2/platform/resources_spec.rb
@@ -5,6 +5,9 @@ describe 'Platform API v2 Resources spec', type: :request do
include_context 'Platform API v2'
let!(:store) { Spree::Store.default }
+ let!(:store_two) { create(:store) }
+ let!(:store_three) { create(:store) }
+
let(:bearer_token) { { 'Authorization' => valid_authorization } }
let(:resource_params) { {} }
let(:params) { { address: resource_params } }
@@ -314,16 +317,60 @@ describe 'Platform API v2 Resources spec', type: :request do
it_behaves_like 'returns auth token errors'
context '#ensure_current_store' do
- let(:execute) { post '/api/v2/platform/menus', params: menu_resource_params, headers: bearer_token }
- let(:menu_resource_params) { { menu: build(:menu, name: 'Ensure-MenuTest', location: 'Header', locale: 'en').attributes.symbolize_keys } }
+ context 'single store resource' do
+ let(:execute) { post '/api/v2/platform/menus', params: menu_resource_params, headers: bearer_token }
+ let(:menu_resource_params) { { menu: build(:menu, name: 'Ensure-MenuTest', location: 'Header', locale: 'en').attributes.symbolize_keys } }
- before { execute }
+ before { execute }
- it_behaves_like 'returns 201 HTTP status'
+ it_behaves_like 'returns 201 HTTP status'
+
+ it 'adds the current store to the newly created resource' do
+ new_menu = Spree::Menu.find_by(name: 'Ensure-MenuTest')
+ expect(new_menu.store).to eql(store)
+ end
+ end
+
+ context 'multi store resource empty array passed' do
+ let(:execute) { post '/api/v2/platform/payment_methods', params: payment_method_resource_params, headers: bearer_token }
+ let(:payment_method_resource_params) do
+ {
+ payment_method: {
+ name: 'Stripe-API-TEST',
+ store_ids: []
+ }
+ }
+ end
+
+ before { execute }
- it 'adds the current store to the newly created resource' do
- new_menu = Spree::Menu.find_by(name: 'Ensure-MenuTest')
- expect(new_menu.store).to eql(store)
+ it_behaves_like 'returns 201 HTTP status'
+
+ it 'adds the current store to the newly created resource' do
+ new_resource = Spree::PaymentMethod.find_by(name: 'Stripe-API-TEST')
+ expect(new_resource.stores).to match_array([store])
+ end
+ end
+
+ context 'multi store resource array of stores ids passed' do
+ let(:execute) { post '/api/v2/platform/payment_methods', params: payment_method_resource_params, headers: bearer_token }
+ let(:payment_method_resource_params) do
+ {
+ payment_method: {
+ name: 'Stripe-API-TEST-2',
+ store_ids: [store_three.id.to_s]
+ }
+ }
+ end
+
+ before { execute }
+
+ it_behaves_like 'returns 201 HTTP status'
+
+ it 'adds the current store and the stores in the array to the newly created resource' do
+ new_resource = Spree::PaymentMethod.find_by(name: 'Stripe-API-TEST-2')
+ expect(new_resource.stores).to match_array([store, store_three])
+ end
end
end
end
@@ -427,27 +474,58 @@ describe 'Platform API v2 Resources spec', type: :request do
end
context '#ensure_current_store' do
- let!(:product) { create(:product) }
- let(:execute_product) { put "/api/v2/platform/products/#{product.id}", params: product_params, headers: bearer_token }
- let(:product_params) do
- {
- product: {
- stores: []
- }
- }
- end
+ context 'multiple store resource' do
+ context 'when an empty array is passed to a resource that can belong to many stores' do
+ let!(:payment_method) { create(:payment_method, stores: [store, store_three, store_two]) }
+ let(:execute_payment_method) { patch "/api/v2/platform/payment_methods/#{payment_method.id}", params: payment_method_params, headers: bearer_token }
+ let(:payment_method_params) do
+ {
+ payment_method: {
+ store_ids: []
+ }
+ }
+ end
- before { execute_product }
+ before { execute_payment_method }
- it_behaves_like 'returns 200 HTTP status'
+ it_behaves_like 'returns 200 HTTP status'
+
+ it 'will not let you remove the current store from the resource' do
+ payment_method.reload
+ expect(payment_method.stores).to match_array([store])
+ expect(payment_method.stores.count).to eq(1)
+ end
+
+ it_behaves_like 'returns auth token errors'
+ it_behaves_like 'returns error when record does not exist'
+ end
- it 'will not let you remove the current store from a resource that accepts multiple stores' do
- expect(product.stores).to contain_exactly(store)
+ context 'when an array of store ids are passed to a resource that can belong to many stores' do
+ let!(:payment_method) { create(:payment_method, stores: [store]) }
+ let(:execute_payment_method) { patch "/api/v2/platform/payment_methods/#{payment_method.id}", params: payment_method_params, headers: bearer_token }
+ let(:payment_method_params) do
+ {
+ payment_method: {
+ store_ids: [store_three.id.to_s, store_two.id.to_s]
+ }
+ }
+ end
+
+ before { execute_payment_method }
+
+ it_behaves_like 'returns 200 HTTP status'
+
+ it 'will add the stores passed in' do
+ payment_method.reload
+ expect(payment_method.stores).to match_array([store, store_two, store_three])
+ expect(payment_method.stores.count).to eq(3)
+ end
+
+ it_behaves_like 'returns auth token errors'
+ it_behaves_like 'returns error when record does not exist'
+ end
end
end
-
- it_behaves_like 'returns auth token errors'
- it_behaves_like 'returns error when record does not exist'
end
context '#destroy' do
diff --git a/api/spec/serializers/spree/api/v2/platform/payment_method_serializer_spec.rb b/api/spec/serializers/spree/api/v2/platform/payment_method_serializer_spec.rb
index 4d74c6fac9..0cf48d5237 100644
--- a/api/spec/serializers/spree/api/v2/platform/payment_method_serializer_spec.rb
+++ b/api/spec/serializers/spree/api/v2/platform/payment_method_serializer_spec.rb
@@ -5,7 +5,46 @@ describe Spree::Api::V2::Platform::PaymentMethodSerializer do
subject { described_class.new(resource, params: serializer_params) }
- let(:resource) { create(:payment_method) }
+ let!(:store) { Spree::Store.default }
+ let(:resource) { create(:credit_card_payment_method) }
it { expect(subject.serializable_hash).to be_kind_of(Hash) }
-end
\ No newline at end of file
+
+ it do
+ expect(subject.serializable_hash).to eq(
+ {
+ data: {
+ id: resource.id.to_s,
+ type: :payment_method,
+ attributes: {
+ name: resource.name,
+ description: resource.description,
+ auto_capture: nil,
+ active: resource.active,
+ type: resource.type,
+ position: resource.position,
+ display_on: resource.display_on,
+ deleted_at: resource.deleted_at,
+ created_at: resource.created_at,
+ updated_at: resource.updated_at,
+ preferences: {
+ dummy_key: 'PUBLICKEY123',
+ server: 'test',
+ test_mode: true
+ }
+ },
+ relationships: {
+ stores: {
+ data: [
+ {
+ id: store.id.to_s,
+ type: :store
+ }
+ ]
+ }
+ }
+ }
+ }
+ )
+ end
+end
diff --git a/api/spec/swagger_helper.rb b/api/spec/swagger_helper.rb
index 937905553b..2832a21fb7 100644
--- a/api/spec/swagger_helper.rb
+++ b/api/spec/swagger_helper.rb
@@ -55,6 +55,7 @@ RSpec.configure do |config|
{ name: 'Option Values' },
{ name: 'Orders' },
{ name: 'Payments' },
+ { name: 'Payment Methods' },
{ name: 'Promotion Categories' },
{ name: 'Shipments' },
{ name: 'Shipping Categories' },
@@ -628,6 +629,78 @@ RSpec.configure do |config|
'x-internal': true
},
+ # Payment Method
+ create_payment_method_params: {
+ type: :object,
+ properties: {
+ payment_method: {
+ type: :object,
+ required: %w[name],
+ properties: {
+ name: { type: :string, example: 'Test Payment Method' },
+ active: { type: :boolean },
+ auto_capture: { type: :boolean },
+ description: { type: :string, example: 'This is a test payment method' },
+ type: { type: :string, example: 'Spree::Gateway::Bogus', enum: ['Spree::Gateway::Bogus', 'Spree::PaymentMethod::Check'] },
+ display_on: { type: :string, example: 'both', enum: ['both', 'back_end', 'front_end'] },
+ store_ids: {
+ type: :array,
+ items: {
+ allOf: [
+ { type: :string, example: '2' }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[payment_method],
+ 'x-internal': true
+ },
+ update_payment_method_params: {
+ type: :object,
+ properties: {
+ payment_method: {
+ type: :object,
+ properties: {
+ name: { type: :string, example: 'Test Payment Method' },
+ active: { type: :boolean },
+ auto_capture: { type: :boolean },
+ description: { type: :string, example: 'This is a test payment method' },
+ type: { type: :string, example: 'Spree::Gateway::Bogus', enum: ['Spree::Gateway::Bogus', 'Spree::PaymentMethod::Check'] },
+ display_on: { type: :string, example: 'both', enum: ['both', 'back_end', 'front_end'] },
+ store_ids: {
+ type: :array,
+ items: {
+ allOf: [
+ { type: :string, example: '2' }
+ ]
+ }
+ }
+ }
+ }
+ },
+ required: %w[payment_method],
+ 'x-internal': true,
+ title: 'Update Payment Method'
+ },
+ update_payment_method_params_bogus_gateway: {
+ type: :object,
+ properties: {
+ payment_method: {
+ type: :object,
+ properties: {
+ preferred_dummy_key: { type: :string, example: 'UPDATED-DUMMY-KEY-123' },
+ preferred_server: { type: :string, example: 'production' },
+ preferred_test_mode: { type: :boolean },
+ }
+ }
+ },
+ required: %w[payment_method],
+ 'x-internal': true,
+ title: 'Update Bogus Gateway'
+ },
+
# Product
create_product_params: {
type: :object,
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 200066dba9..627ccce66f 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -1178,6 +1178,7 @@ en:
meta_title: Meta Title
metadata: Metadata
mutable: Mutable
+ must_have_one_store: The resource must belong to a store.
min: 'Min'
minimal_amount: Minimal Amount
missing_return_authorization: ! 'Missing Return Authorization for %{item_name}.'