docs: create docs workspace (#5174)

* docs: migrate ui docs to docs universe

* created yarn workspace

* added eslint and tsconfig configurations

* fix eslint configurations

* fixed eslint configurations

* shared tailwind configurations

* added shared ui package

* added more shared components

* migrating more components

* made details components shared

* move InlineCode component

* moved InputText

* moved Loading component

* Moved Modal component

* moved Select components

* Moved Tooltip component

* moved Search components

* moved ColorMode provider

* Moved Notification components and providers

* used icons package

* use UI colors in api-reference

* moved Navbar component

* used Navbar and Search in UI docs

* added Feedback to UI docs

* general enhancements

* fix color mode

* added copy colors file from ui-preset

* added features and enhancements to UI docs

* move Sidebar component and provider

* general fixes and preparations for deployment

* update docusaurus version

* adjusted versions

* fix output directory

* remove rootDirectory property

* fix yarn.lock

* moved code component

* added vale for all docs MD and MDX

* fix tests

* fix vale error

* fix deployment errors

* change ignore commands

* add output directory

* fix docs test

* general fixes

* content fixes

* fix announcement script

* added changeset

* fix vale checks

* added nofilter option

* fix vale error
This commit is contained in:
Shahed Nasser
2023-09-21 20:57:15 +03:00
committed by GitHub
parent 19c5d5ba36
commit fa7c94b4cc
3209 changed files with 32188 additions and 31018 deletions

View File

@@ -0,0 +1,115 @@
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: []
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_auth/delete.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,42 @@
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

View File

@@ -0,0 +1,49 @@
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, the cart's customer ID and email will
automatically be set.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/StorePostCartReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts/post.sh
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
'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

View File

@@ -0,0 +1,90 @@
get:
operationId: GetCartsCart
summary: Get a Cart
description: Retrieve a Cart's details. This includes recalculating its totals.
parameters:
- in: path
name: 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}/get.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
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
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{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

View File

@@ -0,0 +1,65 @@
post:
summary: Complete a Cart
operationId: PostCartsCartComplete
description: >
Complete a cart and place an order or create a swap, based on what the cart
is created for. 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: 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

View File

@@ -0,0 +1,50 @@
delete:
operationId: DeleteCartsCartDiscountsDiscount
summary: Remove Discount
description: >-
Remove a Discount from a Cart. This only removes the application of the
discount, and not completely delete 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

View File

@@ -0,0 +1,46 @@
post:
operationId: PostCartsCartLineItems
summary: Add a Line Item
description: Generates a Line Item with a given Product Variant and adds it to the Cart
parameters:
- in: path
name: 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_line-items/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

View File

@@ -0,0 +1,103 @@
post:
operationId: PostCartsCartLineItemsItem
summary: Update a Line Item
description: Update a line item's quantity.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_line-items_{line_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: DeleteCartsCartLineItemsItem
summary: Delete a Line Item
description: >-
Delete a Line Item from a Cart. The payment sessions will be updated and the
totals will be recalculated.
parameters:
- in: path
name: id
required: true
description: The ID of the Cart.
schema:
type: string
- in: path
name: 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_line-items_{line_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

View File

@@ -0,0 +1,49 @@
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: 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

View File

@@ -0,0 +1,45 @@
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 only one payment session is 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: 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

View File

@@ -0,0 +1,110 @@
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: 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: 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

View File

@@ -0,0 +1,53 @@
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: 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

View File

@@ -0,0 +1,48 @@
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: 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

View File

@@ -0,0 +1,44 @@
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
parameters:
- in: path
name: id
required: true
description: The Cart ID.
schema:
type: string
x-codegen:
method: calculateTaxes
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_carts_{id}_taxes/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

View File

@@ -0,0 +1,106 @@
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: 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

View File

@@ -0,0 +1,41 @@
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: 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

View File

@@ -0,0 +1,64 @@
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
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers/post.sh
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCustomersRes.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':
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
'500':
$ref: ../components/responses/500_error.yaml

View File

@@ -0,0 +1,83 @@
get:
operationId: GetCustomersCustomer
summary: Get a Customer
description: Retrieve the logged-in Customer's details.
x-authenticated: true
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me/get.sh
security:
- cookie_auth: []
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
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me/post.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,44 @@
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
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: []
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':
$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

View File

@@ -0,0 +1,102 @@
post:
operationId: PostCustomersCustomerAddressesAddress
summary: Update a Shipping Address
description: Update the logged-in customer's saved Shipping Address's details.
x-authenticated: true
parameters:
- in: path
name: address_id
required: true
description: The ID of the Address.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml
x-codegen:
method: updateAddress
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: []
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
delete:
operationId: DeleteCustomersCustomerAddressesAddress
summary: Delete an Address
description: Delete an Address from the Customer's saved addresses.
x-authenticated: true
parameters:
- in: path
name: 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: []
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

View File

@@ -0,0 +1,233 @@
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_customers_me_orders/get.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,45 @@
get:
operationId: GetCustomersCustomerPaymentMethods
summary: Get Saved Payment Methods
description: >-
Retrieve the logged-in customer's saved payment methods. This endpoint 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: []
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

View File

@@ -0,0 +1,48 @@
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 endpoint. 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

View File

@@ -0,0 +1,47 @@
post:
operationId: PostCustomersCustomerPasswordToken
summary: Request Password Reset
description: >-
Create a reset password token to be used in a subsequent Reset Password
endpoint. 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

View File

@@ -0,0 +1,41 @@
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: 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

View File

@@ -0,0 +1,43 @@
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: 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

View File

@@ -0,0 +1,45 @@
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 endpoints.
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: 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

View File

@@ -0,0 +1,44 @@
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: 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

View File

@@ -0,0 +1,74 @@
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: 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

View File

@@ -0,0 +1,51 @@
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
endpoint Verify Order Claim. 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders_batch_customer_token/post.sh
security:
- api_token: []
- cookie_auth: []
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

View File

@@ -0,0 +1,43 @@
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: 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

View File

@@ -0,0 +1,45 @@
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_orders_customer_confirm/post.sh
security:
- api_token: []
- cookie_auth: []
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

View File

@@ -0,0 +1,51 @@
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: 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

View File

@@ -0,0 +1,61 @@
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_payment-collections_{id}/get.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,52 @@
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_payment-collections_{id}_sessions/post.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,57 @@
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 Collections.
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: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_batch/post.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,54 @@
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: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_batch_authorize/post.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,54 @@
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: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}/post.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,54 @@
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 Collections.
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: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}_authorize/post.sh
security:
- cookie_auth: []
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

