docs/v2/storefront/index.yaml in spree_api-3.7.14.1 vs docs/v2/storefront/index.yaml in spree_api-4.0.0.beta

- old
+ new

@@ -10,13 +10,21 @@ <a href="https://jsonapi.org/" target="_blank" rel="noopener">JSON API spec</a> which provides you with necessary endpoints to build amazing user intefaces either in JavaScript frameworks or native mobile libraries. </p> <p> - Please read our introduction to the API v2 [insert link here] + Please read our <a href="https://guides.spreecommerce.org/api/v2/"> + introduction to the API v2 + </a> </p> <p> + Download our + <a href="https://github.com/spree/spree-storefront-api-v2-js-sdk"> + official JavaScript & TypeScript SDK + </a> + </p> + <p> <a href="https://raw.githubusercontent.com/spree/spree/master/api/docs/v2/storefront/index.yaml" target="_blank" rel="noopener"> Import this documentation to Postman </a> </p> paths: @@ -152,12 +160,10 @@ $ref: '#/components/responses/404NotFound' parameters: - $ref: '#/components/parameters/OrderParam' - $ref: '#/components/parameters/CartIncludeParam' - $ref: '#/components/parameters/SparseFieldsParam' - security: - - orderToken: [] '/cart': post: description: >- <p>Creates new Cart and returns it attributes.</p> <br /> @@ -343,11 +349,11 @@ tags: - Cart operationId: 'Apply Coupon Code' responses: '200': - description: Cuopon code was applied successfully + description: Coupon code was applied successfully content: application/vnd.api+json: schema: $ref: '#/components/schemas/Cart' '422': @@ -373,19 +379,19 @@ type: string example: 'DISCOUNT10' '/cart/remove_coupon_code/{coupon_code}': delete: - description: Removes a coupon code from the Cart + description: Removes a coupon code from the Cart. If no `coupon_code` parameter is passed will remove all applied coupon codes. tags: - Cart operationId: 'Remove Coupon Code' parameters: - name: coupon_code in: path - required: true - description: Coupon code applied to Order + required: false + description: Selected Coupon code for removal schema: type: string example: 'DISCOUNT10' - $ref: '#/components/parameters/CartIncludeParam' - $ref: '#/components/parameters/SparseFieldsParam' @@ -448,32 +454,28 @@ <br /> <pre> order: { email: 'john@snow.org', bill_address_attributes: { - { - firstname: 'John', - lastname: 'Snow', - address1: '7735 Old Georgetown Road', - city: 'Bethesda', - phone: '3014445002', - zipcode: '20814', - state_name: 'MD', - country_iso: 'US' - } + firstname: 'John', + lastname: 'Snow', + address1: '7735 Old Georgetown Road', + city: 'Bethesda', + phone: '3014445002', + zipcode: '20814', + state_name: 'MD', + country_iso: 'US' }, ship_address_attributes: { - { - firstname: 'John', - lastname: 'Snow', - address1: '7735 Old Georgetown Road', - city: 'Bethesda', - phone: '3014445002', - zipcode: '20814', - state_name: 'MD', - country_iso: 'US' - } + firstname: 'John', + lastname: 'Snow', + address1: '7735 Old Georgetown Road', + city: 'Bethesda', + phone: '3014445002', + zipcode: '20814', + state_name: 'MD', + country_iso: 'US' } } </pre> <h3>2. Fetch Shipping Rates</h3> <pre> @@ -491,13 +493,16 @@ <h3>3. Select shipping method(s)</h3> <pre>PATCH /checkout</pre> <br /> <pre> order: { - shipments_attributes: { - '0' => { selected_shipping_rate_id: 1, id: 1} - } + shipments_attributes: [ + { + id: 1, + selected_shipping_rate_id: 1 + } + ] } </pre> <br /> <p> <code>selected_shipping_rate_id</code> is the ID of a Shipping Rate. @@ -515,10 +520,10 @@ payment_method_id: 1 } ] }, payment_source: { - '1' => { + 1: { number: '4111111111111111', month: '01', year: '2022', verification_value: '123', name: 'John Doe'