docs/v2/storefront/index.yaml in spree_api-4.4.1 vs docs/v2/storefront/index.yaml in spree_api-4.5.0

- old
+ new

@@ -55,20 +55,26 @@ type: object properties: email: type: string example: john@snow.org + first_name: + type: string + example: John + last_name: + type: string + example: Snow password: type: string example: spree123 password_confirmation: type: string example: spree123 public_metadata: type: object example: - user_segment: 'supplier' + user_segment: supplier description: The public metadata for this User private_metadata: type: object example: has_abandoned_cart: false @@ -96,10 +102,16 @@ type: object properties: email: type: string example: john@snow.org + first_name: + type: string + example: John + last_name: + type: string + example: Snow bill_address_id: type: string example: '1' ship_address_id: type: string @@ -385,14 +397,14 @@ private_metadata: had_same_cart_items: true properties: public_metadata: type: object - description: 'The public metadata for the cart.' + description: The public metadata for the cart. private_metadata: type: object - description: 'The private metadata for the cart.' + description: The private metadata for the cart. summary: Create a Cart delete: description: |- Deletes a specified cart. @@ -423,10 +435,11 @@ - orderToken: [] - bearerAuth: [] parameters: - $ref: '#/components/parameters/CartIncludeParam' - $ref: '#/components/parameters/SparseFieldsCart' + - $ref: '#/components/parameters/CartCurrencyParam' summary: Retrieve a Cart /api/v2/storefront/cart/add_item: post: description: Adds a variant to the current cart by creating a line item. Each line item represents a specified variant and the desired quantity. operationId: add-item @@ -459,14 +472,14 @@ type: string quantity: type: integer public_metadata: type: object - description: 'The public metadata for the added item.' + description: The public metadata for the added item. private_metadata: type: object - description: 'The private metadata for the added item.' + description: The private metadata for the added item. options: type: object description: 'Additional custom options. Activate these by adding: `Spree::PermittedAttributes.line_item_attributes << :foo` in `config/initializers/spree.rb`' description: |- Additional parameters can be passed in the **options** hash. Each custom parameter must be registered in `config/initializers/spree.rb`, eg. @@ -934,11 +947,11 @@ shipping_method_id: type: string description: ID of the selected Shipping Method shipment_id: type: string - description: 'ID of the selected Shipment. If not supplied it will try to set selected shipping method for all shipments' + description: ID of the selected Shipment. If not supplied it will try to set selected shipping method for all shipments required: - shipping_method_id examples: Set shippng method for all shipments: value: @@ -1247,10 +1260,27 @@ '200': $ref: '#/components/responses/Product' '404': $ref: '#/components/responses/404NotFound' summary: Retrieve a Product + /api/v2/storefront/store: + get: + summary: Return the current Store + description: 'Returns the current Store. [Read more about Stores](https://dev-docs.spreecommerce.org/internals/stores)' + tags: + - Stores + operationId: show-current-store + parameters: + - $ref: '#/components/parameters/StoreIncludeParam' + - $ref: '#/components/parameters/SparseFieldsStore' + responses: + '200': + $ref: '#/components/responses/Store' + '403': + $ref: '#/components/responses/403Forbidden' + security: + - bearerAuth: [] /api/v2/storefront/taxons: get: description: 'Returns a list of Taxons. [Read more about Taxons](https://dev-docs.spreecommerce.org/internals/products#taxons-and-taxonomies)' tags: - Taxons @@ -2421,18 +2451,18 @@ description: Card holder name default: type: boolean example: true description: Defines if this is the default CC for a signed in user - relationships: - type: object - properties: - payment_method: - type: object - properties: - data: - $ref: '#/components/schemas/Relation' + relationships: + type: object + properties: + payment_method: + type: object + properties: + data: + $ref: '#/components/schemas/Relation' required: - id - type - attributes - relationships @@ -2636,11 +2666,11 @@ example: $0.00 public_metadata: type: object example: recommended_by_us: true - description: 'The public metadata for the Line Item.' + description: The public metadata for the Line Item. relationships: type: object properties: variant: type: object @@ -3053,10 +3083,17 @@ - $ref: '#/components/schemas/OptionType' - $ref: '#/components/schemas/ProductProperty' - $ref: '#/components/schemas/Variant' - $ref: '#/components/schemas/Image' - $ref: '#/components/schemas/Taxon' + StoreIncludes: + x-internal: true + title: Store Includes + anyOf: + - $ref: '#/components/schemas/Country' + - $ref: '#/components/schemas/Menu' + - $ref: '#/components/schemas/CmsPage' ProductProperty: title: Product Property type: object properties: id: @@ -3143,10 +3180,126 @@ name: type: string example: New York description: State name x-internal: true + Store: + type: object + description: Stores are the center of the Spree ecosystem. Each Spree installation can have multiple Stores. Each Store operates on a different domain or subdomain. + title: Store + x-internal: true + properties: + id: + type: string + example: '1' + type: + type: string + default: store + attributes: + type: object + properties: + name: + type: string + example: Spree Demo + description: Name of the Store + url: + type: string + example: spree-demo.com + description: Store Url + meta_description: + type: string + example: Luxury clothing store for men and women. + description: Meta description for SEO + meta_keywords: + type: string + example: luxury clothing men women + description: Meta keywords for SEO + seo_title: + type: string + example: Buy Luxury Clothing With Ease + description: The title for SEO + default_currency: + type: string + example: EUR + description: Default currency of the store + default: + type: boolean + example: true + description: Indicates if the Store is the default one + supported_currencies: + type: string + example: 'EUR,USD,GBP' + description: All currencies supported by store + facebook: + type: string + example: 'https://www.facebook.com/mystorename' + description: URL of Facebook page + twitter: + type: string + example: 'https://twitter.com/mystorename' + description: URL of Twitter page + instagram: + type: string + example: 'https://instagram.com/mystorename' + description: URL of Instagram page + default_locale: + type: string + example: en + description: Default locale of the Store + supported_locales: + type: string + example: 'en,es,de' + description: Supported locales of the Store + customer_support_email: + type: string + example: support@mystore.com + description: This email is visible to your Store visitors in the Footer section + description: + type: string + example: Mystore has been selling luxury clothing for more than 20 years and has 15 stores currently. + description: Description of the Store which is visible in the Footer + address: + type: string + example: '813 Howard Street, Oswego NY 13126, USA' + description: Address of the Store which is visible in the Footer + contact_phone: + type: string + example: '+123456789' + description: Contact phone number of the Store which is visible in the Footer + favicon_path: + type: string + example: /assets/favicon.ico + relationships: + type: object + properties: + menus: + type: object + description: Menus + properties: + data: + type: array + items: + $ref: '#/components/schemas/Relation' + cms_pages: + type: object + description: CMS Pages + properties: + data: + type: array + items: + $ref: '#/components/schemas/Relation' + default_country: + type: object + description: Default Country of the Store + properties: + data: + $ref: '#/components/schemas/Relation' + required: + - id + - type + - attributes + - relationships Shipment: type: object title: Shipment x-internal: true properties: @@ -3489,21 +3642,27 @@ type: object properties: email: type: string example: spree@example.com + first_name: + type: string + example: John + last_name: + type: string + example: Doe store_credits: type: number example: 150.75 completed_orders: type: number example: 3 description: Number of placed Orders by this User public_metadata: type: object example: - user_segment: 'supplier' + user_segment: supplier description: The public metadata for this User relationships: type: object properties: default_billing_address: @@ -3818,10 +3977,17 @@ in: query schema: type: string description: 'Specify the related resources you would like to receive in the response body. [More Information](https://jsonapi.org/format/#fetching-includes).' example: 'line_items,variants,variants.images,billing_address,shipping_address,user,payments,shipments,promotions' + CartCurrencyParam: + name: currency + in: query + schema: + type: string + description: 'Must be specified when is different than current store default currency.' + example: 'USD' ProductIncludeParam: name: include in: query schema: type: string @@ -3832,10 +3998,24 @@ default_variant,variants,option_types,product_properties,taxons,images,primary_variant ``` [More information](https://jsonapi.org/format/#fetching-includes) example: 'default_variant,variants,option_types,product_properties,taxons,images,primary_variant' + StoreIncludeParam: + name: include + in: query + schema: + type: string + description: |- + Specify what related resources (relationships) you would like to receive in the response body. Eg. + + ``` + default_country,menus,cms_pages + ``` + + [More information](https://jsonapi.org/format/#fetching-includes) + example: 'default_country,menus,cms_pages' ProductImageTransformationSizeParam: in: query name: 'image_transformation[size]' schema: type: string @@ -3973,10 +4153,17 @@ in: query description: 'Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets).' schema: type: string example: 'price,description,name' + SparseFieldsStore: + name: 'fields[store]' + in: query + description: 'Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets).' + schema: + type: string + example: 'name,url,supported_locales' SparseFieldsShippingRate: in: query name: 'fields[shipping_rate]' example: 'name,selected,final_price,display_final_price,cost,display_cost,tax_amount,display_tax_amount,shipping_method_id' description: 'Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets).' @@ -4918,14 +5105,16 @@ data: id: '1' type: user attributes: email: spree@example.com + first_name: John + last_name: Snow store_credits: 0 completed_orders: 0 public_metadata: - user_segment: 'supplier' + user_segment: supplier relationships: default_billing_address: data: id: '2' type: address @@ -6041,15 +6230,15 @@ last_digits: '4111' month: 12 year: 2026 name: John Doe default: true - relationships: - payment_method: - data: - id: '1' - type: payment_method + relationships: + payment_method: + data: + id: '1' + type: payment_method included: - id: '1' type: payment_method attributes: type: 'Spree::Gateway::StripeGateway' @@ -6090,29 +6279,29 @@ last_digits: '1111' month: 12 year: 2026 name: John Doe default: true - relationships: - payment_method: - data: - id: string - type: string + relationships: + payment_method: + data: + id: string + type: string - id: '2' type: credit_card attributes: cc_type: mastercard last_digits: '6695' month: 12 year: 2030 name: John Doe default: false - relationships: - payment_method: - data: - id: string - type: string + relationships: + payment_method: + data: + id: string + type: string included: - id: '1' type: payment_method attributes: type: 'Spree::Gateway::StripeGateway' @@ -8360,10 +8549,144 @@ self: 'http://localhost:3000/api/v2/storefront/products' next: 'http://localhost:3000/api/v2/storefront/products?page=2' prev: 'http://localhost:3000/api/v2/storefront/products?page=1' last: 'http://localhost:3000/api/v2/storefront/products?page=5' first: 'http://localhost:3000/api/v2/storefront/products?page=1' + Store: + description: 200 Success - Returns the `store` object. + content: + application/vnd.api+json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/Store' + included: + type: array + items: + $ref: '#/components/schemas/StoreIncludes' + required: + - data + examples: + Store without includes: + value: + data: + id: '3' + type: store + attributes: + name: Mystore + url: spree-demo.com + meta_description: Luxury clothing store for men and women. + meta_keywords: luxury clothing men women + seo_title: '' + default_currency: USD + default: true + supported_currencies: 'EUR,GBP,USD' + facebook: 'https://www.facebook.com/mystorename' + twitter: 'https://twitter.com/mystorename' + instagram: 'https://instagram.com/mystorename' + default_locale: en + customer_support_email: support@mystore.com + description: Mystore has been selling luxury clothing for more than 20 years and has 15 stores currently. + address: '813 Howard Street, Oswego NY 13126, USA' + contact_phone: '+123456789' + supported_locales: en + favicon_path: /assets/favicon.ico + relationships: + menus: + data: + - id: '10' + type: menu + - id: '11' + type: menu + cms_pages: + data: + - id: '5' + type: cms_page + default_country: + data: + id: '2' + type: country + Store with Includes: + value: + data: + id: '3' + type: store + attributes: + name: Mystore + url: spree-demo.com + meta_description: Luxury clothing store for men and women. + meta_keywords: luxury clothing men women + seo_title: '' + default_currency: USD + default: true + supported_currencies: 'EUR,GBP,USD' + facebook: 'https://www.facebook.com/mystorename' + twitter: 'https://twitter.com/mystorename' + instagram: 'https://instagram.com/mystorename' + default_locale: en + customer_support_email: support@mystore.com + description: Mystore has been selling luxury clothing for more than 20 years and has 15 stores currently. + address: '813 Howard Street, Oswego NY 13126, USA' + contact_phone: '+123456789' + supported_locales: en + favicon_path: /assets/favicon.ico + relationships: + menus: + data: + - id: '10' + type: menu + - id: '11' + type: menu + cms_pages: + data: + - id: '5' + type: cms_page + default_country: + data: + id: '2' + type: country + included: + - id: '2' + type: country + attributes: + iso: US + iso3: USA + iso_name: UNITED STATES + name: United States + states_required: true + zipcode_required: true + default: true + relationships: + checkout_zone_applicable_states: + data: [] + - id: '10' + type: cms_page + attributes: + title: Returns Policy + content: null + locale: en + meta_description: '' + meta_title: '' + slug: returns-policy + type: 'Spree::Cms::Pages::StandardPage' + relationships: + cms_sections: + data: [] + - id: '12' + type: menu + attributes: + name: Company + location: header + locale: en + relationships: + menu_items: + data: + - id: '1' + type: menu_item + - id: '2' + type: menu_item Taxon: description: 200 Success - Returns the `taxon` object. content: application/vnd.api+json: schema: @@ -14893,11 +15216,11 @@ next: 'http://localhost:3000/api/v2/storefront/countries?page=1&per_page=240' prev: 'http://localhost:3000/api/v2/storefront/countries?page=1&per_page=240' last: 'http://localhost:3000/api/v2/storefront/countries?page=1&per_page=240' first: 'http://localhost:3000/api/v2/storefront/countries?page=1&per_page=240' Shipment: - description: '200 Success - Returns an array containing sevral `shipment` objects, along with the included array containing all available `shipping_rate` and `stock_location` objects. ' + description: '200 Success - Returns an array containing several `shipment` objects, along with the included array containing all available `shipping_rate` and `stock_location` objects. ' content: application/vnd.api+json: schema: type: object properties: @@ -16173,8 +16496,9 @@ - name: Countries - name: Digital Downloads - name: Menus - name: Order Status - name: Products + - name: Stores - name: Taxons - name: Wishlists - name: Wishlists / Wished Items