View File

@@ -0,0 +1,100 @@
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 endpoint 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-categories/get.sh
security:
- api_token: []
- cookie_auth: []
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

View File

@@ -0,0 +1,62 @@
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-categories_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
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

View File

@@ -0,0 +1,132 @@
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: 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

View File

@@ -0,0 +1,136 @@
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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_product-types/get.sh
security:
- api_token: []
- cookie_auth: []
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

View File

@@ -0,0 +1,262 @@
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 endpoint 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: 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

View File

@@ -0,0 +1,42 @@
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

View File

@@ -0,0 +1,101 @@
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: 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

View File

@@ -0,0 +1,99 @@
get:
operationId: GetRegions
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 endpoint 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
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_regions/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_regions/get.sh
tags:
- Regions
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreRegionsListRes.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

View File

@@ -0,0 +1,41 @@
get:
operationId: GetRegionsRegion
summary: Get a Region
description: Retrieve a Region's details.
parameters:
- in: path
name: 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_regions_{id}/get.sh
tags:
- Regions
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreRegionsRes.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

View File

@@ -0,0 +1,36 @@
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: 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

View File

@@ -0,0 +1,41 @@
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: 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

View File

@@ -0,0 +1,44 @@
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: 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

View File

@@ -0,0 +1,58 @@
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: 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

View File

@@ -0,0 +1,45 @@
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
parameters:
- in: path
name: 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: Shell
label: cURL
source:
$ref: ../code_samples/Shell/store_shipping-options_{cart_id}/get.sh
tags:
- Shipping Options
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/StoreCartShippingOptionsListRes.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

View File

@@ -0,0 +1,58 @@
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 endpoint 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: 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

View File

@@ -0,0 +1,41 @@
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: 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

View File

@@ -0,0 +1,172 @@
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: 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

View File

@@ -0,0 +1,87 @@
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: 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