docs: update api-reference project for v2 (#7307)

* remove everything v1 and make v2 default

* move main v2 rewrites to book

* move rewrites to book + other fixes
This commit is contained in:
Shahed Nasser
2024-05-16 09:02:35 +02:00
committed by GitHub
parent 9b1998b9b2
commit 22f30f54fd
2148 changed files with 8965 additions and 140283 deletions
@@ -1,121 +0,0 @@
get:
operationId: GetAuth
summary: Get Current Customer
description: Retrieve the currently logged in Customer's details.
x-authenticated: true
x-codegen:
method: getSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_auth/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_auth/get.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreAuthRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostAuth
summary: Customer Login
description: >-
Log a customer in and includes the Cookie session in the response header.
The cookie session can be used in subsequent requests to authenticate the
customer. When using Medusa's JS or Medusa React clients, the cookie is
automatically attached to subsequent requests.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostAuthReq.yaml
x-codegen:
method: authenticate
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_auth/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_auth/post.sh
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreAuthRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/incorrect_credentials.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
delete:
operationId: DeleteAuth
summary: Customer Log out
description: Delete the current session for the logged in customer.
x-authenticated: true
x-codegen:
method: deleteSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_auth/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_auth/delete.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Auth
responses:
'200':
description: OK
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,44 +0,0 @@
post:
operationId: PostToken
summary: Customer Login (JWT)
x-authenticated: false
description: >-
After a successful login, a JWT token is returned, which can be used to send
authenticated requests.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostAuthReq.yaml
x-codegen:
method: getToken
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_auth_token/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_auth_token/post.sh
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreBearerAuthRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/incorrect_credentials.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,42 +0,0 @@
get:
operationId: GetAuthEmail
summary: Check if Email Exists
description: Check if there's a customer already registered with the provided email.
parameters:
- in: path
name: email
schema:
type: string
format: email
required: true
description: The email to check.
x-codegen:
method: exists
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_auth_{email}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_auth_{email}/get.sh
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreGetAuthEmailRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,33 +1,10 @@
post:
operationId: PostCart
summary: Create a Cart
description: >
Create a Cart. Although optional, specifying the cart's region and sales
channel can affect the cart's pricing and
the products that can be added to the cart respectively. So, make sure to
set those early on and change them if necessary, such as when the customer
changes their region.
If a customer is logged in, make sure to pass its ID or email within the
cart's details so that the cart is attached to the customer.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartReq.yaml
x-codegen:
method: create
operationId: PostCarts
summary: Create Cart
description: Create a cart.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts/post.tsx
- lang: Shell
label: cURL
source:
@@ -35,14 +12,10 @@ post:
tags:
- Carts
responses:
'200':
description: Successfully created a new Cart
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -51,3 +24,7 @@ post:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,25 +1,18 @@
get:
operationId: GetCartsCart
operationId: GetCartsId
summary: Get a Cart
description: Retrieve a Cart's details. This includes recalculating its totals.
description: >-
Retrieve a cart by its ID. You can expand the cart's relations or select the
fields that should be returned.
x-authenticated: false
parameters:
- in: path
name: id
- name: id
in: path
description: The cart's ID.
required: true
description: The ID of the Cart.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}/get.tsx
- lang: Shell
label: cURL
source:
@@ -27,14 +20,10 @@ get:
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -43,36 +32,23 @@ get:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostCartsCart
summary: Update a Cart
description: >-
Update a Cart's details. If the cart has payment sessions and the region was
not changed, the payment sessions are updated. The cart's totals are also
recalculated.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartReq.yaml
x-codegen:
method: update
schema: {}
post:
operationId: PostCartsId
summary: Update a Cart
description: Update a cart's details.
x-authenticated: false
parameters:
- name: id
in: path
description: The cart's ID.
required: true
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}/post.tsx
- lang: Shell
label: cURL
source:
@@ -80,14 +56,10 @@ post:
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -96,3 +68,7 @@ post:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,69 +0,0 @@
post:
summary: Complete a Cart
operationId: PostCartsCartComplete
description: >
Complete a cart and place an order or create a swap, based on the cart's
type. This includes attempting to authorize the cart's payment.
If authorizing the payment requires more action, the cart will not be
completed and the order will not be placed or the swap will not be created.
An idempotency key will be generated if none is provided in the header
`Idempotency-Key` and added to
the response. If an error occurs during cart completion or the request is
interrupted for any reason, the cart completion can be retried by passing
the idempotency
key in the `Idempotency-Key` header.
externalDocs:
description: Cart completion overview
url: https://docs.medusajs.com/modules/carts-and-checkout/cart#cart-completion
parameters:
- in: path
name: id
required: true
description: The Cart ID.
schema:
type: string
x-codegen:
method: complete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_complete/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_complete/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_complete/post.sh
tags:
- Carts
responses:
'200':
description: >-
If the payment of the cart was successfully authorized, but requires
further action from the customer, the response body will contain the
cart with an updated payment session. Otherwise, if the payment was
authorized and the cart was successfully completed, the response body
will contain either the newly created order or swap, depending on what
the cart was created for.
content:
application/json:
schema:
$ref: ../components/schemas/StoreCompleteCartRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,50 +0,0 @@
delete:
operationId: DeleteCartsCartDiscountsDiscount
summary: Remove Discount
description: >-
Remove a Discount from a Cart. This only removes the application of the
discount, and not completely deletes it. The totals will be re-calculated
and the payment sessions will be refreshed after the removal.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: code
required: true
description: The unique discount code.
schema:
type: string
x-codegen:
method: deleteDiscount
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_discounts_{code}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_discounts_{code}/delete.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,30 +1,16 @@
post:
operationId: PostCartsCartLineItems
summary: Add a Line Item
description: Generates a Line Item with a given Product Variant and adds it to the Cart
operationId: PostCartsIdLineItems
summary: Add Line Items to Cart
description: Add a list of line items to a cart.
x-authenticated: false
parameters:
- in: path
name: id
- name: id
in: path
description: The cart's ID.
required: true
description: The id of the Cart to add the Line Item to.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartLineItemsReq.yaml
x-codegen:
method: createLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_line-items/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_line-items/post.tsx
- lang: Shell
label: cURL
source:
@@ -32,14 +18,10 @@ post:
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -48,3 +30,7 @@ post:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,37 +1,22 @@
post:
operationId: PostCartsCartLineItemsItem
summary: Update a Line Item
description: Update a line item's quantity.
operationId: PostCartsIdLineItemsLine_id
summary: Add Line Items to Cart
description: Add a list of line items to a cart.
x-authenticated: false
parameters:
- in: path
name: id
- name: id
in: path
description: The cart's ID.
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: line_id
- name: line_id
in: path
description: The cart's line id.
required: true
description: The ID of the Line Item.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartLineItemsItemReq.yaml
x-codegen:
method: updateLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_line-items_{line_id}/post.tsx
- lang: Shell
label: cURL
source:
@@ -39,14 +24,10 @@ post:
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -55,37 +36,31 @@ post:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
delete:
operationId: DeleteCartsCartLineItemsItem
summary: Delete a Line Item
operationId: DeleteCartsIdLineItemsLine_id
summary: Remove Line Items from Cart
description: >-
Delete a Line Item from a Cart. The payment sessions will be updated and the
totals will be recalculated.
Remove a list of line items from a cart. This doesn't delete the Line Item,
only the association between the Line Item and the cart.
x-authenticated: false
parameters:
- in: path
name: id
- name: id
in: path
description: The cart's ID.
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: line_id
- name: line_id
in: path
description: The cart's line id.
required: true
description: The ID of the Line Item.
schema:
type: string
x-codegen:
method: deleteLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_line-items_{line_id}/delete.tsx
- lang: Shell
label: cURL
source:
@@ -93,14 +68,10 @@ delete:
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -109,3 +80,7 @@ delete:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -0,0 +1,36 @@
post:
operationId: PostCartsIdPaymentCollections
summary: Add Payment Collections to Cart
description: Add a list of payment collections to a cart.
x-authenticated: false
parameters:
- name: id
in: path
description: The cart's ID.
required: true
schema:
type: string
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_payment-collections/post.sh
tags:
- Carts
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,53 +0,0 @@
post:
operationId: PostCartsCartPaymentSession
summary: Select a Payment Session
description: >-
Select the Payment Session that will be used to complete the cart. This is
typically used when the customer chooses their preferred payment method
during checkout. The totals of the cart will be recalculated.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartPaymentSessionReq.yaml
x-codegen:
method: setPaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_payment-session/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_payment-session/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_payment-session/post.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,49 +0,0 @@
post:
operationId: PostCartsCartPaymentSessions
summary: Create Payment Sessions
description: >-
Create Payment Sessions for each of the available Payment Providers in the
Cart's Region. If there's only one payment session created, it will be
selected by default. The creation of the payment session uses the payment
provider and may require sending requests to third-party services.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
x-codegen:
method: createPaymentSessions
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_payment-sessions/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_payment-sessions/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_payment-sessions/post.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,120 +0,0 @@
post:
operationId: PostCartsCartPaymentSessionUpdate
summary: Update a Payment Session
description: >-
Update a Payment Session with additional data. This can be useful depending
on the payment provider used. All payment sessions are updated and cart
totals are recalculated afterwards.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: provider_id
required: true
description: The ID of the payment provider.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartPaymentSessionUpdateReq.yaml
x-codegen:
method: updatePaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_payment-sessions_{provider_id}/post.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/post.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
delete:
operationId: DeleteCartsCartPaymentSessionsSession
summary: Delete a Payment Session
description: >-
Delete a Payment Session in a Cart. May be useful if a payment has failed.
The totals will be recalculated.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: provider_id
required: true
description: >-
The ID of the Payment Provider used to create the Payment Session to be
deleted.
schema:
type: string
x-codegen:
method: deletePaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/delete.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_payment-sessions_{provider_id}/delete.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/delete.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,58 +0,0 @@
post:
operationId: PostCartsCartPaymentSessionsSession
summary: Refresh a Payment Session
description: >-
Refresh a Payment Session to ensure that it is in sync with the Cart. This
is usually not necessary, but is provided for edge cases.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: provider_id
required: true
description: >-
The ID of the Payment Provider that created the Payment Session to be
refreshed.
schema:
type: string
x-codegen:
method: refreshPaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -0,0 +1,74 @@
post:
operationId: PostCartsIdPromotions
summary: Add Promotions to Cart
description: Add a list of promotions to a cart.
x-authenticated: false
parameters:
- name: id
in: path
description: The cart's ID.
required: true
schema:
type: string
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_promotions/post.sh
tags:
- Carts
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
delete:
operationId: DeleteCartsIdPromotions
summary: Remove Promotions from Cart
description: >-
Remove a list of promotions from a cart. This doesn't delete the Promotion,
only the association between the Promotion and the cart.
x-authenticated: false
parameters:
- name: id
in: path
description: The cart's ID.
required: true
schema:
type: string
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_promotions/delete.sh
tags:
- Carts
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,52 +0,0 @@
post:
operationId: PostCartsCartShippingMethod
summary: Add Shipping Method
description: >-
Add a Shipping Method to the Cart. The validation of the `data` field is
handled by the fulfillment provider of the chosen shipping option.
parameters:
- in: path
name: id
required: true
description: The cart ID.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartShippingMethodReq.yaml
x-codegen:
method: addShippingMethod
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_shipping-methods/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_shipping-methods/post.sh
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,23 +1,20 @@
post:
operationId: PostCartsCartTaxes
summary: Calculate Cart Taxes
description: >-
Calculate the taxes for a cart. This is useful if the `automatic_taxes`
field of the cart's region is set to `false`. If the cart's region uses a
tax provider other than Medusa's system provider, this may lead to sending
requests to third-party services.
externalDocs:
description: How to calculate taxes manually during checkout
url: https://docs.medusajs.com/modules/taxes/storefront/manual-calculation
operationId: PostCartsIdTaxes
summary: Add Taxes to Cart
description: Add a list of taxes to a cart.
x-authenticated: false
parameters:
- in: path
name: id
- name: id
in: path
description: The cart's ID.
required: true
description: The Cart ID.
schema:
type: string
x-codegen:
method: calculateTaxes
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartsCartTaxesReq.yaml
x-codeSamples:
- lang: Shell
label: cURL
@@ -26,14 +23,10 @@ post:
tags:
- Carts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -1,110 +0,0 @@
get:
operationId: GetCollections
summary: List Collections
description: >-
Retrieve a list of product collections. The product collections can be
filtered by fields such as `handle` or `created_at`. The product collections
can also be paginated.
parameters:
- in: query
name: offset
description: >-
The number of product collections to skip when retrieving the product
collections.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of product collections returned.
schema:
type: integer
default: 10
- in: query
name: handle
style: form
explode: false
description: Filter by handles
schema:
type: array
items:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: StoreGetCollectionsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_collections/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_collections/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_collections/get.sh
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCollectionsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,45 +0,0 @@
get:
operationId: GetCollectionsCollection
summary: Get a Collection
description: Retrieve a Product Collection's details.
parameters:
- in: path
name: id
required: true
description: The id of the Product Collection
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_collections_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_collections_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_collections_{id}/get.sh
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCollectionsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -0,0 +1,32 @@
get:
operationId: GetCurrencies
summary: List Currencies
description: >-
Retrieve a list of currencies. The currencies can be filtered by fields such
as `id`. The currencies can also be sorted or paginated.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_currencies/get.sh
tags:
- Currencies
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -0,0 +1,38 @@
get:
operationId: GetCurrenciesCode
summary: Get a Currency
description: >-
Retrieve a currency by its ID. You can expand the currency's relations or
select the fields that should be returned.
x-authenticated: false
parameters:
- name: code
in: path
description: The currency's code.
required: true
schema:
type: string
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_currencies_{code}/get.sh
tags:
- Currencies
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,28 +1,10 @@
post:
operationId: PostCustomers
summary: Create a Customer
description: >-
Register a new customer. This will also automatically authenticate the
customer and set their login session in the response Cookie header. The
cookie session can be used in subsequent requests to authenticate the
customer. When using Medusa's JS or Medusa React clients, the cookie is
automatically attached to subsequent requests.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCustomersReq.yaml
x-codegen:
method: create
summary: Create Customer
description: Create a customer.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers/post.tsx
- lang: Shell
label: cURL
source:
@@ -30,39 +12,19 @@ post:
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
description: A customer with the same email exists
content:
application/json:
schema:
type: object
properties:
code:
type: string
description: The error code
type:
type: string
description: The type of error
message:
type: string
description: Human-readable message with details about the error
example:
code: invalid_request_error
type: duplicate_error
message: >-
A customer with the given email already has an account. Log in
instead
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,35 +1,19 @@
get:
operationId: GetCustomersCustomer
summary: Get a Customer
description: Retrieve the logged-in Customer's details.
x-authenticated: true
x-codegen:
method: retrieve
operationId: GetCustomersMe
summary: List Customers
description: >-
Retrieve a list of customers. The customers can be filtered by fields such
as `id`. The customers can also be sorted or paginated.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers_me/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me/get.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
@@ -42,52 +26,7 @@ get:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostCustomersCustomer
summary: Update Customer
description: Update the logged-in customer's details.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCustomersCustomerReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers_me/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
schema: {}
@@ -1,36 +1,19 @@
post:
operationId: PostCustomersCustomerAddresses
summary: Add a Shipping Address
description: Add a Shipping Address to a Customer's saved addresses.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCustomersCustomerAddressesReq.yaml
x-codegen:
method: addAddress
get:
operationId: GetCustomersMeAddresses
summary: List Customers
description: >-
Retrieve a list of customers. The customers can be filtered by fields such
as `id`. The customers can also be sorted or paginated.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me_addresses/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me_addresses/post.sh
security:
- cookie_auth: []
- jwt_token: []
$ref: ../code_samples/Shell/store_customers_me_addresses/get.sh
tags:
- Customers
responses:
'200':
description: A successful response
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
@@ -43,3 +26,37 @@ post:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
post:
operationId: PostCustomersMeAddresses
summary: Create Customer
description: Create a customer.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me_addresses/post.sh
tags:
- Customers
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,46 +1,62 @@
post:
operationId: PostCustomersCustomerAddressesAddress
summary: Update a Shipping Address
description: Update the logged-in customer's saved Shipping Address's details.
x-authenticated: true
get:
operationId: GetCustomersMeAddressesAddress_id
summary: List Addresses
description: >-
Retrieve a list of addresses in a customer. The addresses can be filtered by
fields like FILTER FIELDS. The addresses can also be paginated.
x-authenticated: false
parameters:
- in: path
name: address_id
- name: address_id
in: path
description: The customer's address id.
required: true
description: The ID of the Address.
schema:
type: string
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me_addresses_{address_id}/get.sh
tags:
- Customers
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml
x-codegen:
method: updateAddress
schema: {}
post:
operationId: PostCustomersMeAddressesAddress_id
summary: Add Addresses to Customer
description: Add a list of addresses to a customer.
x-authenticated: false
parameters:
- name: address_id
in: path
description: The customer's address id.
required: true
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
@@ -53,43 +69,33 @@ post:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
delete:
operationId: DeleteCustomersCustomerAddressesAddress
summary: Delete an Address
description: Delete an Address from the Customer's saved addresses.
x-authenticated: true
operationId: DeleteCustomersMeAddressesAddress_id
summary: Remove Addresses from Customer
description: >-
Remove a list of addresses from a customer. This doesn't delete the Address,
only the association between the Address and the customer.
x-authenticated: false
parameters:
- in: path
name: address_id
- name: address_id
in: path
description: The customer's address id.
required: true
description: The id of the Address to remove.
schema:
type: string
x-codegen:
method: deleteAddress
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
@@ -102,3 +108,7 @@ delete:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,238 +0,0 @@
get:
operationId: GetCustomersCustomerOrders
summary: List Orders
description: >-
Retrieve a list of the logged-in Customer's Orders. The orders can be
filtered by fields such as `status` or `fulfillment_status`. The orders can
also be paginated.
x-authenticated: true
parameters:
- in: query
name: q
description: >-
term to search orders' display ID, email, shipping address's first name,
customer's first name, customer's last name, and customer's phone
number.
schema:
type: string
- in: query
name: id
description: Filter by ID.
schema:
type: string
- in: query
name: status
style: form
explode: false
description: Filter by status.
schema:
type: array
items:
type: string
enum:
- pending
- completed
- archived
- canceled
- requires_action
- in: query
name: fulfillment_status
style: form
explode: false
description: Fulfillment status to search for.
schema:
type: array
items:
type: string
enum:
- not_fulfilled
- partially_fulfilled
- fulfilled
- partially_shipped
- shipped
- partially_returned
- returned
- canceled
- requires_action
- in: query
name: payment_status
style: form
explode: false
description: Payment status to search for.
schema:
type: array
items:
type: string
enum:
- not_paid
- awaiting
- captured
- partially_refunded
- refunded
- canceled
- requires_action
- in: query
name: display_id
description: Filter by display ID.
schema:
type: string
- in: query
name: cart_id
description: Filter by cart ID.
schema:
type: string
- in: query
name: email
description: Filter by email.
schema:
type: string
- in: query
name: region_id
description: Filter by region ID.
schema:
type: string
- in: query
name: currency_code
style: form
explode: false
description: Filter by the 3 character ISO currency code of the order.
schema:
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
- in: query
name: tax_rate
description: Filter by tax rate.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: canceled_at
description: Filter by a cancelation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: limit
description: Limit the number of orders returned.
schema:
type: integer
default: 10
- in: query
name: offset
description: The number of orders to skip when retrieving the orders.
schema:
type: integer
default: 0
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
orders.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned orders.
schema:
type: string
x-codegen:
method: listOrders
queryParams: StoreGetCustomersCustomerOrdersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me_orders/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers_me_orders/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me_orders/get.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersListOrdersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,46 +0,0 @@
get:
operationId: GetCustomersCustomerPaymentMethods
summary: Get Saved Payment Methods
description: >-
Retrieve the logged-in customer's saved payment methods. This API Route only
works with payment providers created with the deprecated Payment Service
interface. The payment methods are saved using the Payment Service's
third-party service, and not on the Medusa backend. So, they're retrieved
from the third-party service.
x-authenticated: true
deprecated: true
x-codegen:
method: listPaymentMethods
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me_payment-methods/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me_payment-methods/get.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersListPaymentMethodsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,48 +0,0 @@
post:
operationId: PostCustomersResetPassword
summary: Reset Password
description: >-
Reset a Customer's password using a password token created by a previous
request to the Request Password Reset API Route. If the password token
expired, you must create a new one.
externalDocs:
description: How to reset password
url: >-
https://docs.medusajs.com/modules/customers/storefront/implement-customer-profiles#reset-password
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCustomersResetPasswordReq.yaml
x-codegen:
method: resetPassword
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_password-reset/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_password-reset/post.sh
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersResetPasswordRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,47 +0,0 @@
post:
operationId: PostCustomersCustomerPasswordToken
summary: Request Password Reset
description: >-
Create a reset password token to be used in a subsequent Reset Password API
Route. This emits the event `customer.password_reset`. If a notification
provider is installed in the Medusa backend and is configured to handle this
event, a notification to the customer, such as an email, may be sent with
reset instructions.
externalDocs:
description: How to reset password
url: >-
https://docs.medusajs.com/modules/customers/storefront/implement-customer-profiles#reset-password
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml
x-codegen:
method: generatePasswordToken
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_password-token/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_password-token/post.sh
tags:
- Customers
responses:
'204':
description: OK
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,45 +0,0 @@
get:
operationId: GetGiftCardsCode
summary: Get Gift Card by Code
description: Retrieve a Gift Card's details by its associated unique code.
parameters:
- in: path
name: code
required: true
description: The unique Gift Card code.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_gift-cards_{code}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_gift-cards_{code}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_gift-cards_{code}/get.sh
tags:
- Gift Cards
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreGiftCardsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,47 +0,0 @@
get:
operationId: GetOrderEditsOrderEdit
summary: Retrieve an Order Edit
description: Retrieve an Order Edit's details.
parameters:
- in: path
name: id
required: true
description: The ID of the OrderEdit.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_order-edits_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_order-edits_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_order-edits_{id}/get.sh
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreOrderEditsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,49 +0,0 @@
post:
operationId: PostOrderEditsOrderEditComplete
summary: Complete an Order Edit
description: >-
Complete an Order Edit and reflect its changes on the original order. Any
additional payment required must be authorized first using the Payment
Collection API Routes.
externalDocs:
description: How to handle order edits in a storefront
url: https://docs.medusajs.com/modules/orders/storefront/handle-order-edits
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit.
schema:
type: string
x-codegen:
method: complete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_order-edits_{id}_complete/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_order-edits_{id}_complete/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_order-edits_{id}_complete/post.sh
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreOrderEditsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,48 +0,0 @@
post:
operationId: PostOrderEditsOrderEditDecline
summary: Decline an Order Edit
description: Decline an Order Edit. The changes are not reflected on the original order.
parameters:
- in: path
name: id
required: true
description: The ID of the OrderEdit.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostOrderEditsOrderEditDecline.yaml
x-codegen:
method: decline
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_order-edits_{id}_decline/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_order-edits_{id}_decline/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_order-edits_{id}_decline/post.sh
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreOrderEditsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,78 +0,0 @@
get:
operationId: GetOrders
summary: Look Up an Order
description: >-
Look up an order using filters. If the filters don't narrow down the results
to a single order, a 404 response is returned with no orders.
parameters:
- in: query
name: display_id
required: true
description: Filter by ID.
schema:
type: number
- in: query
name: fields
description: Comma-separated fields that should be expanded in the returned order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: email
style: form
explode: false
description: Filter by email.
required: true
schema:
type: string
format: email
- in: query
name: shipping_address
style: form
explode: false
description: Filter by the shipping address's postal code.
schema:
type: object
properties:
postal_code:
type: string
description: The postal code of the shipping address
x-codegen:
method: lookupOrder
queryParams: StoreGetOrdersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders/get.sh
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreOrdersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,56 +0,0 @@
post:
operationId: PostOrdersCustomerOrderClaim
summary: Claim Order
description: >-
Allow the logged-in customer to claim ownership of one or more orders. This
generates a token that can be used later on to verify the claim using the
Verify Order Claim API Route. This also emits the event
`order-update-token.created`. So, if you have a notification provider
installed that handles this event and sends the customer a notification,
such as an email, the customer should receive instructions on how to
finalize their claim ownership.
externalDocs:
description: How to implement claim-order flow in a storefront
url: https://docs.medusajs.com/modules/orders/storefront/implement-claim-order
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml
x-codegen:
method: requestCustomerOrders
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_batch_customer_token/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_batch_customer_token/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders_batch_customer_token/post.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Orders
responses:
'200':
description: OK
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,47 +0,0 @@
get:
operationId: GetOrdersOrderCartId
summary: Get by Cart ID
description: >-
Retrieve an Order's details by the ID of the Cart that was used to create
the Order.
parameters:
- in: path
name: cart_id
required: true
description: The ID of Cart.
schema:
type: string
x-codegen:
method: retrieveByCartId
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_cart_{cart_id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_cart_{cart_id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders_cart_{cart_id}/get.sh
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreOrdersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,50 +0,0 @@
post:
operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept
summary: Verify Order Claim
description: >-
Verify the claim order token provided to the customer when they request
ownership of an order.
externalDocs:
description: How to implement claim-order flow in a storefront
url: https://docs.medusajs.com/modules/orders/storefront/implement-claim-order
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml
x-codegen:
method: confirmRequest
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_customer_confirm/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_customer_confirm/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders_customer_confirm/post.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Orders
responses:
'200':
description: OK
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,55 +0,0 @@
get:
operationId: GetOrdersOrder
summary: Get an Order
description: Retrieve an Order's details.
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be expanded in the returned order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be included in the returned order.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders_{id}/get.sh
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreOrdersRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,66 +0,0 @@
get:
operationId: GetPaymentCollectionsPaymentCollection
summary: Get a PaymentCollection
description: Retrieve a Payment Collection's details.
x-authenticated: false
parameters:
- in: path
name: id
required: true
description: The ID of the PaymentCollection.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be expanded in the returned payment
collection.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
payment collection.
schema:
type: string
x-codegen:
method: retrieve
queryParams: StoreGetPaymentCollectionsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_payment-collections_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_payment-collections_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_payment-collections_{id}/get.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -0,0 +1,39 @@
post:
operationId: PostPaymentCollectionsIdPaymentSessions
summary: Add Payment Sessions to Payment Collection
description: Add a list of payment sessions to a payment collection.
x-authenticated: false
parameters:
- name: id
in: path
description: The payment collection's ID.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/StorePostPaymentCollectionsPaymentSessionReq.yaml
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_payment-sessions/post.sh
tags:
- Payment Collections
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,57 +0,0 @@
post:
operationId: PostPaymentCollectionsSessions
summary: Create a Payment Session
description: Create a Payment Session for a payment provider in a Payment Collection.
x-authenticated: false
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionSessionsReq.yaml
x-codegen:
method: managePaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_payment-collections_{id}_sessions/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_payment-collections_{id}_sessions/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,63 +0,0 @@
post:
operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch
summary: Manage Payment Sessions
description: >-
Create, update, or delete a list of payment sessions of a Payment
Collections. If a payment session is not provided in the `sessions` array,
it's deleted.
x-authenticated: false
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml
x-codegen:
method: managePaymentSessionsBatch
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_batch/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_batch/post.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_batch/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,60 +0,0 @@
post:
operationId: PostPaymentCollectionsSessionsBatchAuthorize
summary: Authorize Payment Sessions
description: Authorize the Payment Sessions of a Payment Collection.
x-authenticated: false
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collections.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml
x-codegen:
method: authorizePaymentSessionsBatch
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_batch_authorize/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_batch_authorize/post.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_batch_authorize/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,60 +0,0 @@
post:
operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession
summary: Refresh a Payment Session
description: >-
Refresh a Payment Session's data to ensure that it is in sync with the
Payment Collection.
x-authenticated: false
parameters:
- in: path
name: id
required: true
description: The id of the PaymentCollection.
schema:
type: string
- in: path
name: session_id
required: true
description: The id of the Payment Session to be refreshed.
schema:
type: string
x-codegen:
method: refreshPaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_{session_id}/post.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionsSessionRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,60 +0,0 @@
post:
operationId: PostPaymentCollectionsSessionsSessionAuthorize
summary: Authorize Payment Session
description: Authorize a Payment Session of a Payment Collection.
x-authenticated: false
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
- in: path
name: session_id
required: true
description: The ID of the Payment Session.
schema:
type: string
x-codegen:
method: authorizePaymentSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}_authorize/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_{session_id}_authorize/post.tsx
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}_authorize/post.sh
security:
- cookie_auth: []
- jwt_token: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePaymentCollectionsSessionRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,105 +0,0 @@
get:
operationId: GetProductCategories
summary: List Product Categories
description: >-
Retrieve a list of product categories. The product categories can be
filtered by fields such as `handle` or `q`. The product categories can also
be paginated. This API Route can also be used to retrieve a product category
by its handle.
x-featureFlag: product_categories
externalDocs:
description: How to retrieve a product category by its handle
url: >-
https://docs.medusajs.com/modules/products/storefront/use-categories#get-a-category-by-its-handle
parameters:
- in: query
name: q
description: term used to search product category's names and handles.
schema:
type: string
- in: query
name: handle
description: Filter by handle.
schema:
type: string
- in: query
name: parent_category_id
description: >-
Filter by the ID of a parent category. Only children of the provided
parent category are retrieved.
schema:
type: string
- in: query
name: include_descendants_tree
description: Whether all nested categories inside a category should be retrieved.
schema:
type: boolean
- in: query
name: offset
description: >-
The number of product categories to skip when retrieving the product
categories.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of product categories returned.
schema:
type: integer
default: 100
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product categories.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
categories.
schema:
type: string
x-codegen:
method: list
queryParams: StoreGetProductCategoriesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-categories/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-categories/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-categories/get.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreGetProductCategoriesRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,67 +0,0 @@
get:
operationId: GetProductCategoriesCategory
summary: Get a Product Category
description: Retrieve a Product Category's details.
x-featureFlag: product_categories
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be expanded in the returned product
category.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product category.
schema:
type: string
x-codegen:
method: retrieve
queryParams: StoreGetProductCategoriesCategoryParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-categories_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-categories_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-categories_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreGetProductCategoriesCategoryRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,136 +0,0 @@
get:
operationId: GetProductTags
summary: List Product Tags
description: >-
Retrieve a list of product tags. The product tags can be filtered by fields
such as `id` or `q`. The product tags can also be sorted or paginated.
x-authenticated: true
x-codegen:
method: list
queryParams: StoreGetProductTagsParams
parameters:
- in: query
name: limit
description: Limit the number of product tags returned.
schema:
type: integer
default: 20
- in: query
name: offset
description: The number of product tags to skip when retrieving the product tags.
schema:
type: integer
default: 0
- in: query
name: order
description: A product-tag field to sort-order the retrieved product tags by.
schema:
type: string
- in: query
name: discount_condition_id
description: >-
Filter by the ID of a discount condition. When provided, only tags that
the discount condition applies for will be retrieved.
schema:
type: string
- in: query
name: value
style: form
explode: false
description: Filter by tag values.
schema:
type: array
items:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by IDs.
schema:
type: array
items:
type: string
- in: query
name: q
description: term to search product tag's value.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-tags/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-tags/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-tags/get.sh
tags:
- Product Tags
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreProductTagsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,141 +0,0 @@
get:
operationId: GetProductTypes
summary: List Product Types
description: >-
Retrieve a list of product types. The product types can be filtered by
fields such as `value` or `q`. The product types can also be sorted or
paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: Limit the number of product types returned.
schema:
type: integer
default: 20
- in: query
name: offset
description: The number of product types to skip when retrieving the product types.
schema:
type: integer
default: 0
- in: query
name: order
description: A product-type field to sort-order the retrieved product types by.
schema:
type: string
- in: query
name: discount_condition_id
description: >-
Filter by the ID of a discount condition. When provided, only types that
the discount condition applies for will be retrieved.
schema:
type: string
- in: query
name: value
style: form
explode: false
description: Filter by type values.
schema:
type: array
items:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by IDs.
schema:
type: array
items:
type: string
- in: query
name: q
description: term to search product type's value.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: StoreGetProductTypesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-types/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-types/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-types/get.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Product Types
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreProductTypesListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,266 +0,0 @@
get:
operationId: GetProducts
summary: List Products
description: >
Retrieves a list of products. The products can be filtered by fields such as
`id` or `q`. The products can also be sorted or paginated.
This API Route can also be used to retrieve a product by its handle.
For accurate and correct pricing of the products based on the customer's
context, it's highly recommended to pass fields such as
`region_id`, `currency_code`, and `cart_id` when available.
Passing `sales_channel_id` ensures retrieving only products available in the
specified sales channel.
You can alternatively use a publishable API key in the request header
instead of passing a `sales_channel_id`.
externalDocs:
description: How to retrieve a product by its handle
url: >-
https://docs.medusajs.com/modules/products/storefront/show-products#retrieve-product-by-handle
parameters:
- in: query
name: q
description: >-
term used to search products' title, description, variant's title,
variant's sku, and collection's title.
schema:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by IDs.
schema:
oneOf:
- type: string
- type: array
items:
type: string
- in: query
name: sales_channel_id
style: form
explode: false
description: >-
Filter by sales channel IDs. When provided, only products available in
the selected sales channels are retrieved. Alternatively, you can pass a
publishable API key in the request header and this will have the same
effect.
schema:
type: array
items:
type: string
- in: query
name: collection_id
style: form
explode: false
description: >-
Filter by product collection IDs. When provided, only products that
belong to the specified product collections are retrieved.
schema:
type: array
items:
type: string
- in: query
name: type_id
style: form
explode: false
description: >-
Filter by product type IDs. When provided, only products that belong to
the specified product types are retrieved.
schema:
type: array
items:
type: string
- in: query
name: tags
style: form
explode: false
description: >-
Filter by product tag IDs. When provided, only products that belong to
the specified product tags are retrieved.
schema:
type: array
items:
type: string
- in: query
name: title
description: Filter by title.
schema:
type: string
- in: query
name: description
description: Filter by description
schema:
type: string
- in: query
name: handle
description: Filter by handle.
schema:
type: string
- in: query
name: is_giftcard
description: Whether to retrieve regular products or gift-card products.
schema:
type: boolean
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: category_id
style: form
explode: false
description: >-
Filter by product category IDs. When provided, only products that belong
to the specified product categories are retrieved.
schema:
type: array
x-featureFlag: product_categories
items:
type: string
- in: query
name: include_category_children
style: form
explode: false
description: >-
Whether to include child product categories when filtering using the
`category_id` field.
schema:
type: boolean
x-featureFlag: product_categories
- in: query
name: offset
description: The number of products to skip when retrieving the products.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of products returned.
schema:
type: integer
default: 100
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
products.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned products.
schema:
type: string
- in: query
name: order
description: A product field to sort-order the retrieved products by.
schema:
type: string
- in: query
name: cart_id
description: >-
The ID of the cart. This is useful for accurate pricing based on the
cart's context.
schema:
type: string
- in: query
name: region_id
description: >-
The ID of the region. This is useful for accurate pricing based on the
selected region.
schema:
type: string
- in: query
name: currency_code
style: form
explode: false
description: >-
A 3 character ISO currency code. This is useful for accurate pricing
based on the selected currency.
schema:
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
x-codegen:
method: list
queryParams: StoreGetProductsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_products/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_products/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_products/get.sh
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreProductsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,42 +0,0 @@
post:
operationId: PostProductsSearch
summary: Search Products
description: >-
Run a search query on products using the search service installed on the
Medusa backend. The searching is handled through the search service, so the
returned data's format depends on the search service you're using.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostSearchReq.yaml
x-codegen:
method: search
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_products_search/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_products_search/post.sh
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StorePostSearchRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,105 +0,0 @@
get:
operationId: GetProductsProduct
summary: Get a Product
description: >
Retrieve a Product's details. For accurate and correct pricing of the
product based on the customer's context, it's highly recommended to pass
fields such as
`region_id`, `currency_code`, and `cart_id` when available.
Passing `sales_channel_id` ensures retrieving only products available in the
current sales channel.
You can alternatively use a publishable API key in the request header
instead of passing a `sales_channel_id`.
externalDocs:
description: How to pass product pricing parameters
url: >-
https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters
parameters:
- in: path
name: id
required: true
description: The ID of the Product.
schema:
type: string
- in: query
name: sales_channel_id
description: The ID of the sales channel the customer is viewing the product from.
schema:
type: string
- in: query
name: cart_id
description: >-
The ID of the cart. This is useful for accurate pricing based on the
cart's context.
schema:
type: string
- in: query
name: region_id
description: >-
The ID of the region. This is useful for accurate pricing based on the
selected region.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned product.
schema:
type: string
- in: query
name: currency_code
style: form
explode: false
description: >-
A 3 character ISO currency code. This is useful for accurate pricing
based on the selected currency.
schema:
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
x-codegen:
method: retrieve
queryParams: StoreGetProductsProductParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_products_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_products_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_products_{id}/get.sh
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreProductsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -3,81 +3,10 @@ get:
summary: List Regions
description: >-
Retrieve a list of regions. The regions can be filtered by fields such as
`created_at`. The regions can also be paginated. This API Route is useful to
show the customer all available regions to choose from.
externalDocs:
description: How to use regions in a storefront
url: >-
https://docs.medusajs.com/modules/regions-and-currencies/storefront/use-regions
parameters:
- in: query
name: offset
description: The number of regions to skip when retrieving the regions.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of regions returned.
schema:
type: integer
default: 100
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: StoreGetRegionsParams
`id`. The regions can also be sorted or paginated.
x-authenticated: false
parameters: []
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_regions/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_regions/get.tsx
- lang: Shell
label: cURL
source:
@@ -85,14 +14,10 @@ get:
tags:
- Regions
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreRegionsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -101,3 +26,7 @@ get:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,25 +1,18 @@
get:
operationId: GetRegionsRegion
operationId: GetRegionsId
summary: Get a Region
description: Retrieve a Region's details.
description: >-
Retrieve a region by its ID. You can expand the region's relations or select
the fields that should be returned.
x-authenticated: false
parameters:
- in: path
name: id
- name: id
in: path
description: The region's ID.
required: true
description: The ID of the Region.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_regions_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_regions_{id}/get.tsx
- lang: Shell
label: cURL
source:
@@ -27,14 +20,10 @@ get:
tags:
- Regions
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreRegionsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -43,3 +32,7 @@ get:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -0,0 +1,39 @@
get:
operationId: GetRegionsIdPaymentProviders
summary: List Payment Providers
description: >-
Retrieve a list of payment providers in a region. The payment providers can
be filtered by fields like FILTER FIELDS. The payment providers can also be
paginated.
x-authenticated: false
parameters:
- name: id
in: path
description: The region's ID.
required: true
schema:
type: string
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_regions_{id}_payment-providers/get.sh
tags:
- Regions
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,40 +0,0 @@
get:
operationId: GetReturnReasons
summary: List Return Reasons
description: >-
Retrieve a list of Return Reasons. This is useful when implementing a Create
Return flow in the storefront.
x-codegen:
method: list
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_return-reasons/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_return-reasons/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_return-reasons/get.sh
tags:
- Return Reasons
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreReturnReasonsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,45 +0,0 @@
get:
operationId: GetReturnReasonsReason
summary: Get a Return Reason
description: Retrieve a Return Reason's details.
parameters:
- in: path
name: id
required: true
description: The id of the Return Reason.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_return-reasons_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_return-reasons_{id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_return-reasons_{id}/get.sh
tags:
- Return Reasons
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreReturnReasonsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,48 +0,0 @@
post:
operationId: PostReturns
summary: Create Return
description: >-
Create a Return for an Order. If a return shipping method is specified, the
return is automatically fulfilled.
externalDocs:
description: How to create a return in a storefront
url: https://docs.medusajs.com/modules/orders/storefront/create-return
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostReturnsReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_returns/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_returns/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_returns/post.sh
tags:
- Returns
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreReturnsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,62 +0,0 @@
get:
operationId: GetShippingOptions
summary: Get Shipping Options
description: Retrieve a list of Shipping Options.
parameters:
- in: query
name: is_return
description: >-
Whether return shipping options should be included. By default, all
shipping options are returned.
schema:
type: boolean
- in: query
name: product_ids
description: >-
"Comma-separated list of Product IDs to filter Shipping Options by. If
provided, only shipping options that can be used with the provided
products are retrieved."
schema:
type: string
- in: query
name: region_id
description: >-
"The ID of the region that the shipping options belong to. If not
provided, all shipping options are retrieved."
schema:
type: string
x-codegen:
method: list
queryParams: StoreGetShippingOptionsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_shipping-options/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_shipping-options/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_shipping-options/get.sh
tags:
- Shipping Options
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreShippingOptionsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,29 +1,18 @@
get:
operationId: GetShippingOptionsCartId
summary: List for Cart
description: Retrieve a list of Shipping Options available for a cart.
externalDocs:
description: How to implement shipping step in checkout
url: >-
https://docs.medusajs.com/modules/carts-and-checkout/storefront/implement-checkout-flow#shipping-step
operationId: GetShippingOptionsCart_id
summary: Get a Shipping Option
description: >-
Retrieve a shipping option by its ID. You can expand the shipping option's
relations or select the fields that should be returned.
x-authenticated: false
parameters:
- in: path
name: cart_id
- name: cart_id
in: path
description: The shipping option's cart id.
required: true
description: The ID of the Cart.
schema:
type: string
x-codegen:
method: listCartOptions
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_shipping-options_{cart_id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_shipping-options_{cart_id}/get.tsx
- lang: Shell
label: cURL
source:
@@ -31,14 +20,10 @@ get:
tags:
- Shipping Options
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartShippingOptionsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
@@ -47,3 +32,7 @@ get:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
requestBody:
content:
application/json:
schema: {}
@@ -1,62 +0,0 @@
post:
operationId: PostSwaps
summary: Create a Swap
description: >
Create a Swap for an Order. This will also create a return and associate it
with the swap. If a return shipping option is specified, the return will
automatically be fulfilled.
To complete the swap, you must use the Complete Cart API Route passing it
the ID of the swap's cart.
An idempotency key will be generated if none is provided in the header
`Idempotency-Key` and added to
the response. If an error occurs during swap creation or the request is
interrupted for any reason, the swap creation can be retried by passing the
idempotency
key in the `Idempotency-Key` header.
externalDocs:
description: How to create a swap
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostSwapsReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_swaps/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_swaps/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_swaps/post.sh
tags:
- Swaps
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreSwapsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,45 +0,0 @@
get:
operationId: GetSwapsSwapCartId
summary: Get by Cart ID
description: Retrieve a Swap's details by the ID of its cart.
parameters:
- in: path
name: cart_id
required: true
description: The id of the Cart
schema:
type: string
x-codegen:
method: retrieveByCartId
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_swaps_{cart_id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_swaps_{cart_id}/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_swaps_{cart_id}/get.sh
tags:
- Swaps
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreSwapsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,176 +0,0 @@
get:
operationId: GetVariants
summary: Get Product Variants
description: >
Retrieves a list of product variants. The product variants can be filtered
by fields such as `id` or `title`. The product variants can also be
paginated.
For accurate and correct pricing of the product variants based on the
customer's context, it's highly recommended to pass fields such as
`region_id`, `currency_code`, and `cart_id` when available.
Passing `sales_channel_id` ensures retrieving only variants of products
available in the specified sales channel.
You can alternatively use a publishable API key in the request header
instead of passing a `sales_channel_id`.
externalDocs:
description: How to pass product pricing parameters
url: >-
https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters
parameters:
- in: query
name: ids
description: >-
Filter by a comma-separated list of IDs. If supplied, it overrides the
`id` parameter.
schema:
type: string
- in: query
name: id
style: form
explode: false
description: >-
Filter by one or more IDs. If `ids` is supplied, it's overrides the
value of this parameter.
schema:
oneOf:
- type: string
description: Filter by an ID.
- type: array
description: Filter by IDs.
items:
type: string
- in: query
name: sales_channel_id
description: >-
"Filter by sales channel IDs. When provided, only products available in
the selected sales channels are retrieved. Alternatively, you can pass a
publishable API key in the request header and this will have the same
effect."
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product variants.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
variants.
schema:
type: string
- in: query
name: offset
description: The number of products to skip when retrieving the product variants.
schema:
type: number
default: '0'
- in: query
name: limit
description: Limit the number of product variants returned.
schema:
type: number
default: '100'
- in: query
name: cart_id
description: >-
The ID of the cart. This is useful for accurate pricing based on the
cart's context.
schema:
type: string
- in: query
name: region_id
description: >-
The ID of the region. This is useful for accurate pricing based on the
selected region.
schema:
type: string
- in: query
name: currency_code
style: form
explode: false
description: >-
A 3 character ISO currency code. This is useful for accurate pricing
based on the selected currency.
schema:
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
- in: query
name: title
style: form
explode: false
description: Filter by title
schema:
oneOf:
- type: string
description: a single title to filter by
- type: array
description: multiple titles to filter by
items:
type: string
- in: query
name: inventory_quantity
description: Filter by available inventory quantity
schema:
oneOf:
- type: number
description: A specific number to filter by.
- type: object
description: Filter using less and greater than comparisons.
properties:
lt:
type: number
description: Filter by inventory quantity less than this number
gt:
type: number
description: Filter by inventory quantity greater than this number
lte:
type: number
description: Filter by inventory quantity less than or equal to this number
gte:
type: number
description: >-
Filter by inventory quantity greater than or equal to this
number
x-codegen:
method: list
queryParams: StoreGetVariantsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_variants/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_variants/get.sh
tags:
- Product Variants
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreVariantsListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -1,91 +0,0 @@
get:
operationId: GetVariantsVariant
summary: Get a Product Variant
description: >
Retrieve a Product Variant's details. For accurate and correct pricing of
the product variant based on the customer's context, it's highly recommended
to pass fields such as
`region_id`, `currency_code`, and `cart_id` when available.
Passing `sales_channel_id` ensures retrieving only variants of products
available in the current sales channel.
You can alternatively use a publishable API key in the request header
instead of passing a `sales_channel_id`.
externalDocs:
description: How to pass product pricing parameters
url: >-
https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters
parameters:
- in: path
name: id
required: true
description: The ID of the Product Variant.
schema:
type: string
- in: query
name: sales_channel_id
description: >-
The ID of the sales channel the customer is viewing the product variant
from.
schema:
type: string
- in: query
name: cart_id
description: >-
The ID of the cart. This is useful for accurate pricing based on the
cart's context.
schema:
type: string
- in: query
name: region_id
description: >-
The ID of the region. This is useful for accurate pricing based on the
selected region.
schema:
type: string
- in: query
name: currency_code
style: form
explode: false
description: >-
A 3 character ISO currency code. This is useful for accurate pricing
based on the selected currency.
schema:
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
x-codegen:
method: retrieve
queryParams: StoreGetVariantsVariantParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_variants_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_variants_{id}/get.sh
tags:
- Product Variants
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreVariantsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml