From beecd4947d1b61291d8e5de83fadb463938ae06e Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 11:36:52 +0200 Subject: [PATCH 01/18] docs: added an upgrade guide for 1.7.0 (#2750) --- .../advanced/backend/upgrade-guides/1-7-0.md | 35 +++++++++++++++++++ www/docs/sidebars.js | 5 +++ 2 files changed, 40 insertions(+) create mode 100644 docs/content/advanced/backend/upgrade-guides/1-7-0.md diff --git a/docs/content/advanced/backend/upgrade-guides/1-7-0.md b/docs/content/advanced/backend/upgrade-guides/1-7-0.md new file mode 100644 index 0000000000000..9c706d1c4da61 --- /dev/null +++ b/docs/content/advanced/backend/upgrade-guides/1-7-0.md @@ -0,0 +1,35 @@ +--- +description: 'Actions Required for v.1.7.0' +--- + +# v1.7.0 + +Version `1.7.0` of Medusa introduces a breaking change in the [CustomerService](../../../references/services/classes/CustomerService.md). + +## Overview + +In this new version, the method [`retrieveByEmail` in the Customer Service](../../../references/services/classes/CustomerService.md#retrievebyemail) has been deprecated in favor of other methods. Read the actions required below to learn which methods to use instead. + +## Actions Required + +Instead of using `customerService.retrieveByEmail`, you should now use the methods `customerService.retrieveRegisteredByEmail` or `customerService.retrieveUnRegisteredByEmail`. + +The `customerService.retrieveRegisteredByEmail` method allows you to retrieve a registered customer by email: + +```tsx +customerService.retrieveRegisteredByEmail("example@gmail.com"); +``` + +On the other hand, the `retrieveUnregisteredByEmail` method allows to retrieve guest customers by email: + +```jsx +customerService.retrieveUnRegisteredByEmail("example@gmail.com"); +``` + +To retrieve a customer by email regardless of whether they are registered or not, you can use the `customerService.list` method instead: + +```tsx +customerService.list({ + email: "example@gmail.com" +}) +``` diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 4b8d2c4e14eba..24f20876c9bb1 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -194,6 +194,11 @@ module.exports = { id: "advanced/backend/upgrade-guides/1-6-1", label: "v1.6.1" }, + { + type: "doc", + id: "advanced/backend/upgrade-guides/1-7-0", + label: "v1.7.0" + }, ] }, { From 6c796bf582bdd5fee39647e2869dc2a13c492e34 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 11:52:37 +0200 Subject: [PATCH 02/18] docs: added a minimum Node.js version for admin (#2779) * docs: added a note about min node version in admin * docs: added a link to Vite documentation --- docs/content/admin/quickstart.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/content/admin/quickstart.md b/docs/content/admin/quickstart.md index e6d93297f7ca1..ac349b65ada48 100644 --- a/docs/content/admin/quickstart.md +++ b/docs/content/admin/quickstart.md @@ -4,6 +4,8 @@ This document will guide you through setting up the Medusa admin in minutes, as ## Prerequisites +### Medusa Server + The Medusa admin is connected to the Medusa server. So, make sure to install the Medusa server first before proceeding with the admin. You can check out the [quickstart guide to install the Medusa server](../quickstart/quick-start). :::tip @@ -12,6 +14,16 @@ If you’re not very familiar with Medusa’s architecture, you can learn more a ::: +### Node.js + +As Medusa Admin uses [Vite 3](https://vitejs.dev/guide/#scaffolding-your-first-vite-project), it requires versions 14.8+ or 16+. You can check which version of Node you have by running the following command: + +```bash noReport +node -v +``` + +You can install Node from the [official website](https://nodejs.org/en/). + ## Instant Deployment to Netlify Instead of manually following this guide to install then later deploy the Medusa Admin, you can deploy the Medusa Admin to Netlify with this button: From 7227c1539b294f6ca7fb8fdde1747240a04ac38e Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 11:52:55 +0200 Subject: [PATCH 03/18] docs: added a note about using Yarn for installation (#2778) * docs: added a note about yarn being faster * docs: fixed env variable used in admin deployment guide * docs: fixed the use of noReport with npm2yarn --- docs/content/admin/quickstart.md | 10 ++++++++-- docs/content/advanced/backend/entities/index.md | 2 +- .../advanced/backend/services/create-service.md | 2 +- docs/content/deployments/admin/deploying-on-netlify.md | 8 ++++++-- docs/content/quickstart/quick-start.md | 8 +++++++- docs/content/starters/gatsby-medusa-starter.md | 6 ++++++ docs/content/starters/nextjs-medusa-starter.md | 6 ++++++ .../troubleshooting/transaction-error-in-checkout.md | 2 +- .../tutorial/0-set-up-your-development-environment.mdx | 2 +- 9 files changed, 37 insertions(+), 9 deletions(-) diff --git a/docs/content/admin/quickstart.md b/docs/content/admin/quickstart.md index ac349b65ada48..608e7f395cd36 100644 --- a/docs/content/admin/quickstart.md +++ b/docs/content/admin/quickstart.md @@ -34,6 +34,12 @@ Instead of manually following this guide to install then later deploy the Medusa ## Install the Admin +:::tip + +It is recommended to use [Yarn](https://yarnpkg.com/getting-started/install) for the installation process as it's much faster than using NPM. + +::: + Start by cloning the [Admin GitHub repository](https://github.com/medusajs/admin) and changing to the cloned directory: ```bash @@ -55,7 +61,7 @@ Before running your Medusa admin, make sure that your Medusa server is running. To run your Medusa server, go to the directory holding the server and run: -```bash npm2yarn noReport +```bash npm2yarn npm run start ``` @@ -77,7 +83,7 @@ Use your Medusa admin’s user credentials to log in. If you installed the demo data when you installed the Medusa server by using the `--seed` option or running: -```bash npm2yarn noReport +```bash npm2yarn npm run seed ``` diff --git a/docs/content/advanced/backend/entities/index.md b/docs/content/advanced/backend/entities/index.md index 742ce1031d58e..89d63127e6eef 100644 --- a/docs/content/advanced/backend/entities/index.md +++ b/docs/content/advanced/backend/entities/index.md @@ -75,7 +75,7 @@ Be careful with your file names as it can cause unclear errors in Typeorm. Make Before trying this step make sure that you’ve created and run your migrations. You also need to re-build your code using: -```bash npm2yarn noReport +```bash npm2yarn npm run build ``` diff --git a/docs/content/advanced/backend/services/create-service.md b/docs/content/advanced/backend/services/create-service.md index ab905bc69f694..3b521eed30c83 100644 --- a/docs/content/advanced/backend/services/create-service.md +++ b/docs/content/advanced/backend/services/create-service.md @@ -54,7 +54,7 @@ In this section, you'll learn how to use services throughout your Medusa server. Before using your service, make sure you run the `build` command: -```bash npm2yarn noReport +```bash npm2yarn npm run build ``` diff --git a/docs/content/deployments/admin/deploying-on-netlify.md b/docs/content/deployments/admin/deploying-on-netlify.md index 2ce0ac4e290b4..29b5a0185eb7e 100644 --- a/docs/content/deployments/admin/deploying-on-netlify.md +++ b/docs/content/deployments/admin/deploying-on-netlify.md @@ -113,7 +113,7 @@ Next, click the “Show advanced” button, which is above the “Deploy site” Under the “Advanced build settings” section click on the “New variable” button. This will show two inputs for the key and value of the environment variable. -For the first field enter the key `GATSBY_MEDUSA_BACKEND_URL` and for the value enter the URL of your Medusa server. +For the first field enter the key `MEDUSA_BACKEND_URL` and for the value enter the URL of your Medusa server. :::caution @@ -121,7 +121,11 @@ If you haven’t deployed your Medusa server yet, you can leave the value blank ::: -![Environment Variable](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001898/Medusa%20Docs/Netlify/DnutZfT_rv8iel.png) +:::note + +In previous versions of the admin, the environment variable name was `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` instead. The admin remains backwards compatible, so if you've used this an older version you can keep the same environment variables. However, it's highly recommended you change it to `MEDUSA_BACKEND_URL`. + +::: Once you’re done, scroll down and click on Deploy site. diff --git a/docs/content/quickstart/quick-start.md b/docs/content/quickstart/quick-start.md index 144a22ed8f921..2b08d692c5273 100644 --- a/docs/content/quickstart/quick-start.md +++ b/docs/content/quickstart/quick-start.md @@ -14,9 +14,15 @@ You can install Node from the [official website](https://nodejs.org/en/). ## Create a Medusa Server +:::tip + +It is recommended to use [Yarn](https://yarnpkg.com/getting-started/install) for the installation process as it's much faster than using NPM. + +::: + ### 1. Install Medusa CLI - ```bash npm2yarn noReport + ```bash npm2yarn npm install @medusajs/medusa-cli -g ``` diff --git a/docs/content/starters/gatsby-medusa-starter.md b/docs/content/starters/gatsby-medusa-starter.md index 94bdfe0ff0bbf..20d3f8896c099 100644 --- a/docs/content/starters/gatsby-medusa-starter.md +++ b/docs/content/starters/gatsby-medusa-starter.md @@ -24,6 +24,12 @@ npm install gatsby-cli -g ## Installation +:::tip + +It is recommended to use [Yarn](https://yarnpkg.com/getting-started/install) for the installation process as it's much faster than using NPM. + +::: + 1\. Create a new Gatsby project using the [Medusa starter template](https://github.com/medusajs/gatsby-starter-medusa): ```bash diff --git a/docs/content/starters/nextjs-medusa-starter.md b/docs/content/starters/nextjs-medusa-starter.md index cee432527c2e7..2d07d06452b0d 100644 --- a/docs/content/starters/nextjs-medusa-starter.md +++ b/docs/content/starters/nextjs-medusa-starter.md @@ -18,6 +18,12 @@ This document assumes you already have a Medusa server installed. If you don’t ## Installation +:::tip + +It is recommended to use [Yarn](https://yarnpkg.com/getting-started/install) for the installation process as it's much faster than using NPM. + +::: + 1\. Create a new Next.js project using the [Medusa starter template](https://github.com/medusajs/nextjs-starter-medusa): ```bash diff --git a/docs/content/troubleshooting/transaction-error-in-checkout.md b/docs/content/troubleshooting/transaction-error-in-checkout.md index 3aa704a0a57d9..6830f67d243df 100644 --- a/docs/content/troubleshooting/transaction-error-in-checkout.md +++ b/docs/content/troubleshooting/transaction-error-in-checkout.md @@ -46,7 +46,7 @@ medusa migrations run If you want to add demo data into your server, you should also seed the database using the following command: -```bash npm2yarn noReport +```bash npm2yarn npm run seed ``` diff --git a/docs/content/tutorial/0-set-up-your-development-environment.mdx b/docs/content/tutorial/0-set-up-your-development-environment.mdx index f98695fa7f8eb..40cc068c55b8f 100644 --- a/docs/content/tutorial/0-set-up-your-development-environment.mdx +++ b/docs/content/tutorial/0-set-up-your-development-environment.mdx @@ -123,7 +123,7 @@ The final installation required to get started with Medusa is the Medusa CLI. It You can install Medusa’s CLI with the following command: -```bash npm2yarn noReport +```bash npm2yarn npm install @medusajs/medusa-cli -g ``` From 5fab104b3568f240c918b00a50beaf88da19ed05 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 11:53:42 +0200 Subject: [PATCH 04/18] chore(docs): Generated Docs Announcement Bar (automated) (#2781) Co-authored-by: olivermrbl --- www/docs/announcement.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/docs/announcement.json b/www/docs/announcement.json index 9e26dfeeb6e64..fd96832e694cd 100644 --- a/www/docs/announcement.json +++ b/www/docs/announcement.json @@ -1 +1 @@ -{} \ No newline at end of file +{"id":"https://github.com/medusajs/medusa/releases/tag/v1.7.0","content":"v1.7.0 is out","isCloseable":true} \ No newline at end of file From 76d35a1350a5ee892b831d2ccb36171b1538eba9 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 12:32:51 +0200 Subject: [PATCH 05/18] docs: made changes to CORS usage/config (#2784) --- .../content/advanced/backend/endpoints/add.md | 22 +++++++++++++++---- docs/content/usage/configurations.md | 21 ++++++++++++++---- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/docs/content/advanced/backend/endpoints/add.md b/docs/content/advanced/backend/endpoints/add.md index 39738ee6d24ae..86a204143bab6 100644 --- a/docs/content/advanced/backend/endpoints/add.md +++ b/docs/content/advanced/backend/endpoints/add.md @@ -46,14 +46,28 @@ You can also create endpoints that don't reside under these two prefixes, simila If you’re adding a storefront or admin endpoint and you want to access these endpoints from the storefront or Medusa admin, you need to pass your endpoints Cross-Origin Resource Origin (CORS) options using the `cors` package. -First, you need to import your Medusa configurations along with the `cors` library: +First, you need to import the necessary utility functions and types from Medusa's packages with the `cors` library: ```ts +import { getConfigFile, parseCorsOrigins } from "medusa-core-utils" +import { ConfigModule } from "@medusajs/medusa/dist/types/global" import cors from "cors" -import { projectConfig } from "../../medusa-config" ``` -Then, create an object that will hold the Cross-Origin Resource Sharing (CORS) configurations. If it’s a storefront endpoint, pass the `origin` property storefront options: +Next, in the exported function, retrieve the CORS configurations of your server using the utility functions you imported: + +```ts +export default (rootDirectory) => { + //... + + const { configModule } = getConfigFile(rootDirectory, "medusa-config") + const { projectConfig } = configModule + + //.... +} +``` + +Then, create an object that will hold the CORS configurations. If it’s a storefront endpoint, pass the `origin` property storefront options: ```ts const corsOptions = { @@ -71,7 +85,7 @@ const corsOptions = { } ``` -Finally, for each route you add, create an `OPTIONS` request and add `cors` as a middleware for the route: +Finally, for each route you add, create an `OPTIONS` request and add `cors` as a middleware for the route passing it the CORS option: ```ts router.options("/admin/hello", cors(corsOptions)) diff --git a/docs/content/usage/configurations.md b/docs/content/usage/configurations.md index b4bdebcce99a9..5e2d1b59bc87a 100644 --- a/docs/content/usage/configurations.md +++ b/docs/content/usage/configurations.md @@ -194,9 +194,22 @@ In a development environment, if this option is not set the default secret is ::: -## Admin CORS +## CORS Configurations -Medusa uses Cross-Origin Resource Sharing (CORS) to only allow specific origins to access the server. To make sure your Admin dashboard can access the Medusa server’s admin endpoints, set this configuration: +Medusa uses Cross-Origin Resource Sharing (CORS) to only allow specific origins to access the server. + +The Admin and the Storefront have different CORS configurations that must be configured. + +### Accepted Patterns + +For both of the Admin and the Storefront CORS configurations, the value is expected to be a string. This string can be a comma-separated list of accepted origins. Every origin in that list can be of the following types: + +1. The accepted origin as is. For example, `http://localhost:8000`. +2. A regular expression pattern that can match more than one origin. For example, `*.example.com`. The regex pattern that the server tests for is `^([\/~@;%#'])(.*?)\1([gimsuy]*)$`. + +### Admin CORS + +To make sure your Admin dashboard can access the Medusa server’s admin endpoints, set this configuration: ```jsx module.exports = { @@ -223,9 +236,9 @@ Make sure that the URL is without a backslash at the end. For example, you shoul ::: -## Storefront CORS +### Storefront CORS -Medusa uses CORS to only allow specific origins to access the server. To make sure your Storefront dashboard can access the Medusa server, set this configuration: +To make sure your Storefront dashboard can access the Medusa server, set this configuration: ```jsx module.exports = { From e174443ecf2cb7c827575e70f8e4346a5f9fafb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 12:40:33 +0200 Subject: [PATCH 06/18] chore(docs): Generated JS Client Reference (automated) (#2780) Co-authored-by: olivermrbl --- .../js-client/classes/AddressesResource.md | 6 +- .../references/js-client/classes/Admin.md | 66 ++++++++-------- .../js-client/classes/AdminAuthResource.md | 6 +- .../classes/AdminBatchJobsResource.md | 10 +-- .../classes/AdminCollectionsResource.md | 14 ++-- .../classes/AdminCurrenciesResource.md | 4 +- .../classes/AdminCustomerGroupsResource.md | 16 ++-- .../classes/AdminCustomersResource.md | 8 +- .../classes/AdminDiscountsResource.md | 32 ++++---- .../classes/AdminDraftOrdersResource.md | 18 ++--- .../classes/AdminGiftCardsResource.md | 10 +-- .../js-client/classes/AdminInvitesResource.md | 10 +-- .../js-client/classes/AdminNotesResource.md | 10 +-- .../classes/AdminNotificationsResource.md | 4 +- .../classes/AdminOrderEditsResource.md | 24 +++--- .../js-client/classes/AdminOrdersResource.md | 50 ++++++------ .../AdminPaymentCollectionsResource.md | 22 +++--- .../classes/AdminPaymentsResource.md | 6 +- .../classes/AdminPriceListResource.md | 20 ++--- .../classes/AdminProductTagsResource.md | 2 +- .../classes/AdminProductTypesResource.md | 2 +- .../classes/AdminProductsResource.md | 28 +++---- .../classes/AdminPublishableApiKeyResource.md | 78 +++++++++++++++++-- .../js-client/classes/AdminRegionsResource.md | 24 +++--- .../classes/AdminReturnReasonsResource.md | 10 +-- .../js-client/classes/AdminReturnsResource.md | 6 +- .../classes/AdminSalesChannelsResource.md | 18 ++--- .../classes/AdminShippingOptionsResource.md | 10 +-- .../classes/AdminShippingProfilesResource.md | 10 +-- .../js-client/classes/AdminStoresResource.md | 12 +-- .../js-client/classes/AdminSwapsResource.md | 4 +- .../classes/AdminTaxRatesResource.md | 22 +++--- .../js-client/classes/AdminUploadsResource.md | 10 +-- .../js-client/classes/AdminUsersResource.md | 14 ++-- .../classes/AdminVariantsResource.md | 2 +- .../js-client/classes/AuthResource.md | 8 +- .../js-client/classes/CartsResource.md | 24 +++--- .../js-client/classes/CollectionsResource.md | 4 +- .../js-client/classes/CustomerResource.md | 16 ++-- .../js-client/classes/GiftCardsResource.md | 2 +- .../js-client/classes/LineItemsResource.md | 6 +- .../js-client/classes/OrderEditsResource.md | 6 +- .../js-client/classes/OrdersResource.md | 56 ++++++++++++- .../classes/PaymentCollectionsResource.md | 76 ++++++++++++++---- .../classes/PaymentMethodsResource.md | 2 +- .../js-client/classes/ProductTypesResource.md | 2 +- .../classes/ProductVariantsResource.md | 4 +- .../js-client/classes/ProductsResource.md | 8 +- .../js-client/classes/RegionsResource.md | 4 +- .../classes/ReturnReasonsResource.md | 4 +- .../js-client/classes/ReturnsResource.md | 2 +- .../classes/ShippingOptionsResource.md | 4 +- .../js-client/classes/SwapsResource.md | 4 +- .../classes/internal-1.AdminPostAuthReq.md | 4 +- ...rnal-10.AdminPostInvitesInviteAcceptReq.md | 4 +- ...-10.AdminPostInvitesInviteAcceptUserReq.md | 6 +- .../internal-10.AdminPostInvitesReq.md | 4 +- .../internal-11.AdminGetNotesParams.md | 6 +- .../internal-11.AdminPostNotesNoteReq.md | 2 +- .../classes/internal-11.AdminPostNotesReq.md | 6 +- ...internal-12.AdminGetNotificationsParams.md | 18 ++--- ...nPostNotificationsNotificationResendReq.md | 2 +- ...nPostOrderEditsEditLineItemsLineItemReq.md | 2 +- ...-13.AdminPostOrderEditsEditLineItemsReq.md | 6 +- ...rnal-13.AdminPostOrderEditsOrderEditReq.md | 2 +- .../internal-13.AdminPostOrderEditsReq.md | 4 +- .../internal-13.GetOrderEditsParams.md | 4 +- .../classes/internal-14.AdditionalItem-1.md | 4 +- .../classes/internal-14.AdditionalItem.md | 4 +- .../internal-14.AdminGetOrdersParams.md | 8 +- ...stOrdersOrderClaimsClaimFulfillmentsReq.md | 4 +- ...l-14.AdminPostOrdersOrderClaimsClaimReq.md | 8 +- ...nPostOrdersOrderClaimsClaimShipmentsReq.md | 4 +- ...ternal-14.AdminPostOrdersOrderClaimsReq.md | 18 ++--- ...-14.AdminPostOrdersOrderFulfillmentsReq.md | 6 +- ...ernal-14.AdminPostOrdersOrderRefundsReq.md | 8 +- .../internal-14.AdminPostOrdersOrderReq.md | 20 ++--- ...ernal-14.AdminPostOrdersOrderReturnsReq.md | 12 +-- ...rnal-14.AdminPostOrdersOrderShipmentReq.md | 6 +- ....AdminPostOrdersOrderShippingMethodsReq.md | 6 +- ...nternal-14.AdminPostOrdersOrderSwapsReq.md | 12 +-- ...PostOrdersOrderSwapsSwapFulfillmentsReq.md | 4 +- ...minPostOrdersOrderSwapsSwapShipmentsReq.md | 6 +- .../internal-14.CustomShippingOption.md | 4 +- .../js-client/classes/internal-14.Image.md | 4 +- .../js-client/classes/internal-14.Item-1.md | 12 +-- .../js-client/classes/internal-14.Item-2.md | 12 +-- .../js-client/classes/internal-14.Item.md | 4 +- .../classes/internal-14.PaymentMethod.md | 4 +- .../classes/internal-14.ReturnItem.md | 8 +- .../classes/internal-14.ReturnShipping-1.md | 4 +- .../classes/internal-14.ReturnShipping-2.md | 4 +- .../classes/internal-14.ReturnShipping.md | 4 +- .../classes/internal-14.ShippingMethod-1.md | 6 +- .../classes/internal-14.ShippingMethod-2.md | 6 +- .../classes/internal-14.ShippingMethod.md | 10 +-- .../js-client/classes/internal-14.Tag.md | 4 +- ...al-15.AdminUpdatePaymentCollectionsReq.md} | 8 +- .../internal-16.AdminPostPaymentRefundsReq.md | 6 +- ...-17.AdminDeletePriceListPricesPricesReq.md | 2 +- ...al-17.AdminGetPriceListPaginationParams.md | 8 +- ...minGetPriceListsPriceListProductsParams.md | 28 +++---- ...al-17.AdminPostPriceListPricesPricesReq.md | 4 +- ...dminPostPriceListsPriceListPriceListReq.md | 18 ++--- ...rnal-17.AdminPostPriceListsPriceListReq.md | 18 ++--- .../classes/internal-17.CustomerGroup-1.md | 2 +- .../classes/internal-17.CustomerGroup.md | 2 +- ...-18.AdminGetProductTagsPaginationParams.md | 4 +- .../internal-18.AdminGetProductTagsParams.md | 18 ++--- .../internal-19.AdminGetProductTypesParams.md | 14 ++-- ...nternal-2.AdminGetBatchPaginationParams.md | 10 +-- .../classes/internal-2.AdminGetBatchParams.md | 28 +++---- .../classes/internal-2.AdminPostBatchesReq.md | 6 +- .../internal-20.AdminGetProductsParams.md | 8 +- ...-20.AdminPostProductsProductMetadataReq.md | 4 +- ...0.AdminPostProductsProductOptionsOption.md | 2 +- ...l-20.AdminPostProductsProductOptionsReq.md | 2 +- ...internal-20.AdminPostProductsProductReq.md | 48 ++++++------ ...-20.AdminPostProductsProductVariantsReq.md | 42 +++++----- ...inPostProductsProductVariantsVariantReq.md | 44 +++++------ .../internal-20.AdminPostProductsReq.md | 48 ++++++------ .../classes/internal-20.ProductOptionReq.md | 2 +- .../internal-20.ProductVariantOptionReq-1.md | 4 +- .../internal-20.ProductVariantOptionReq-2.md | 2 +- .../internal-20.ProductVariantOptionReq-3.md | 4 +- .../internal-20.ProductVariantOptionReq.md | 4 +- .../internal-20.ProductVariantReq-1.md | 42 +++++----- .../classes/internal-20.ProductVariantReq.md | 40 +++++----- ...ePublishableApiKeySalesChannelsBatchReq.md | 13 ++++ ...tPublishableApiKeySalesChannelsBatchReq.md | 13 ++++ ...tPublishableApiKeysPublishableApiKeyReq.md | 2 +- ...ernal-21.AdminPostPublishableApiKeysReq.md | 2 +- ...GetPublishableApiKeySalesChannelsParams.md | 3 + ...internal-21.GetPublishableApiKeysParams.md | 2 +- ...> internal-21.ProductBatchSalesChannel.md} | 2 +- ...rnal-22.AdminGetRegionsPaginationParams.md | 4 +- .../internal-22.AdminGetRegionsParams.md | 10 +-- ...l-22.AdminPostRegionsRegionCountriesReq.md | 2 +- ...ostRegionsRegionFulfillmentProvidersReq.md | 2 +- ...minPostRegionsRegionPaymentProvidersReq.md | 2 +- .../internal-22.AdminPostRegionsRegionReq.md | 24 +++--- .../internal-22.AdminPostRegionsReq.md | 18 ++--- ...rnal-23.AdminPostReturnReasonsReasonReq.md | 8 +- .../internal-23.AdminPostReturnReasonsReq.md | 10 +-- .../internal-24.AdminGetReturnsParams.md | 4 +- ...nal-24.AdminPostReturnsReturnReceiveReq.md | 4 +- .../js-client/classes/internal-24.Item.md | 4 +- ...eteSalesChannelsChannelProductsBatchReq.md | 4 +- ...internal-25.AdminGetSalesChannelsParams.md | 16 ++-- ...ostSalesChannelsChannelProductsBatchReq.md | 4 +- .../internal-25.AdminPostSalesChannelsReq.md | 6 +- ...5.AdminPostSalesChannelsSalesChannelReq.md | 6 +- ...ternal-26.AdminGetShippingOptionsParams.md | 6 +- ...al-26.AdminPostShippingOptionsOptionReq.md | 12 +-- ...internal-26.AdminPostShippingOptionsReq.md | 24 +++--- .../internal-26.OptionRequirement-1.md | 6 +- .../classes/internal-26.OptionRequirement.md | 4 +- ...-27.AdminPostShippingProfilesProfileReq.md | 2 +- ...nternal-27.AdminPostShippingProfilesReq.md | 2 +- .../classes/internal-28.AdminPostStoreReq.md | 14 ++-- .../internal-29.AdminGetSwapsParams.md | 4 +- ...-3.AdminDeleteProductsFromCollectionReq.md | 2 +- ...l-3.AdminGetCollectionsPaginationParams.md | 4 +- .../internal-3.AdminGetCollectionsParams.md | 18 ++--- ...nal-3.AdminPostCollectionsCollectionReq.md | 6 +- .../internal-3.AdminPostCollectionsReq.md | 6 +- ...rnal-3.AdminPostProductsToCollectionReq.md | 2 +- ...DeleteTaxRatesTaxRateProductTypesParams.md | 4 +- ...minDeleteTaxRatesTaxRateProductTypesReq.md | 2 +- ...dminDeleteTaxRatesTaxRateProductsParams.md | 4 +- ...0.AdminDeleteTaxRatesTaxRateProductsReq.md | 2 +- ...eteTaxRatesTaxRateShippingOptionsParams.md | 4 +- ...DeleteTaxRatesTaxRateShippingOptionsReq.md | 2 +- .../internal-30.AdminGetTaxRatesParams.md | 16 ++-- ...ternal-30.AdminGetTaxRatesTaxRateParams.md | 4 +- .../internal-30.AdminPostTaxRatesReq.md | 14 ++-- ...AdminPostTaxRatesTaxRateProductTypesReq.md | 2 +- ...-30.AdminPostTaxRatesTaxRateProductsReq.md | 2 +- ...internal-30.AdminPostTaxRatesTaxRateReq.md | 14 ++-- ...inPostTaxRatesTaxRateShippingOptionsReq.md | 2 +- .../internal-31.AdminDeleteUploadsReq.md | 2 +- ...ernal-31.AdminPostUploadsDownloadUrlReq.md | 2 +- .../internal-31.IAdminPostUploadsFileReq.md | 4 +- .../internal-32.AdminCreateUserRequest.md | 10 +-- .../internal-32.AdminResetPasswordRequest.md | 6 +- ...ernal-32.AdminResetPasswordTokenRequest.md | 2 +- .../internal-32.AdminUpdateUserRequest.md | 10 +-- .../internal-33.AdminGetVariantsParams.md | 16 ++-- .../classes/internal-34.StorePostAuthReq.md | 4 +- .../js-client/classes/internal-35.Discount.md | 2 +- .../js-client/classes/internal-35.GiftCard.md | 2 +- .../js-client/classes/internal-35.Item.md | 4 +- .../classes/internal-35.StorePostCartReq.md | 10 +-- ...-35.StorePostCartsCartPaymentSessionReq.md | 2 +- ...orePostCartsCartPaymentSessionUpdateReq.md | 2 +- .../internal-35.StorePostCartsCartReq.md | 20 ++--- ...-35.StorePostCartsCartShippingMethodReq.md | 4 +- .../internal-36.StoreGetCollectionsParams.md | 10 +-- ...CustomersCustomerOrdersPaginationParams.md | 8 +- ...7.StoreGetCustomersCustomerOrdersParams.md | 36 ++++----- ...rePostCustomersCustomerPasswordTokenReq.md | 2 +- ...ternal-37.StorePostCustomersCustomerReq.md | 14 ++-- .../internal-37.StorePostCustomersReq.md | 10 +-- ...l-37.StorePostCustomersResetPasswordReq.md | 6 +- ...l-39.StorePostCartsCartLineItemsItemReq.md | 2 +- ...ernal-39.StorePostCartsCartLineItemsReq.md | 6 +- .../internal-4.AdminGetCurrenciesParams.md | 6 +- ...ternal-4.AdminPostCurrenciesCurrencyReq.md | 2 +- ...-40.StorePostOrderEditsOrderEditDecline.md | 2 +- .../internal-41.ShippingAddressPayload.md | 2 +- .../internal-41.StoreGetOrdersParams.md | 6 +- ...torePostCustomersCustomerAcceptClaimReq.md | 13 ++++ ...StorePostCustomersCustomerOrderClaimReq.md | 13 ++++ ...42.PaymentCollectionSessionInputRequest.md | 43 ---------- ...reManagePaymentCollectionSessionRequest.md | 13 ---- ...al-42.StorePaymentCollectionSessionsReq.md | 13 ++++ ...entCollectionsBatchSessionsAuthorizeReq.md | 13 ++++ ...ePostPaymentCollectionsBatchSessionsReq.md | 13 ++++ ....StorePostPaymentCollectionsSessionsReq.md | 33 ++++++++ ...eRefreshPaymentCollectionSessionRequest.md | 23 ------ .../internal-44.StoreGetProductTypesParams.md | 14 ++-- .../internal-45.StoreGetVariantsParams.md | 14 ++-- ...nal-46.StoreGetProductsPaginationParams.md | 8 +- .../internal-46.StoreGetProductsParams.md | 32 ++++---- .../classes/internal-46.StorePostSearchReq.md | 8 +- .../js-client/classes/internal-49.Item.md | 8 +- .../classes/internal-49.ReturnShipping.md | 2 +- .../internal-49.StorePostReturnsReq.md | 6 +- ...leteCustomerGroupsGroupCustomerBatchReq.md | 2 +- ...internal-5.AdminGetCustomerGroupsParams.md | 8 +- .../internal-5.AdminGetCustomersParams.md | 6 +- ...ostCustomerGroupsGroupCustomersBatchReq.md | 2 +- ...ernal-5.AdminPostCustomerGroupsGroupReq.md | 4 +- .../internal-5.AdminPostCustomerGroupsReq.md | 4 +- ...ternal-50.StoreGetShippingOptionsParams.md | 6 +- .../classes/internal-51.AdditionalItem.md | 4 +- .../js-client/classes/internal-51.Item.md | 8 +- .../classes/internal-51.StorePostSwapsReq.md | 8 +- ...nternal-6.AdminPostCustomersCustomerReq.md | 14 ++-- .../internal-6.AdminPostCustomersReq.md | 12 +-- .../js-client/classes/internal-6.Group.md | 2 +- .../internal-7.AdminCreateCondition.md | 2 +- ...untsDiscountConditionsConditionBatchReq.md | 2 +- .../internal-7.AdminGetDiscountsParams.md | 8 +- ...-7.AdminPostDiscountsDiscountConditions.md | 2 +- ...untsDiscountConditionsConditionBatchReq.md | 2 +- ...minPostDiscountsDiscountDynamicCodesReq.md | 6 +- ...nternal-7.AdminPostDiscountsDiscountReq.md | 18 ++--- ...ternal-7.AdminPostDiscountsDiscountRule.md | 10 +-- .../internal-7.AdminPostDiscountsReq.md | 22 +++--- .../internal-7.AdminUpdateDiscountRule.md | 10 +-- .../internal-7.AdminUpsertCondition.md | 4 +- .../internal-8.AdminGetDraftOrdersParams.md | 6 +- ...stDraftOrdersDraftOrderLineItemsItemReq.md | 8 +- ...inPostDraftOrdersDraftOrderLineItemsReq.md | 10 +-- ...nal-8.AdminPostDraftOrdersDraftOrderReq.md | 16 ++-- .../internal-8.AdminPostDraftOrdersReq.md | 22 +++--- .../classes/internal-8.Discount-1.md | 2 +- .../js-client/classes/internal-8.Discount.md | 2 +- .../js-client/classes/internal-8.Item.md | 10 +-- .../classes/internal-8.ShippingMethod.md | 6 +- .../internal-9.AdminGetGiftCardsParams.md | 6 +- ...nternal-9.AdminPostGiftCardsGiftCardReq.md | 10 +-- .../internal-9.AdminPostGiftCardsReq.md | 10 +-- .../js-client/classes/internal.Cart.md | 78 +++++++++---------- .../js-client/classes/internal.Client.md | 18 ++--- ....StorePostCustomersCustomerAddressesReq.md | 2 +- .../js-client/enums/internal.CartType.md | 10 +-- .../js-client/interfaces/internal.Config.md | 8 +- .../interfaces/internal.HTTPResponse.md | 10 +-- .../interfaces/internal.RequestOptions.md | 4 +- .../js-client/modules/internal-10.md | 4 +- .../js-client/modules/internal-13.md | 2 +- .../js-client/modules/internal-15.md | 6 +- .../js-client/modules/internal-17.md | 2 +- .../js-client/modules/internal-21.md | 16 +++- .../js-client/modules/internal-25.md | 13 +--- .../js-client/modules/internal-32.md | 14 ++-- .../js-client/modules/internal-41.md | 2 + .../js-client/modules/internal-42.md | 15 ++-- .../js-client/modules/internal-46.md | 6 +- .../js-client/modules/internal-7.md | 2 +- .../references/js-client/modules/internal.md | 6 +- 283 files changed, 1558 insertions(+), 1344 deletions(-) rename docs/content/references/js-client/classes/{internal-15.AdminUpdatePaymentCollectionRequest.md => internal-15.AdminUpdatePaymentCollectionsReq.md} (80%) create mode 100644 docs/content/references/js-client/classes/internal-21.AdminDeletePublishableApiKeySalesChannelsBatchReq.md create mode 100644 docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeySalesChannelsBatchReq.md create mode 100644 docs/content/references/js-client/classes/internal-21.GetPublishableApiKeySalesChannelsParams.md rename docs/content/references/js-client/classes/{internal-25.ProductBatchSalesChannel.md => internal-21.ProductBatchSalesChannel.md} (68%) create mode 100644 docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerAcceptClaimReq.md create mode 100644 docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerOrderClaimReq.md delete mode 100644 docs/content/references/js-client/classes/internal-42.PaymentCollectionSessionInputRequest.md delete mode 100644 docs/content/references/js-client/classes/internal-42.StoreManagePaymentCollectionSessionRequest.md create mode 100644 docs/content/references/js-client/classes/internal-42.StorePaymentCollectionSessionsReq.md create mode 100644 docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsAuthorizeReq.md create mode 100644 docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsReq.md create mode 100644 docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsSessionsReq.md delete mode 100644 docs/content/references/js-client/classes/internal-42.StoreRefreshPaymentCollectionSessionRequest.md diff --git a/docs/content/references/js-client/classes/AddressesResource.md b/docs/content/references/js-client/classes/AddressesResource.md index 47771aab10121..2467e78c34838 100644 --- a/docs/content/references/js-client/classes/AddressesResource.md +++ b/docs/content/references/js-client/classes/AddressesResource.md @@ -27,7 +27,7 @@ Adds an address to a customers saved addresses #### Defined in -[medusa-js/src/resources/addresses.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/addresses.ts#L16) +[medusa-js/src/resources/addresses.ts:16](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/addresses.ts#L16) ___ @@ -50,7 +50,7 @@ Deletes an address of a customer #### Defined in -[medusa-js/src/resources/addresses.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/addresses.ts#L30) +[medusa-js/src/resources/addresses.ts:30](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/addresses.ts#L30) ___ @@ -74,4 +74,4 @@ Update an address of a customer #### Defined in -[medusa-js/src/resources/addresses.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/addresses.ts#L45) +[medusa-js/src/resources/addresses.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/addresses.ts#L45) diff --git a/docs/content/references/js-client/classes/Admin.md b/docs/content/references/js-client/classes/Admin.md index 9aaf60b0220e3..e5795447313c6 100644 --- a/docs/content/references/js-client/classes/Admin.md +++ b/docs/content/references/js-client/classes/Admin.md @@ -14,7 +14,7 @@ #### Defined in -[medusa-js/src/resources/admin/index.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L37) +[medusa-js/src/resources/admin/index.ts:37](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L37) ___ @@ -24,7 +24,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L38) +[medusa-js/src/resources/admin/index.ts:38](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L38) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L43) +[medusa-js/src/resources/admin/index.ts:43](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L43) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L42) +[medusa-js/src/resources/admin/index.ts:42](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L42) ___ @@ -54,7 +54,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L40) +[medusa-js/src/resources/admin/index.ts:40](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L40) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L39) +[medusa-js/src/resources/admin/index.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L39) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L41) +[medusa-js/src/resources/admin/index.ts:41](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L41) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L44) +[medusa-js/src/resources/admin/index.ts:44](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L44) ___ @@ -94,7 +94,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L45) +[medusa-js/src/resources/admin/index.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L45) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L46) +[medusa-js/src/resources/admin/index.ts:46](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L46) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L47) +[medusa-js/src/resources/admin/index.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L47) ___ @@ -124,7 +124,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L65) +[medusa-js/src/resources/admin/index.ts:65](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L65) ___ @@ -134,7 +134,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L55) +[medusa-js/src/resources/admin/index.ts:55](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L55) ___ @@ -144,7 +144,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L54) +[medusa-js/src/resources/admin/index.ts:54](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L54) ___ @@ -154,7 +154,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:68](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L68) +[medusa-js/src/resources/admin/index.ts:68](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L68) ___ @@ -164,7 +164,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L69) +[medusa-js/src/resources/admin/index.ts:69](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L69) ___ @@ -174,7 +174,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L48) +[medusa-js/src/resources/admin/index.ts:48](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L48) ___ @@ -184,7 +184,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L50) +[medusa-js/src/resources/admin/index.ts:50](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L50) ___ @@ -194,7 +194,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L51) +[medusa-js/src/resources/admin/index.ts:51](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L51) ___ @@ -204,7 +204,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L49) +[medusa-js/src/resources/admin/index.ts:49](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L49) ___ @@ -214,7 +214,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L56) +[medusa-js/src/resources/admin/index.ts:56](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L56) ___ @@ -224,7 +224,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L64) +[medusa-js/src/resources/admin/index.ts:64](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L64) ___ @@ -234,7 +234,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L57) +[medusa-js/src/resources/admin/index.ts:57](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L57) ___ @@ -244,7 +244,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L53) +[medusa-js/src/resources/admin/index.ts:53](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L53) ___ @@ -254,7 +254,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L59) +[medusa-js/src/resources/admin/index.ts:59](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L59) ___ @@ -264,7 +264,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L63) +[medusa-js/src/resources/admin/index.ts:63](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L63) ___ @@ -274,7 +274,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:61](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L61) +[medusa-js/src/resources/admin/index.ts:61](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L61) ___ @@ -284,7 +284,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L62) +[medusa-js/src/resources/admin/index.ts:62](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L62) ___ @@ -294,7 +294,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:60](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L60) +[medusa-js/src/resources/admin/index.ts:60](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L60) ___ @@ -304,7 +304,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L66) +[medusa-js/src/resources/admin/index.ts:66](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L66) ___ @@ -314,7 +314,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:67](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L67) +[medusa-js/src/resources/admin/index.ts:67](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L67) ___ @@ -324,7 +324,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L52) +[medusa-js/src/resources/admin/index.ts:52](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L52) ___ @@ -334,4 +334,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/index.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/index.ts#L58) +[medusa-js/src/resources/admin/index.ts:58](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/index.ts#L58) diff --git a/docs/content/references/js-client/classes/AdminAuthResource.md b/docs/content/references/js-client/classes/AdminAuthResource.md index 2c8e2fde0ecb8..70abc2330165f 100644 --- a/docs/content/references/js-client/classes/AdminAuthResource.md +++ b/docs/content/references/js-client/classes/AdminAuthResource.md @@ -29,7 +29,7 @@ Creates an authenticated session #### Defined in -[medusa-js/src/resources/admin/auth.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/auth.ts#L37) +[medusa-js/src/resources/admin/auth.ts:37](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/auth.ts#L37) ___ @@ -53,7 +53,7 @@ destroys an authenticated session #### Defined in -[medusa-js/src/resources/admin/auth.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/auth.ts#L24) +[medusa-js/src/resources/admin/auth.ts:24](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/auth.ts#L24) ___ @@ -78,4 +78,4 @@ Usually used to check if authenticated session is alive. #### Defined in -[medusa-js/src/resources/admin/auth.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/auth.ts#L12) +[medusa-js/src/resources/admin/auth.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/auth.ts#L12) diff --git a/docs/content/references/js-client/classes/AdminBatchJobsResource.md b/docs/content/references/js-client/classes/AdminBatchJobsResource.md index 374d90b97047f..27b9370a7d42d 100644 --- a/docs/content/references/js-client/classes/AdminBatchJobsResource.md +++ b/docs/content/references/js-client/classes/AdminBatchJobsResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/batch-jobs.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/batch-jobs.ts#L35) +[medusa-js/src/resources/admin/batch-jobs.ts:35](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/batch-jobs.ts#L35) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/batch-jobs.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/batch-jobs.ts#L43) +[medusa-js/src/resources/admin/batch-jobs.ts:43](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/batch-jobs.ts#L43) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/batch-jobs.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/batch-jobs.ts#L13) +[medusa-js/src/resources/admin/batch-jobs.ts:13](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/batch-jobs.ts#L13) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/batch-jobs.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/batch-jobs.ts#L21) +[medusa-js/src/resources/admin/batch-jobs.ts:21](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/batch-jobs.ts#L21) ___ @@ -109,4 +109,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/batch-jobs.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/batch-jobs.ts#L51) +[medusa-js/src/resources/admin/batch-jobs.ts:51](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/batch-jobs.ts#L51) diff --git a/docs/content/references/js-client/classes/AdminCollectionsResource.md b/docs/content/references/js-client/classes/AdminCollectionsResource.md index c90a2b997a899..efd936b0eb8c1 100644 --- a/docs/content/references/js-client/classes/AdminCollectionsResource.md +++ b/docs/content/references/js-client/classes/AdminCollectionsResource.md @@ -30,7 +30,7 @@ Updates products associated with a Product Collection #### Defined in -[medusa-js/src/resources/admin/collections.ts:100](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L100) +[medusa-js/src/resources/admin/collections.ts:100](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L100) ___ @@ -57,7 +57,7 @@ Created collection. #### Defined in -[medusa-js/src/resources/admin/collections.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L22) +[medusa-js/src/resources/admin/collections.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L22) ___ @@ -84,7 +84,7 @@ Deleted response #### Defined in -[medusa-js/src/resources/admin/collections.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L52) +[medusa-js/src/resources/admin/collections.ts:52](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L52) ___ @@ -111,7 +111,7 @@ a list of collections matching the query. #### Defined in -[medusa-js/src/resources/admin/collections.ts:80](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L80) +[medusa-js/src/resources/admin/collections.ts:80](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L80) ___ @@ -137,7 +137,7 @@ Removes products associated with a Product Collection #### Defined in -[medusa-js/src/resources/admin/collections.ts:115](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L115) +[medusa-js/src/resources/admin/collections.ts:115](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L115) ___ @@ -164,7 +164,7 @@ the collection with the given id #### Defined in -[medusa-js/src/resources/admin/collections.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L66) +[medusa-js/src/resources/admin/collections.ts:66](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L66) ___ @@ -192,4 +192,4 @@ the updated collection. #### Defined in -[medusa-js/src/resources/admin/collections.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/collections.ts#L37) +[medusa-js/src/resources/admin/collections.ts:37](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/collections.ts#L37) diff --git a/docs/content/references/js-client/classes/AdminCurrenciesResource.md b/docs/content/references/js-client/classes/AdminCurrenciesResource.md index 222fcdf7a835c..a299e4305d6d5 100644 --- a/docs/content/references/js-client/classes/AdminCurrenciesResource.md +++ b/docs/content/references/js-client/classes/AdminCurrenciesResource.md @@ -33,7 +33,7 @@ the list of currencies as well as the pagination properties. #### Defined in -[medusa-js/src/resources/admin/currencies.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/currencies.ts#L20) +[medusa-js/src/resources/admin/currencies.ts:20](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/currencies.ts#L20) ___ @@ -63,4 +63,4 @@ the updated currency. #### Defined in -[medusa-js/src/resources/admin/currencies.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/currencies.ts#L43) +[medusa-js/src/resources/admin/currencies.ts:43](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/currencies.ts#L43) diff --git a/docs/content/references/js-client/classes/AdminCustomerGroupsResource.md b/docs/content/references/js-client/classes/AdminCustomerGroupsResource.md index cc8625f40320e..ffba8570e764b 100644 --- a/docs/content/references/js-client/classes/AdminCustomerGroupsResource.md +++ b/docs/content/references/js-client/classes/AdminCustomerGroupsResource.md @@ -28,7 +28,7 @@ Add multiple customers to a customer group. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:112](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L112) +[medusa-js/src/resources/admin/customer-groups.ts:112](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L112) ___ @@ -51,7 +51,7 @@ Create a customer group. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L26) +[medusa-js/src/resources/admin/customer-groups.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L26) ___ @@ -74,7 +74,7 @@ Deletes a customer group. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:77](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L77) +[medusa-js/src/resources/admin/customer-groups.ts:77](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L77) ___ @@ -97,7 +97,7 @@ Lists customer groups. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:91](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L91) +[medusa-js/src/resources/admin/customer-groups.ts:91](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L91) ___ @@ -121,7 +121,7 @@ List and count customers that belong to provided customer groups. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:144](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L144) +[medusa-js/src/resources/admin/customer-groups.ts:144](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L144) ___ @@ -145,7 +145,7 @@ Remove multiple customers from a customer group. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:128](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L128) +[medusa-js/src/resources/admin/customer-groups.ts:128](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L128) ___ @@ -169,7 +169,7 @@ Retrieves a customer group. #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L41) +[medusa-js/src/resources/admin/customer-groups.ts:41](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L41) ___ @@ -193,4 +193,4 @@ Updates a customer group #### Defined in -[medusa-js/src/resources/admin/customer-groups.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customer-groups.ts#L62) +[medusa-js/src/resources/admin/customer-groups.ts:62](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customer-groups.ts#L62) diff --git a/docs/content/references/js-client/classes/AdminCustomersResource.md b/docs/content/references/js-client/classes/AdminCustomersResource.md index d7da070e0a0b3..7d213e1b3c88f 100644 --- a/docs/content/references/js-client/classes/AdminCustomersResource.md +++ b/docs/content/references/js-client/classes/AdminCustomersResource.md @@ -27,7 +27,7 @@ Creates a customer #### Defined in -[medusa-js/src/resources/admin/customers.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customers.ts#L18) +[medusa-js/src/resources/admin/customers.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customers.ts#L18) ___ @@ -50,7 +50,7 @@ Lists customers #### Defined in -[medusa-js/src/resources/admin/customers.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customers.ts#L59) +[medusa-js/src/resources/admin/customers.ts:59](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customers.ts#L59) ___ @@ -73,7 +73,7 @@ Retrieves a customer #### Defined in -[medusa-js/src/resources/admin/customers.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customers.ts#L46) +[medusa-js/src/resources/admin/customers.ts:46](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customers.ts#L46) ___ @@ -97,4 +97,4 @@ Updates a customer #### Defined in -[medusa-js/src/resources/admin/customers.ts:32](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/customers.ts#L32) +[medusa-js/src/resources/admin/customers.ts:32](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/customers.ts#L32) diff --git a/docs/content/references/js-client/classes/AdminDiscountsResource.md b/docs/content/references/js-client/classes/AdminDiscountsResource.md index 2f0fcb4204029..9d65bb54abd5c 100644 --- a/docs/content/references/js-client/classes/AdminDiscountsResource.md +++ b/docs/content/references/js-client/classes/AdminDiscountsResource.md @@ -32,7 +32,7 @@ Add a batch of items to a discount condition #### Defined in -[medusa-js/src/resources/admin/discounts.ts:218](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L218) +[medusa-js/src/resources/admin/discounts.ts:218](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L218) ___ @@ -58,7 +58,7 @@ Adds region to discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L27) +[medusa-js/src/resources/admin/discounts.ts:27](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L27) ___ @@ -83,7 +83,7 @@ Creates discounts #### Defined in -[medusa-js/src/resources/admin/discounts.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L39) +[medusa-js/src/resources/admin/discounts.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L39) ___ @@ -110,7 +110,7 @@ creates a discount condition #### Defined in -[medusa-js/src/resources/admin/discounts.ts:148](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L148) +[medusa-js/src/resources/admin/discounts.ts:148](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L148) ___ @@ -136,7 +136,7 @@ Creates a dynamic discount code #### Defined in -[medusa-js/src/resources/admin/discounts.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L62) +[medusa-js/src/resources/admin/discounts.ts:62](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L62) ___ @@ -161,7 +161,7 @@ Deletes a discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:74](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L74) +[medusa-js/src/resources/admin/discounts.ts:74](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L74) ___ @@ -187,7 +187,7 @@ Removes a condition from a discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:187](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L187) +[medusa-js/src/resources/admin/discounts.ts:187](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L187) ___ @@ -214,7 +214,7 @@ Delete a batch of items from a discount condition #### Defined in -[medusa-js/src/resources/admin/discounts.ts:238](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L238) +[medusa-js/src/resources/admin/discounts.ts:238](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L238) ___ @@ -240,7 +240,7 @@ Deletes a dynamic discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:85](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L85) +[medusa-js/src/resources/admin/discounts.ts:85](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L85) ___ @@ -267,7 +267,7 @@ Gets a condition from a discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:199](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L199) +[medusa-js/src/resources/admin/discounts.ts:199](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L199) ___ @@ -292,7 +292,7 @@ Lists discounts #### Defined in -[medusa-js/src/resources/admin/discounts.ts:119](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L119) +[medusa-js/src/resources/admin/discounts.ts:119](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L119) ___ @@ -318,7 +318,7 @@ Removes a region from a discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:136](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L136) +[medusa-js/src/resources/admin/discounts.ts:136](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L136) ___ @@ -343,7 +343,7 @@ Retrieves a discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:97](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L97) +[medusa-js/src/resources/admin/discounts.ts:97](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L97) ___ @@ -368,7 +368,7 @@ Retrieves a discount by code #### Defined in -[medusa-js/src/resources/admin/discounts.ts:108](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L108) +[medusa-js/src/resources/admin/discounts.ts:108](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L108) ___ @@ -394,7 +394,7 @@ Updates discount #### Defined in -[medusa-js/src/resources/admin/discounts.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L50) +[medusa-js/src/resources/admin/discounts.ts:50](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L50) ___ @@ -422,4 +422,4 @@ Updates a discount condition #### Defined in -[medusa-js/src/resources/admin/discounts.ts:167](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/discounts.ts#L167) +[medusa-js/src/resources/admin/discounts.ts:167](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/discounts.ts#L167) diff --git a/docs/content/references/js-client/classes/AdminDraftOrdersResource.md b/docs/content/references/js-client/classes/AdminDraftOrdersResource.md index 7c3ecf74e342e..6ef53273f77e1 100644 --- a/docs/content/references/js-client/classes/AdminDraftOrdersResource.md +++ b/docs/content/references/js-client/classes/AdminDraftOrdersResource.md @@ -30,7 +30,7 @@ Add line item to draft order #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L30) +[medusa-js/src/resources/admin/draft-orders.ts:30](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L30) ___ @@ -55,7 +55,7 @@ Creates a draft order #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L20) +[medusa-js/src/resources/admin/draft-orders.ts:20](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L20) ___ @@ -80,7 +80,7 @@ Delete draft order #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L42) +[medusa-js/src/resources/admin/draft-orders.ts:42](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L42) ___ @@ -105,7 +105,7 @@ Lists draft orders #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:76](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L76) +[medusa-js/src/resources/admin/draft-orders.ts:76](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L76) ___ @@ -130,7 +130,7 @@ Mark a draft order as paid #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:93](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L93) +[medusa-js/src/resources/admin/draft-orders.ts:93](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L93) ___ @@ -156,7 +156,7 @@ Remove line item #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L53) +[medusa-js/src/resources/admin/draft-orders.ts:53](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L53) ___ @@ -181,7 +181,7 @@ Retrieves a draft order #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L65) +[medusa-js/src/resources/admin/draft-orders.ts:65](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L65) ___ @@ -207,7 +207,7 @@ Update draft order #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L104) +[medusa-js/src/resources/admin/draft-orders.ts:104](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L104) ___ @@ -234,4 +234,4 @@ Update draft order line item #### Defined in -[medusa-js/src/resources/admin/draft-orders.ts:116](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/draft-orders.ts#L116) +[medusa-js/src/resources/admin/draft-orders.ts:116](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/draft-orders.ts#L116) diff --git a/docs/content/references/js-client/classes/AdminGiftCardsResource.md b/docs/content/references/js-client/classes/AdminGiftCardsResource.md index f98ec82671287..860234cee7a07 100644 --- a/docs/content/references/js-client/classes/AdminGiftCardsResource.md +++ b/docs/content/references/js-client/classes/AdminGiftCardsResource.md @@ -29,7 +29,7 @@ Creates a gift card #### Defined in -[medusa-js/src/resources/admin/gift-cards.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/gift-cards.ts#L17) +[medusa-js/src/resources/admin/gift-cards.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/gift-cards.ts#L17) ___ @@ -54,7 +54,7 @@ Deletes a gift card #### Defined in -[medusa-js/src/resources/admin/gift-cards.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/gift-cards.ts#L40) +[medusa-js/src/resources/admin/gift-cards.ts:40](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/gift-cards.ts#L40) ___ @@ -79,7 +79,7 @@ Lists gift cards #### Defined in -[medusa-js/src/resources/admin/gift-cards.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/gift-cards.ts#L62) +[medusa-js/src/resources/admin/gift-cards.ts:62](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/gift-cards.ts#L62) ___ @@ -104,7 +104,7 @@ Deletes a gift card #### Defined in -[medusa-js/src/resources/admin/gift-cards.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/gift-cards.ts#L51) +[medusa-js/src/resources/admin/gift-cards.ts:51](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/gift-cards.ts#L51) ___ @@ -130,4 +130,4 @@ Updates a gift card #### Defined in -[medusa-js/src/resources/admin/gift-cards.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/gift-cards.ts#L28) +[medusa-js/src/resources/admin/gift-cards.ts:28](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/gift-cards.ts#L28) diff --git a/docs/content/references/js-client/classes/AdminInvitesResource.md b/docs/content/references/js-client/classes/AdminInvitesResource.md index 62bfd9a472267..3bfc25028cb07 100644 --- a/docs/content/references/js-client/classes/AdminInvitesResource.md +++ b/docs/content/references/js-client/classes/AdminInvitesResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/invites.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/invites.ts#L10) +[medusa-js/src/resources/admin/invites.ts:10](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/invites.ts#L10) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/invites.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/invites.ts#L18) +[medusa-js/src/resources/admin/invites.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/invites.ts#L18) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/invites.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/invites.ts#L26) +[medusa-js/src/resources/admin/invites.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/invites.ts#L26) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/invites.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/invites.ts#L34) +[medusa-js/src/resources/admin/invites.ts:34](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/invites.ts#L34) ___ @@ -108,4 +108,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/invites.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/invites.ts#L41) +[medusa-js/src/resources/admin/invites.ts:41](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/invites.ts#L41) diff --git a/docs/content/references/js-client/classes/AdminNotesResource.md b/docs/content/references/js-client/classes/AdminNotesResource.md index 3e86232df8aa3..03d23fd8523ec 100644 --- a/docs/content/references/js-client/classes/AdminNotesResource.md +++ b/docs/content/references/js-client/classes/AdminNotesResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/notes.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notes.ts#L14) +[medusa-js/src/resources/admin/notes.ts:14](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notes.ts#L14) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/notes.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notes.ts#L31) +[medusa-js/src/resources/admin/notes.ts:31](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notes.ts#L31) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/notes.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notes.ts#L47) +[medusa-js/src/resources/admin/notes.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notes.ts#L47) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/notes.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notes.ts#L39) +[medusa-js/src/resources/admin/notes.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notes.ts#L39) ___ @@ -110,4 +110,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/notes.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notes.ts#L22) +[medusa-js/src/resources/admin/notes.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notes.ts#L22) diff --git a/docs/content/references/js-client/classes/AdminNotificationsResource.md b/docs/content/references/js-client/classes/AdminNotificationsResource.md index 0e915f05ae8cd..be6690a33b841 100644 --- a/docs/content/references/js-client/classes/AdminNotificationsResource.md +++ b/docs/content/references/js-client/classes/AdminNotificationsResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/notifications.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notifications.ts#L12) +[medusa-js/src/resources/admin/notifications.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notifications.ts#L12) ___ @@ -47,4 +47,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/notifications.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/notifications.ts#L26) +[medusa-js/src/resources/admin/notifications.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/notifications.ts#L26) diff --git a/docs/content/references/js-client/classes/AdminOrderEditsResource.md b/docs/content/references/js-client/classes/AdminOrderEditsResource.md index 7456c2b5feaef..6e1b2ad71bbb7 100644 --- a/docs/content/references/js-client/classes/AdminOrderEditsResource.md +++ b/docs/content/references/js-client/classes/AdminOrderEditsResource.md @@ -26,7 +26,7 @@ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:72](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L72) +[medusa-js/src/resources/admin/order-edits.ts:72](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L72) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:98](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L98) +[medusa-js/src/resources/admin/order-edits.ts:98](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L98) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L106) +[medusa-js/src/resources/admin/order-edits.ts:106](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L106) ___ @@ -89,7 +89,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L47) +[medusa-js/src/resources/admin/order-edits.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L47) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L64) +[medusa-js/src/resources/admin/order-edits.ts:64](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L64) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L81) +[medusa-js/src/resources/admin/order-edits.ts:81](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L81) ___ @@ -153,7 +153,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L33) +[medusa-js/src/resources/admin/order-edits.ts:33](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L33) ___ @@ -175,7 +175,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:124](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L124) +[medusa-js/src/resources/admin/order-edits.ts:124](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L124) ___ @@ -196,7 +196,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:90](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L90) +[medusa-js/src/resources/admin/order-edits.ts:90](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L90) ___ @@ -218,7 +218,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L18) +[medusa-js/src/resources/admin/order-edits.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L18) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L55) +[medusa-js/src/resources/admin/order-edits.ts:55](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L55) ___ @@ -263,4 +263,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/order-edits.ts:114](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/order-edits.ts#L114) +[medusa-js/src/resources/admin/order-edits.ts:114](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/order-edits.ts#L114) diff --git a/docs/content/references/js-client/classes/AdminOrdersResource.md b/docs/content/references/js-client/classes/AdminOrdersResource.md index cbda96e7ce57b..e7be102637079 100644 --- a/docs/content/references/js-client/classes/AdminOrdersResource.md +++ b/docs/content/references/js-client/classes/AdminOrdersResource.md @@ -26,7 +26,7 @@ #### Defined in -[medusa-js/src/resources/admin/orders.ts:152](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L152) +[medusa-js/src/resources/admin/orders.ts:152](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L152) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:161](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L161) +[medusa-js/src/resources/admin/orders.ts:161](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L161) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:144](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L144) +[medusa-js/src/resources/admin/orders.ts:144](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L144) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:225](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L225) +[medusa-js/src/resources/admin/orders.ts:225](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L225) ___ @@ -113,7 +113,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:116](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L116) +[medusa-js/src/resources/admin/orders.ts:116](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L116) ___ @@ -135,7 +135,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:97](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L97) +[medusa-js/src/resources/admin/orders.ts:97](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L97) ___ @@ -157,7 +157,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:178](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L178) +[medusa-js/src/resources/admin/orders.ts:178](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L178) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L106) +[medusa-js/src/resources/admin/orders.ts:106](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L106) ___ @@ -201,7 +201,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:71](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L71) +[medusa-js/src/resources/admin/orders.ts:71](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L71) ___ @@ -222,7 +222,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L63) +[medusa-js/src/resources/admin/orders.ts:63](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L63) ___ @@ -244,7 +244,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:216](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L216) +[medusa-js/src/resources/admin/orders.ts:216](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L216) ___ @@ -267,7 +267,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:254](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L254) +[medusa-js/src/resources/admin/orders.ts:254](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L254) ___ @@ -289,7 +289,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:88](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L88) +[medusa-js/src/resources/admin/orders.ts:88](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L88) ___ @@ -311,7 +311,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:126](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L126) +[medusa-js/src/resources/admin/orders.ts:126](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L126) ___ @@ -333,7 +333,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:169](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L169) +[medusa-js/src/resources/admin/orders.ts:169](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L169) ___ @@ -356,7 +356,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:197](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L197) +[medusa-js/src/resources/admin/orders.ts:197](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L197) ___ @@ -379,7 +379,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:244](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L244) +[medusa-js/src/resources/admin/orders.ts:244](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L244) ___ @@ -402,7 +402,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:187](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L187) +[medusa-js/src/resources/admin/orders.ts:187](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L187) ___ @@ -423,7 +423,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L49) +[medusa-js/src/resources/admin/orders.ts:49](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L49) ___ @@ -445,7 +445,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:207](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L207) +[medusa-js/src/resources/admin/orders.ts:207](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L207) ___ @@ -467,7 +467,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:79](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L79) +[medusa-js/src/resources/admin/orders.ts:79](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L79) ___ @@ -489,7 +489,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:135](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L135) +[medusa-js/src/resources/admin/orders.ts:135](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L135) ___ @@ -511,7 +511,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L34) +[medusa-js/src/resources/admin/orders.ts:34](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L34) ___ @@ -533,7 +533,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L25) +[medusa-js/src/resources/admin/orders.ts:25](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L25) ___ @@ -556,4 +556,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/orders.ts:234](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/orders.ts#L234) +[medusa-js/src/resources/admin/orders.ts:234](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/orders.ts#L234) diff --git a/docs/content/references/js-client/classes/AdminPaymentCollectionsResource.md b/docs/content/references/js-client/classes/AdminPaymentCollectionsResource.md index a6f6377c6ce0b..466a7a868e55f 100644 --- a/docs/content/references/js-client/classes/AdminPaymentCollectionsResource.md +++ b/docs/content/references/js-client/classes/AdminPaymentCollectionsResource.md @@ -25,13 +25,13 @@ #### Defined in -[medusa-js/src/resources/admin/payment-collections.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payment-collections.ts#L36) +[medusa-js/src/resources/admin/payment-collections.ts:36](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payment-collections.ts#L36) ___ ### markAsAuthorized -▸ **markAsAuthorized**(`id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionRes`](../modules/internal-15.md#adminpaymentcollectionres)\> +▸ **markAsAuthorized**(`id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionsRes`](../modules/internal-15.md#adminpaymentcollectionsres)\> #### Parameters @@ -42,17 +42,17 @@ ___ #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionRes`](../modules/internal-15.md#adminpaymentcollectionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionsRes`](../modules/internal-15.md#adminpaymentcollectionsres)\> #### Defined in -[medusa-js/src/resources/admin/payment-collections.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payment-collections.ts#L44) +[medusa-js/src/resources/admin/payment-collections.ts:44](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payment-collections.ts#L44) ___ ### retrieve -▸ **retrieve**(`id`, `query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionRes`](../modules/internal-15.md#adminpaymentcollectionres)\> +▸ **retrieve**(`id`, `query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionsRes`](../modules/internal-15.md#adminpaymentcollectionsres)\> #### Parameters @@ -64,30 +64,30 @@ ___ #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionRes`](../modules/internal-15.md#adminpaymentcollectionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionsRes`](../modules/internal-15.md#adminpaymentcollectionsres)\> #### Defined in -[medusa-js/src/resources/admin/payment-collections.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payment-collections.ts#L12) +[medusa-js/src/resources/admin/payment-collections.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payment-collections.ts#L12) ___ ### update -▸ **update**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionRes`](../modules/internal-15.md#adminpaymentcollectionres)\> +▸ **update**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionsRes`](../modules/internal-15.md#adminpaymentcollectionsres)\> #### Parameters | Name | Type | | :------ | :------ | | `id` | `string` | -| `payload` | [`AdminUpdatePaymentCollectionRequest`](internal-15.AdminUpdatePaymentCollectionRequest.md) | +| `payload` | [`AdminUpdatePaymentCollectionsReq`](internal-15.AdminUpdatePaymentCollectionsReq.md) | | `customHeaders` | `Record`<`string`, `any`\> | #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionRes`](../modules/internal-15.md#adminpaymentcollectionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPaymentCollectionsRes`](../modules/internal-15.md#adminpaymentcollectionsres)\> #### Defined in -[medusa-js/src/resources/admin/payment-collections.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payment-collections.ts#L27) +[medusa-js/src/resources/admin/payment-collections.ts:27](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payment-collections.ts#L27) diff --git a/docs/content/references/js-client/classes/AdminPaymentsResource.md b/docs/content/references/js-client/classes/AdminPaymentsResource.md index 3da504f9ed7f7..bbc0f3282a825 100644 --- a/docs/content/references/js-client/classes/AdminPaymentsResource.md +++ b/docs/content/references/js-client/classes/AdminPaymentsResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/payments.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payments.ts#L27) +[medusa-js/src/resources/admin/payments.ts:27](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payments.ts#L27) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/payments.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payments.ts#L35) +[medusa-js/src/resources/admin/payments.ts:35](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payments.ts#L35) ___ @@ -69,4 +69,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/payments.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/payments.ts#L12) +[medusa-js/src/resources/admin/payments.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/payments.ts#L12) diff --git a/docs/content/references/js-client/classes/AdminPriceListResource.md b/docs/content/references/js-client/classes/AdminPriceListResource.md index 79205119cc293..c888fd60bc429 100644 --- a/docs/content/references/js-client/classes/AdminPriceListResource.md +++ b/docs/content/references/js-client/classes/AdminPriceListResource.md @@ -26,7 +26,7 @@ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:80](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L80) +[medusa-js/src/resources/admin/price-lists.ts:80](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L80) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L18) +[medusa-js/src/resources/admin/price-lists.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L18) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L35) +[medusa-js/src/resources/admin/price-lists.ts:35](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L35) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:89](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L89) +[medusa-js/src/resources/admin/price-lists.ts:89](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L89) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:98](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L98) +[medusa-js/src/resources/admin/price-lists.ts:98](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L98) ___ @@ -134,7 +134,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L107) +[medusa-js/src/resources/admin/price-lists.ts:107](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L107) ___ @@ -155,7 +155,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L51) +[medusa-js/src/resources/admin/price-lists.ts:51](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L51) ___ @@ -177,7 +177,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L65) +[medusa-js/src/resources/admin/price-lists.ts:65](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L65) ___ @@ -198,7 +198,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L43) +[medusa-js/src/resources/admin/price-lists.ts:43](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L43) ___ @@ -220,4 +220,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/price-lists.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/price-lists.ts#L26) +[medusa-js/src/resources/admin/price-lists.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/price-lists.ts#L26) diff --git a/docs/content/references/js-client/classes/AdminProductTagsResource.md b/docs/content/references/js-client/classes/AdminProductTagsResource.md index aa3bba170579f..e61fa2af38093 100644 --- a/docs/content/references/js-client/classes/AdminProductTagsResource.md +++ b/docs/content/references/js-client/classes/AdminProductTagsResource.md @@ -24,4 +24,4 @@ #### Defined in -[medusa-js/src/resources/admin/product-tags.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/product-tags.ts#L10) +[medusa-js/src/resources/admin/product-tags.ts:10](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/product-tags.ts#L10) diff --git a/docs/content/references/js-client/classes/AdminProductTypesResource.md b/docs/content/references/js-client/classes/AdminProductTypesResource.md index dbb974f7e0a97..4ebaf4d62f8fc 100644 --- a/docs/content/references/js-client/classes/AdminProductTypesResource.md +++ b/docs/content/references/js-client/classes/AdminProductTypesResource.md @@ -25,4 +25,4 @@ #### Defined in -[medusa-js/src/resources/admin/product-types.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/product-types.ts#L10) +[medusa-js/src/resources/admin/product-types.ts:10](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/product-types.ts#L10) diff --git a/docs/content/references/js-client/classes/AdminProductsResource.md b/docs/content/references/js-client/classes/AdminProductsResource.md index 8523a3ac1aea1..a88d2dafb0a3c 100644 --- a/docs/content/references/js-client/classes/AdminProductsResource.md +++ b/docs/content/references/js-client/classes/AdminProductsResource.md @@ -26,7 +26,7 @@ #### Defined in -[medusa-js/src/resources/admin/products.ts:124](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L124) +[medusa-js/src/resources/admin/products.ts:124](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L124) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L23) +[medusa-js/src/resources/admin/products.ts:23](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L23) ___ @@ -69,7 +69,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:96](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L96) +[medusa-js/src/resources/admin/products.ts:96](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L96) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L48) +[medusa-js/src/resources/admin/products.ts:48](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L48) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:143](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L143) +[medusa-js/src/resources/admin/products.ts:143](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L143) ___ @@ -134,7 +134,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:115](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L115) +[medusa-js/src/resources/admin/products.ts:115](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L115) ___ @@ -155,7 +155,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L56) +[medusa-js/src/resources/admin/products.ts:56](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L56) ___ @@ -175,7 +175,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:80](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L80) +[medusa-js/src/resources/admin/products.ts:80](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L80) ___ @@ -199,7 +199,7 @@ Use [list](AdminProductTypesResource.md#list) instead. #### Defined in -[medusa-js/src/resources/admin/products.ts:73](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L73) +[medusa-js/src/resources/admin/products.ts:73](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L73) ___ @@ -220,7 +220,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L31) +[medusa-js/src/resources/admin/products.ts:31](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L31) ___ @@ -242,7 +242,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:87](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L87) +[medusa-js/src/resources/admin/products.ts:87](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L87) ___ @@ -264,7 +264,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L39) +[medusa-js/src/resources/admin/products.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L39) ___ @@ -287,7 +287,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:133](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L133) +[medusa-js/src/resources/admin/products.ts:133](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L133) ___ @@ -310,4 +310,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/products.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/products.ts#L105) +[medusa-js/src/resources/admin/products.ts:105](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/products.ts#L105) diff --git a/docs/content/references/js-client/classes/AdminPublishableApiKeyResource.md b/docs/content/references/js-client/classes/AdminPublishableApiKeyResource.md index 5071a084171f3..25098390c9905 100644 --- a/docs/content/references/js-client/classes/AdminPublishableApiKeyResource.md +++ b/docs/content/references/js-client/classes/AdminPublishableApiKeyResource.md @@ -8,6 +8,28 @@ ## Methods +### addSalesChannelsBatch + +▸ **addSalesChannelsBatch**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPublishableApiKeysRes`](../modules/internal-21.md#adminpublishableapikeysres)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | +| `payload` | [`AdminPostPublishableApiKeySalesChannelsBatchReq`](internal-21.AdminPostPublishableApiKeySalesChannelsBatchReq.md) | +| `customHeaders` | `Record`<`string`, `any`\> | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPublishableApiKeysRes`](../modules/internal-21.md#adminpublishableapikeysres)\> + +#### Defined in + +[medusa-js/src/resources/admin/publishable-api-keys.ts:82](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L82) + +___ + ### create ▸ **create**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPublishableApiKeysRes`](../modules/internal-21.md#adminpublishableapikeysres)\> @@ -25,7 +47,7 @@ #### Defined in -[medusa-js/src/resources/admin/publishable-api-keys.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L45) +[medusa-js/src/resources/admin/publishable-api-keys.ts:49](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L49) ___ @@ -46,7 +68,29 @@ ___ #### Defined in -[medusa-js/src/resources/admin/publishable-api-keys.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L62) +[medusa-js/src/resources/admin/publishable-api-keys.ts:66](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L66) + +___ + +### deleteSalesChannelsBatch + +▸ **deleteSalesChannelsBatch**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPublishableApiKeysRes`](../modules/internal-21.md#adminpublishableapikeysres)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | +| `payload` | [`AdminDeletePublishableApiKeySalesChannelsBatchReq`](internal-21.AdminDeletePublishableApiKeySalesChannelsBatchReq.md) | +| `customHeaders` | `Record`<`string`, `any`\> | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminPublishableApiKeysRes`](../modules/internal-21.md#adminpublishableapikeysres)\> + +#### Defined in + +[medusa-js/src/resources/admin/publishable-api-keys.ts:91](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L91) ___ @@ -67,7 +111,29 @@ ___ #### Defined in -[medusa-js/src/resources/admin/publishable-api-keys.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L31) +[medusa-js/src/resources/admin/publishable-api-keys.ts:35](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L35) + +___ + +### listSalesChannels + +▸ **listSalesChannels**(`id`, `query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminSalesChannelsListRes`](../modules/internal-21.md#adminsaleschannelslistres)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | +| `query?` | [`GetPublishableApiKeySalesChannelsParams`](internal-21.GetPublishableApiKeySalesChannelsParams.md) | +| `customHeaders` | `Record`<`string`, `any`\> | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminSalesChannelsListRes`](../modules/internal-21.md#adminsaleschannelslistres)\> + +#### Defined in + +[medusa-js/src/resources/admin/publishable-api-keys.ts:100](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L100) ___ @@ -89,7 +155,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/publishable-api-keys.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L16) +[medusa-js/src/resources/admin/publishable-api-keys.ts:20](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L20) ___ @@ -110,7 +176,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/publishable-api-keys.ts:70](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L70) +[medusa-js/src/resources/admin/publishable-api-keys.ts:74](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L74) ___ @@ -132,4 +198,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/publishable-api-keys.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L53) +[medusa-js/src/resources/admin/publishable-api-keys.ts:57](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/publishable-api-keys.ts#L57) diff --git a/docs/content/references/js-client/classes/AdminRegionsResource.md b/docs/content/references/js-client/classes/AdminRegionsResource.md index 986c5c132df0b..04d6db32c20d9 100644 --- a/docs/content/references/js-client/classes/AdminRegionsResource.md +++ b/docs/content/references/js-client/classes/AdminRegionsResource.md @@ -32,7 +32,7 @@ updated region #### Defined in -[medusa-js/src/resources/admin/regions.ts:103](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L103) +[medusa-js/src/resources/admin/regions.ts:103](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L103) ___ @@ -60,7 +60,7 @@ updated region #### Defined in -[medusa-js/src/resources/admin/regions.ts:135](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L135) +[medusa-js/src/resources/admin/regions.ts:135](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L135) ___ @@ -88,7 +88,7 @@ updated region #### Defined in -[medusa-js/src/resources/admin/regions.ts:181](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L181) +[medusa-js/src/resources/admin/regions.ts:181](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L181) ___ @@ -115,7 +115,7 @@ created region. #### Defined in -[medusa-js/src/resources/admin/regions.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L24) +[medusa-js/src/resources/admin/regions.ts:24](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L24) ___ @@ -142,7 +142,7 @@ Deleted response #### Defined in -[medusa-js/src/resources/admin/regions.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L54) +[medusa-js/src/resources/admin/regions.ts:54](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L54) ___ @@ -170,7 +170,7 @@ updated region #### Defined in -[medusa-js/src/resources/admin/regions.ts:119](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L119) +[medusa-js/src/resources/admin/regions.ts:119](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L119) ___ @@ -198,7 +198,7 @@ updated region #### Defined in -[medusa-js/src/resources/admin/regions.ts:151](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L151) +[medusa-js/src/resources/admin/regions.ts:151](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L151) ___ @@ -226,7 +226,7 @@ updated region #### Defined in -[medusa-js/src/resources/admin/regions.ts:197](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L197) +[medusa-js/src/resources/admin/regions.ts:197](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L197) ___ @@ -253,7 +253,7 @@ a list of regions matching the query. #### Defined in -[medusa-js/src/resources/admin/regions.ts:82](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L82) +[medusa-js/src/resources/admin/regions.ts:82](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L82) ___ @@ -280,7 +280,7 @@ the region with the given id #### Defined in -[medusa-js/src/resources/admin/regions.ts:68](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L68) +[medusa-js/src/resources/admin/regions.ts:68](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L68) ___ @@ -307,7 +307,7 @@ list of fulfillment options #### Defined in -[medusa-js/src/resources/admin/regions.ts:166](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L166) +[medusa-js/src/resources/admin/regions.ts:166](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L166) ___ @@ -335,4 +335,4 @@ the updated region. #### Defined in -[medusa-js/src/resources/admin/regions.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/regions.ts#L39) +[medusa-js/src/resources/admin/regions.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/regions.ts#L39) diff --git a/docs/content/references/js-client/classes/AdminReturnReasonsResource.md b/docs/content/references/js-client/classes/AdminReturnReasonsResource.md index e622d9851fcbc..d40c01c5cbf40 100644 --- a/docs/content/references/js-client/classes/AdminReturnReasonsResource.md +++ b/docs/content/references/js-client/classes/AdminReturnReasonsResource.md @@ -31,7 +31,7 @@ Created return reason. #### Defined in -[medusa-js/src/resources/admin/return-reasons.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/return-reasons.ts#L18) +[medusa-js/src/resources/admin/return-reasons.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/return-reasons.ts#L18) ___ @@ -58,7 +58,7 @@ Deleted response #### Defined in -[medusa-js/src/resources/admin/return-reasons.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/return-reasons.ts#L48) +[medusa-js/src/resources/admin/return-reasons.ts:48](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/return-reasons.ts#L48) ___ @@ -84,7 +84,7 @@ a list of return reasons matching the query. #### Defined in -[medusa-js/src/resources/admin/return-reasons.ts:75](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/return-reasons.ts#L75) +[medusa-js/src/resources/admin/return-reasons.ts:75](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/return-reasons.ts#L75) ___ @@ -111,7 +111,7 @@ the return reason with the given id #### Defined in -[medusa-js/src/resources/admin/return-reasons.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/return-reasons.ts#L62) +[medusa-js/src/resources/admin/return-reasons.ts:62](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/return-reasons.ts#L62) ___ @@ -139,4 +139,4 @@ the updated return reason. #### Defined in -[medusa-js/src/resources/admin/return-reasons.ts:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/return-reasons.ts#L33) +[medusa-js/src/resources/admin/return-reasons.ts:33](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/return-reasons.ts#L33) diff --git a/docs/content/references/js-client/classes/AdminReturnsResource.md b/docs/content/references/js-client/classes/AdminReturnsResource.md index 1bdb629d65b8f..e9925f106bd8b 100644 --- a/docs/content/references/js-client/classes/AdminReturnsResource.md +++ b/docs/content/references/js-client/classes/AdminReturnsResource.md @@ -31,7 +31,7 @@ the order for which the return was canceled #### Defined in -[medusa-js/src/resources/admin/returns.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/returns.ts#L19) +[medusa-js/src/resources/admin/returns.ts:19](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/returns.ts#L19) ___ @@ -58,7 +58,7 @@ a list of returns matching the query #### Defined in -[medusa-js/src/resources/admin/returns.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/returns.ts#L49) +[medusa-js/src/resources/admin/returns.ts:49](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/returns.ts#L49) ___ @@ -86,4 +86,4 @@ the return #### Defined in -[medusa-js/src/resources/admin/returns.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/returns.ts#L34) +[medusa-js/src/resources/admin/returns.ts:34](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/returns.ts#L34) diff --git a/docs/content/references/js-client/classes/AdminSalesChannelsResource.md b/docs/content/references/js-client/classes/AdminSalesChannelsResource.md index b52942742d713..6ea13bc169257 100644 --- a/docs/content/references/js-client/classes/AdminSalesChannelsResource.md +++ b/docs/content/references/js-client/classes/AdminSalesChannelsResource.md @@ -36,7 +36,7 @@ a medusa sales channel #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:116](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L116) +[medusa-js/src/resources/admin/sales-channels.ts:116](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L116) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L34) +[medusa-js/src/resources/admin/sales-channels.ts:34](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L34) ___ @@ -88,13 +88,13 @@ an deletion result #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:85](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L85) +[medusa-js/src/resources/admin/sales-channels.ts:85](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L85) ___ ### list -▸ **list**(`query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminSalesChannelsListRes`](../modules/internal-25.md#adminsaleschannelslistres)\> +▸ **list**(`query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminSalesChannelsListRes`](../modules/internal-21.md#adminsaleschannelslistres)\> Retrieve a list of sales channels This feature is under development and may change in the future. @@ -113,13 +113,13 @@ Retrieve a list of sales channels #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminSalesChannelsListRes`](../modules/internal-25.md#adminsaleschannelslistres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminSalesChannelsListRes`](../modules/internal-21.md#adminsaleschannelslistres)\> the list of sales channel as well as the pagination properties #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L64) +[medusa-js/src/resources/admin/sales-channels.ts:64](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L64) ___ @@ -151,7 +151,7 @@ a medusa sales channel #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:100](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L100) +[medusa-js/src/resources/admin/sales-channels.ts:100](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L100) ___ @@ -182,7 +182,7 @@ a medusa sales channel #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L22) +[medusa-js/src/resources/admin/sales-channels.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L22) ___ @@ -214,4 +214,4 @@ the updated medusa sales channel #### Defined in -[medusa-js/src/resources/admin/sales-channels.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/sales-channels.ts#L48) +[medusa-js/src/resources/admin/sales-channels.ts:48](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/sales-channels.ts#L48) diff --git a/docs/content/references/js-client/classes/AdminShippingOptionsResource.md b/docs/content/references/js-client/classes/AdminShippingOptionsResource.md index bd8b156da90e3..abaf96630a16c 100644 --- a/docs/content/references/js-client/classes/AdminShippingOptionsResource.md +++ b/docs/content/references/js-client/classes/AdminShippingOptionsResource.md @@ -31,7 +31,7 @@ created shipping option. #### Defined in -[medusa-js/src/resources/admin/shipping-options.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-options.ts#L20) +[medusa-js/src/resources/admin/shipping-options.ts:20](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-options.ts#L20) ___ @@ -58,7 +58,7 @@ deleted response #### Defined in -[medusa-js/src/resources/admin/shipping-options.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-options.ts#L50) +[medusa-js/src/resources/admin/shipping-options.ts:50](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-options.ts#L50) ___ @@ -85,7 +85,7 @@ a list of shipping options matching the query. #### Defined in -[medusa-js/src/resources/admin/shipping-options.ts:78](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-options.ts#L78) +[medusa-js/src/resources/admin/shipping-options.ts:78](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-options.ts#L78) ___ @@ -112,7 +112,7 @@ the shipping option with the given id #### Defined in -[medusa-js/src/resources/admin/shipping-options.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-options.ts#L64) +[medusa-js/src/resources/admin/shipping-options.ts:64](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-options.ts#L64) ___ @@ -140,4 +140,4 @@ the updated shipping option. #### Defined in -[medusa-js/src/resources/admin/shipping-options.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-options.ts#L35) +[medusa-js/src/resources/admin/shipping-options.ts:35](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-options.ts#L35) diff --git a/docs/content/references/js-client/classes/AdminShippingProfilesResource.md b/docs/content/references/js-client/classes/AdminShippingProfilesResource.md index c8594bdc8d903..709c312d7fb9e 100644 --- a/docs/content/references/js-client/classes/AdminShippingProfilesResource.md +++ b/docs/content/references/js-client/classes/AdminShippingProfilesResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/shipping-profiles.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L12) +[medusa-js/src/resources/admin/shipping-profiles.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L12) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/shipping-profiles.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L29) +[medusa-js/src/resources/admin/shipping-profiles.ts:29](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L29) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/shipping-profiles.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L45) +[medusa-js/src/resources/admin/shipping-profiles.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L45) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/shipping-profiles.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L37) +[medusa-js/src/resources/admin/shipping-profiles.ts:37](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L37) ___ @@ -109,4 +109,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/shipping-profiles.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L20) +[medusa-js/src/resources/admin/shipping-profiles.ts:20](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/shipping-profiles.ts#L20) diff --git a/docs/content/references/js-client/classes/AdminStoresResource.md b/docs/content/references/js-client/classes/AdminStoresResource.md index 6a18b4d5cbddb..d560d7ba130c4 100644 --- a/docs/content/references/js-client/classes/AdminStoresResource.md +++ b/docs/content/references/js-client/classes/AdminStoresResource.md @@ -31,7 +31,7 @@ updated store. #### Defined in -[medusa-js/src/resources/admin/store.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/store.ts#L31) +[medusa-js/src/resources/admin/store.ts:31](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/store.ts#L31) ___ @@ -58,7 +58,7 @@ updated store #### Defined in -[medusa-js/src/resources/admin/store.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/store.ts#L45) +[medusa-js/src/resources/admin/store.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/store.ts#L45) ___ @@ -84,7 +84,7 @@ a list of payment providers configured on the store #### Defined in -[medusa-js/src/resources/admin/store.ts:68](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/store.ts#L68) +[medusa-js/src/resources/admin/store.ts:68](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/store.ts#L68) ___ @@ -110,7 +110,7 @@ a list of payment providers configured on the store #### Defined in -[medusa-js/src/resources/admin/store.ts:79](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/store.ts#L79) +[medusa-js/src/resources/admin/store.ts:79](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/store.ts#L79) ___ @@ -136,7 +136,7 @@ a medusa store #### Defined in -[medusa-js/src/resources/admin/store.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/store.ts#L57) +[medusa-js/src/resources/admin/store.ts:57](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/store.ts#L57) ___ @@ -163,4 +163,4 @@ the updated store. #### Defined in -[medusa-js/src/resources/admin/store.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/store.ts#L17) +[medusa-js/src/resources/admin/store.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/store.ts#L17) diff --git a/docs/content/references/js-client/classes/AdminSwapsResource.md b/docs/content/references/js-client/classes/AdminSwapsResource.md index 183cb32468b89..50b5001b524be 100644 --- a/docs/content/references/js-client/classes/AdminSwapsResource.md +++ b/docs/content/references/js-client/classes/AdminSwapsResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/admin/swaps.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/swaps.ts#L19) +[medusa-js/src/resources/admin/swaps.ts:19](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/swaps.ts#L19) ___ @@ -46,4 +46,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/swaps.ts:11](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/swaps.ts#L11) +[medusa-js/src/resources/admin/swaps.ts:11](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/swaps.ts#L11) diff --git a/docs/content/references/js-client/classes/AdminTaxRatesResource.md b/docs/content/references/js-client/classes/AdminTaxRatesResource.md index b464c837df43f..5f9f189e9ab5c 100644 --- a/docs/content/references/js-client/classes/AdminTaxRatesResource.md +++ b/docs/content/references/js-client/classes/AdminTaxRatesResource.md @@ -27,7 +27,7 @@ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:100](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L100) +[medusa-js/src/resources/admin/tax-rates.ts:100](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L100) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:84](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L84) +[medusa-js/src/resources/admin/tax-rates.ts:84](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L84) ___ @@ -73,7 +73,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:116](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L116) +[medusa-js/src/resources/admin/tax-rates.ts:116](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L116) ___ @@ -95,7 +95,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L53) +[medusa-js/src/resources/admin/tax-rates.ts:53](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L53) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:180](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L180) +[medusa-js/src/resources/admin/tax-rates.ts:180](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L180) ___ @@ -137,7 +137,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L39) +[medusa-js/src/resources/admin/tax-rates.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L39) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:148](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L148) +[medusa-js/src/resources/admin/tax-rates.ts:148](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L148) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:132](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L132) +[medusa-js/src/resources/admin/tax-rates.ts:132](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L132) ___ @@ -206,7 +206,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:164](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L164) +[medusa-js/src/resources/admin/tax-rates.ts:164](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L164) ___ @@ -228,7 +228,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L24) +[medusa-js/src/resources/admin/tax-rates.ts:24](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L24) ___ @@ -251,4 +251,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/tax-rates.ts:68](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/tax-rates.ts#L68) +[medusa-js/src/resources/admin/tax-rates.ts:68](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/tax-rates.ts#L68) diff --git a/docs/content/references/js-client/classes/AdminUploadsResource.md b/docs/content/references/js-client/classes/AdminUploadsResource.md index 8e8656b670d2f..e2d9e1985c37b 100644 --- a/docs/content/references/js-client/classes/AdminUploadsResource.md +++ b/docs/content/references/js-client/classes/AdminUploadsResource.md @@ -20,7 +20,7 @@ #### Defined in -[medusa-js/src/resources/admin/uploads.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/uploads.ts#L14) +[medusa-js/src/resources/admin/uploads.ts:14](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/uploads.ts#L14) ## Methods @@ -40,7 +40,7 @@ #### Defined in -[medusa-js/src/resources/admin/uploads.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/uploads.ts#L18) +[medusa-js/src/resources/admin/uploads.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/uploads.ts#L18) ___ @@ -60,7 +60,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/uploads.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/uploads.ts#L27) +[medusa-js/src/resources/admin/uploads.ts:27](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/uploads.ts#L27) ___ @@ -81,7 +81,7 @@ ___ #### Defined in -[medusa-js/src/resources/admin/uploads.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/uploads.ts#L36) +[medusa-js/src/resources/admin/uploads.ts:36](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/uploads.ts#L36) ___ @@ -102,4 +102,4 @@ ___ #### Defined in -[medusa-js/src/resources/admin/uploads.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/uploads.ts#L45) +[medusa-js/src/resources/admin/uploads.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/uploads.ts#L45) diff --git a/docs/content/references/js-client/classes/AdminUsersResource.md b/docs/content/references/js-client/classes/AdminUsersResource.md index 61999332d0b36..e1c521a3c8ec6 100644 --- a/docs/content/references/js-client/classes/AdminUsersResource.md +++ b/docs/content/references/js-client/classes/AdminUsersResource.md @@ -31,7 +31,7 @@ created user #### Defined in -[medusa-js/src/resources/admin/users.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L64) +[medusa-js/src/resources/admin/users.ts:64](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L64) ___ @@ -58,7 +58,7 @@ delete response #### Defined in -[medusa-js/src/resources/admin/users.ts:94](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L94) +[medusa-js/src/resources/admin/users.ts:94](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L94) ___ @@ -84,7 +84,7 @@ a list of all users #### Defined in -[medusa-js/src/resources/admin/users.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L106) +[medusa-js/src/resources/admin/users.ts:106](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L106) ___ @@ -109,7 +109,7 @@ resets the users password given the correct token. #### Defined in -[medusa-js/src/resources/admin/users.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L36) +[medusa-js/src/resources/admin/users.ts:36](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L36) ___ @@ -134,7 +134,7 @@ the user #### Defined in -[medusa-js/src/resources/admin/users.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L50) +[medusa-js/src/resources/admin/users.ts:50](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L50) ___ @@ -159,7 +159,7 @@ resets password by re-sending password token. #### Defined in -[medusa-js/src/resources/admin/users.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L22) +[medusa-js/src/resources/admin/users.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L22) ___ @@ -187,4 +187,4 @@ the updated user #### Defined in -[medusa-js/src/resources/admin/users.ts:79](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/users.ts#L79) +[medusa-js/src/resources/admin/users.ts:79](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/users.ts#L79) diff --git a/docs/content/references/js-client/classes/AdminVariantsResource.md b/docs/content/references/js-client/classes/AdminVariantsResource.md index ec16020068919..0227e00058486 100644 --- a/docs/content/references/js-client/classes/AdminVariantsResource.md +++ b/docs/content/references/js-client/classes/AdminVariantsResource.md @@ -25,4 +25,4 @@ #### Defined in -[medusa-js/src/resources/admin/variants.ts:7](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/admin/variants.ts#L7) +[medusa-js/src/resources/admin/variants.ts:7](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/admin/variants.ts#L7) diff --git a/docs/content/references/js-client/classes/AuthResource.md b/docs/content/references/js-client/classes/AuthResource.md index 2b12bed12089e..e70a7e55f0e84 100644 --- a/docs/content/references/js-client/classes/AuthResource.md +++ b/docs/content/references/js-client/classes/AuthResource.md @@ -29,7 +29,7 @@ Authenticates a customer using email and password combination #### Defined in -[medusa-js/src/resources/auth.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/auth.ts#L16) +[medusa-js/src/resources/auth.ts:16](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L16) ___ @@ -53,7 +53,7 @@ Removes authentication session #### Defined in -[medusa-js/src/resources/auth.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/auth.ts#L25) +[medusa-js/src/resources/auth.ts:25](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L25) ___ @@ -78,7 +78,7 @@ Check if email exists #### Defined in -[medusa-js/src/resources/auth.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/auth.ts#L47) +[medusa-js/src/resources/auth.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L47) ___ @@ -103,4 +103,4 @@ Usually used to check if authenticated session is alive. #### Defined in -[medusa-js/src/resources/auth.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/auth.ts#L36) +[medusa-js/src/resources/auth.ts:36](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L36) diff --git a/docs/content/references/js-client/classes/CartsResource.md b/docs/content/references/js-client/classes/CartsResource.md index 482e0357dccd3..79c72aaf35c2e 100644 --- a/docs/content/references/js-client/classes/CartsResource.md +++ b/docs/content/references/js-client/classes/CartsResource.md @@ -14,7 +14,7 @@ #### Defined in -[medusa-js/src/resources/carts.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L15) +[medusa-js/src/resources/carts.ts:15](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L15) ## Methods @@ -38,7 +38,7 @@ Adds a shipping method to cart #### Defined in -[medusa-js/src/resources/carts.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L24) +[medusa-js/src/resources/carts.ts:24](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L24) ___ @@ -65,7 +65,7 @@ If not provuided, we will generate one for the request. #### Defined in -[medusa-js/src/resources/carts.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L43) +[medusa-js/src/resources/carts.ts:43](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L43) ___ @@ -88,7 +88,7 @@ Creates a cart #### Defined in -[medusa-js/src/resources/carts.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L58) +[medusa-js/src/resources/carts.ts:58](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L58) ___ @@ -113,7 +113,7 @@ This is usually called when a customer proceeds to checkout. #### Defined in -[medusa-js/src/resources/carts.ts:74](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L74) +[medusa-js/src/resources/carts.ts:74](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L74) ___ @@ -137,7 +137,7 @@ Removes a discount from cart. #### Defined in -[medusa-js/src/resources/carts.ts:89](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L89) +[medusa-js/src/resources/carts.ts:89](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L89) ___ @@ -162,7 +162,7 @@ Can be useful in case a payment has failed #### Defined in -[medusa-js/src/resources/carts.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L106) +[medusa-js/src/resources/carts.ts:106](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L106) ___ @@ -186,7 +186,7 @@ Refreshes a payment session. #### Defined in -[medusa-js/src/resources/carts.ts:122](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L122) +[medusa-js/src/resources/carts.ts:122](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L122) ___ @@ -209,7 +209,7 @@ Retrieves a cart #### Defined in -[medusa-js/src/resources/carts.ts:137](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L137) +[medusa-js/src/resources/carts.ts:137](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L137) ___ @@ -233,7 +233,7 @@ Refreshes a payment session. #### Defined in -[medusa-js/src/resources/carts.ts:152](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L152) +[medusa-js/src/resources/carts.ts:152](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L152) ___ @@ -257,7 +257,7 @@ Updates a cart #### Defined in -[medusa-js/src/resources/carts.ts:168](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L168) +[medusa-js/src/resources/carts.ts:168](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L168) ___ @@ -282,4 +282,4 @@ Updates the payment method #### Defined in -[medusa-js/src/resources/carts.ts:185](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/carts.ts#L185) +[medusa-js/src/resources/carts.ts:185](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/carts.ts#L185) diff --git a/docs/content/references/js-client/classes/CollectionsResource.md b/docs/content/references/js-client/classes/CollectionsResource.md index 40cd7ed71e1da..d4fb8940d2feb 100644 --- a/docs/content/references/js-client/classes/CollectionsResource.md +++ b/docs/content/references/js-client/classes/CollectionsResource.md @@ -29,7 +29,7 @@ Retrieves a list of collections #### Defined in -[medusa-js/src/resources/collections.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/collections.ts#L28) +[medusa-js/src/resources/collections.ts:28](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/collections.ts#L28) ___ @@ -54,4 +54,4 @@ Retrieves a single collection #### Defined in -[medusa-js/src/resources/collections.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/collections.ts#L17) +[medusa-js/src/resources/collections.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/collections.ts#L17) diff --git a/docs/content/references/js-client/classes/CustomerResource.md b/docs/content/references/js-client/classes/CustomerResource.md index 988fa3c90e709..ac2ae94cea45c 100644 --- a/docs/content/references/js-client/classes/CustomerResource.md +++ b/docs/content/references/js-client/classes/CustomerResource.md @@ -14,7 +14,7 @@ #### Defined in -[medusa-js/src/resources/customers.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L18) +[medusa-js/src/resources/customers.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L18) ___ @@ -24,7 +24,7 @@ ___ #### Defined in -[medusa-js/src/resources/customers.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L17) +[medusa-js/src/resources/customers.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L17) ## Methods @@ -47,7 +47,7 @@ Creates a customer #### Defined in -[medusa-js/src/resources/customers.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L26) +[medusa-js/src/resources/customers.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L26) ___ @@ -71,7 +71,7 @@ The token is not returned but should be sent out to the customer in an email. #### Defined in -[medusa-js/src/resources/customers.ts:101](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L101) +[medusa-js/src/resources/customers.ts:101](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L101) ___ @@ -94,7 +94,7 @@ Retrieve customer orders #### Defined in -[medusa-js/src/resources/customers.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L66) +[medusa-js/src/resources/customers.ts:66](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L66) ___ @@ -117,7 +117,7 @@ Resets customer password #### Defined in -[medusa-js/src/resources/customers.ts:86](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L86) +[medusa-js/src/resources/customers.ts:86](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L86) ___ @@ -139,7 +139,7 @@ Retrieves the customer that is currently logged #### Defined in -[medusa-js/src/resources/customers.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L39) +[medusa-js/src/resources/customers.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L39) ___ @@ -162,4 +162,4 @@ Updates a customer #### Defined in -[medusa-js/src/resources/customers.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/customers.ts#L52) +[medusa-js/src/resources/customers.ts:52](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/customers.ts#L52) diff --git a/docs/content/references/js-client/classes/GiftCardsResource.md b/docs/content/references/js-client/classes/GiftCardsResource.md index 9b6142b24db50..f0440467213a5 100644 --- a/docs/content/references/js-client/classes/GiftCardsResource.md +++ b/docs/content/references/js-client/classes/GiftCardsResource.md @@ -29,4 +29,4 @@ Retrieves a single GiftCard #### Defined in -[medusa-js/src/resources/gift-cards.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/gift-cards.ts#L12) +[medusa-js/src/resources/gift-cards.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/gift-cards.ts#L12) diff --git a/docs/content/references/js-client/classes/LineItemsResource.md b/docs/content/references/js-client/classes/LineItemsResource.md index d974ebf8ab0f5..2e45601e7bf09 100644 --- a/docs/content/references/js-client/classes/LineItemsResource.md +++ b/docs/content/references/js-client/classes/LineItemsResource.md @@ -28,7 +28,7 @@ Creates a line-item for a cart #### Defined in -[medusa-js/src/resources/line-items.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/line-items.ts#L17) +[medusa-js/src/resources/line-items.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/line-items.ts#L17) ___ @@ -52,7 +52,7 @@ Remove a line-item from a cart #### Defined in -[medusa-js/src/resources/line-items.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/line-items.ts#L50) +[medusa-js/src/resources/line-items.ts:50](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/line-items.ts#L50) ___ @@ -78,4 +78,4 @@ Only quantity updates are allowed #### Defined in -[medusa-js/src/resources/line-items.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/line-items.ts#L34) +[medusa-js/src/resources/line-items.ts:34](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/line-items.ts#L34) diff --git a/docs/content/references/js-client/classes/OrderEditsResource.md b/docs/content/references/js-client/classes/OrderEditsResource.md index cc39f1ddff3c1..b161f8ed163aa 100644 --- a/docs/content/references/js-client/classes/OrderEditsResource.md +++ b/docs/content/references/js-client/classes/OrderEditsResource.md @@ -25,7 +25,7 @@ #### Defined in -[medusa-js/src/resources/order-edits.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/order-edits.ts#L26) +[medusa-js/src/resources/order-edits.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/order-edits.ts#L26) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[medusa-js/src/resources/order-edits.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/order-edits.ts#L17) +[medusa-js/src/resources/order-edits.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/order-edits.ts#L17) ___ @@ -68,4 +68,4 @@ ___ #### Defined in -[medusa-js/src/resources/order-edits.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/order-edits.ts#L9) +[medusa-js/src/resources/order-edits.ts:9](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/order-edits.ts#L9) diff --git a/docs/content/references/js-client/classes/OrdersResource.md b/docs/content/references/js-client/classes/OrdersResource.md index f37ce042143d3..fc2b0d0739926 100644 --- a/docs/content/references/js-client/classes/OrdersResource.md +++ b/docs/content/references/js-client/classes/OrdersResource.md @@ -8,6 +8,31 @@ ## Methods +### confirmRequest + +▸ **confirmRequest**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<`any`\> + +**`Description`** + +Grant access to a list of orders + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `payload` | [`StorePostCustomersCustomerAcceptClaimReq`](internal-41.StorePostCustomersCustomerAcceptClaimReq.md) | signed token to grant access | +| `customHeaders` | `Record`<`string`, `any`\> | | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<`any`\> + +#### Defined in + +[medusa-js/src/resources/orders.ts:78](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/orders.ts#L78) + +___ + ### lookupOrder ▸ **lookupOrder**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreOrdersRes`](../modules/internal-41.md#storeordersres)\> @@ -29,7 +54,32 @@ Look up an order using order details #### Defined in -[medusa-js/src/resources/orders.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/orders.ts#L41) +[medusa-js/src/resources/orders.ts:46](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/orders.ts#L46) + +___ + +### requestCustomerOrders + +▸ **requestCustomerOrders**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<`any`\> + +**`Description`** + +Request access to a list of orders + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `payload` | [`StorePostCustomersCustomerOrderClaimReq`](internal-41.StorePostCustomersCustomerOrderClaimReq.md) | display ids of orders to request | +| `customHeaders` | `Record`<`string`, `any`\> | | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<`any`\> + +#### Defined in + +[medusa-js/src/resources/orders.ts:64](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/orders.ts#L64) ___ @@ -54,7 +104,7 @@ Retrieves an order #### Defined in -[medusa-js/src/resources/orders.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/orders.ts#L13) +[medusa-js/src/resources/orders.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/orders.ts#L18) ___ @@ -79,4 +129,4 @@ Retrieves an order by cart id #### Defined in -[medusa-js/src/resources/orders.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/orders.ts#L27) +[medusa-js/src/resources/orders.ts:32](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/orders.ts#L32) diff --git a/docs/content/references/js-client/classes/PaymentCollectionsResource.md b/docs/content/references/js-client/classes/PaymentCollectionsResource.md index 8eb371ce5cb64..bc6996bc76c8d 100644 --- a/docs/content/references/js-client/classes/PaymentCollectionsResource.md +++ b/docs/content/references/js-client/classes/PaymentCollectionsResource.md @@ -8,52 +8,97 @@ ## Methods -### authorize +### authorizePaymentSession -▸ **authorize**(`id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionRes`](../modules/internal-42.md#storepaymentcollectionres)\> +▸ **authorizePaymentSession**(`id`, `session_id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> #### Parameters | Name | Type | | :------ | :------ | | `id` | `string` | +| `session_id` | `string` | +| `customHeaders` | `Record`<`string`, `any`\> | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> + +#### Defined in + +[medusa-js/src/resources/payment-collections.ts:29](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-collections.ts#L29) + +___ + +### authorizePaymentSessionsBatch + +▸ **authorizePaymentSessionsBatch**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | +| `payload` | [`StorePostPaymentCollectionsBatchSessionsAuthorizeReq`](internal-42.StorePostPaymentCollectionsBatchSessionsAuthorizeReq.md) | +| `customHeaders` | `Record`<`string`, `any`\> | + +#### Returns + +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> + +#### Defined in + +[medusa-js/src/resources/payment-collections.ts:38](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-collections.ts#L38) + +___ + +### managePaymentSession + +▸ **managePaymentSession**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | +| `payload` | [`StorePaymentCollectionSessionsReq`](internal-42.StorePaymentCollectionSessionsReq.md) | | `customHeaders` | `Record`<`string`, `any`\> | #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionRes`](../modules/internal-42.md#storepaymentcollectionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> #### Defined in -[medusa-js/src/resources/payment-collections.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/payment-collections.ts#L28) +[medusa-js/src/resources/payment-collections.ts:56](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-collections.ts#L56) ___ -### manageSessions +### managePaymentSessionsBatch -▸ **manageSessions**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionRes`](../modules/internal-42.md#storepaymentcollectionres)\> +▸ **managePaymentSessionsBatch**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> #### Parameters | Name | Type | | :------ | :------ | | `id` | `string` | -| `payload` | [`StoreManagePaymentCollectionSessionRequest`](internal-42.StoreManagePaymentCollectionSessionRequest.md) | +| `payload` | [`StorePostPaymentCollectionsBatchSessionsReq`](internal-42.StorePostPaymentCollectionsBatchSessionsReq.md) | | `customHeaders` | `Record`<`string`, `any`\> | #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionRes`](../modules/internal-42.md#storepaymentcollectionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> #### Defined in -[medusa-js/src/resources/payment-collections.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/payment-collections.ts#L36) +[medusa-js/src/resources/payment-collections.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-collections.ts#L47) ___ ### refreshPaymentSession -▸ **refreshPaymentSession**(`id`, `session_id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionSessionRes`](../modules/internal-42.md#storepaymentcollectionsessionres)\> +▸ **refreshPaymentSession**(`id`, `session_id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsSessionRes`](../modules/internal-42.md#storepaymentcollectionssessionres)\> #### Parameters @@ -61,22 +106,21 @@ ___ | :------ | :------ | | `id` | `string` | | `session_id` | `string` | -| `payload` | [`StoreRefreshPaymentCollectionSessionRequest`](internal-42.StoreRefreshPaymentCollectionSessionRequest.md) | | `customHeaders` | `Record`<`string`, `any`\> | #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionSessionRes`](../modules/internal-42.md#storepaymentcollectionsessionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsSessionRes`](../modules/internal-42.md#storepaymentcollectionssessionres)\> #### Defined in -[medusa-js/src/resources/payment-collections.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/payment-collections.ts#L45) +[medusa-js/src/resources/payment-collections.ts:65](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-collections.ts#L65) ___ ### retrieve -▸ **retrieve**(`id`, `query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionRes`](../modules/internal-42.md#storepaymentcollectionres)\> +▸ **retrieve**(`id`, `query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> #### Parameters @@ -88,8 +132,8 @@ ___ #### Returns -[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionRes`](../modules/internal-42.md#storepaymentcollectionres)\> +[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StorePaymentCollectionsRes`](../modules/internal-42.md#storepaymentcollectionsres)\> #### Defined in -[medusa-js/src/resources/payment-collections.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/payment-collections.ts#L13) +[medusa-js/src/resources/payment-collections.ts:14](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-collections.ts#L14) diff --git a/docs/content/references/js-client/classes/PaymentMethodsResource.md b/docs/content/references/js-client/classes/PaymentMethodsResource.md index 639c01c6f4f73..7778e025ced5f 100644 --- a/docs/content/references/js-client/classes/PaymentMethodsResource.md +++ b/docs/content/references/js-client/classes/PaymentMethodsResource.md @@ -26,4 +26,4 @@ Lists customer payment methods #### Defined in -[medusa-js/src/resources/payment-methods.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/payment-methods.ts#L12) +[medusa-js/src/resources/payment-methods.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/payment-methods.ts#L12) diff --git a/docs/content/references/js-client/classes/ProductTypesResource.md b/docs/content/references/js-client/classes/ProductTypesResource.md index 31e149113754b..54565bf8915de 100644 --- a/docs/content/references/js-client/classes/ProductTypesResource.md +++ b/docs/content/references/js-client/classes/ProductTypesResource.md @@ -29,4 +29,4 @@ Retrieves a list of product types #### Defined in -[medusa-js/src/resources/product-types.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/product-types.ts#L16) +[medusa-js/src/resources/product-types.ts:16](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/product-types.ts#L16) diff --git a/docs/content/references/js-client/classes/ProductVariantsResource.md b/docs/content/references/js-client/classes/ProductVariantsResource.md index b3183fcf4e170..219fd087a8489 100644 --- a/docs/content/references/js-client/classes/ProductVariantsResource.md +++ b/docs/content/references/js-client/classes/ProductVariantsResource.md @@ -29,7 +29,7 @@ Retrieves a list of of Product Variants #### Defined in -[medusa-js/src/resources/product-variants.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/product-variants.ts#L28) +[medusa-js/src/resources/product-variants.ts:28](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/product-variants.ts#L28) ___ @@ -54,4 +54,4 @@ Retrieves a single product variant #### Defined in -[medusa-js/src/resources/product-variants.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/product-variants.ts#L17) +[medusa-js/src/resources/product-variants.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/product-variants.ts#L17) diff --git a/docs/content/references/js-client/classes/ProductsResource.md b/docs/content/references/js-client/classes/ProductsResource.md index 7fc882746e22f..7f8d5ba56f256 100644 --- a/docs/content/references/js-client/classes/ProductsResource.md +++ b/docs/content/references/js-client/classes/ProductsResource.md @@ -14,7 +14,7 @@ #### Defined in -[medusa-js/src/resources/products.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/products.ts#L14) +[medusa-js/src/resources/products.ts:14](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/products.ts#L14) ## Methods @@ -39,7 +39,7 @@ Retrieves a list of products #### Defined in -[medusa-js/src/resources/products.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/products.ts#L50) +[medusa-js/src/resources/products.ts:50](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/products.ts#L50) ___ @@ -64,7 +64,7 @@ Retrieves a single Product #### Defined in -[medusa-js/src/resources/products.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/products.ts#L22) +[medusa-js/src/resources/products.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/products.ts#L22) ___ @@ -89,4 +89,4 @@ Searches for products #### Defined in -[medusa-js/src/resources/products.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/products.ts#L36) +[medusa-js/src/resources/products.ts:36](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/products.ts#L36) diff --git a/docs/content/references/js-client/classes/RegionsResource.md b/docs/content/references/js-client/classes/RegionsResource.md index 8ef08884c8fca..ca20a5ad90f8a 100644 --- a/docs/content/references/js-client/classes/RegionsResource.md +++ b/docs/content/references/js-client/classes/RegionsResource.md @@ -28,7 +28,7 @@ Retrieves a list of regions #### Defined in -[medusa-js/src/resources/regions.ts:11](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/regions.ts#L11) +[medusa-js/src/resources/regions.ts:11](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/regions.ts#L11) ___ @@ -53,4 +53,4 @@ Retrieves a region #### Defined in -[medusa-js/src/resources/regions.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/regions.ts#L22) +[medusa-js/src/resources/regions.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/regions.ts#L22) diff --git a/docs/content/references/js-client/classes/ReturnReasonsResource.md b/docs/content/references/js-client/classes/ReturnReasonsResource.md index fc83489c963c1..d0d5047e86017 100644 --- a/docs/content/references/js-client/classes/ReturnReasonsResource.md +++ b/docs/content/references/js-client/classes/ReturnReasonsResource.md @@ -26,7 +26,7 @@ Lists return reasons defined in Medusa Admin #### Defined in -[medusa-js/src/resources/return-reasons.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/return-reasons.ts#L25) +[medusa-js/src/resources/return-reasons.ts:25](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/return-reasons.ts#L25) ___ @@ -51,4 +51,4 @@ Retrieves a single Return Reason #### Defined in -[medusa-js/src/resources/return-reasons.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/return-reasons.ts#L15) +[medusa-js/src/resources/return-reasons.ts:15](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/return-reasons.ts#L15) diff --git a/docs/content/references/js-client/classes/ReturnsResource.md b/docs/content/references/js-client/classes/ReturnsResource.md index 7763cb5a85c23..4e9ebccff87b2 100644 --- a/docs/content/references/js-client/classes/ReturnsResource.md +++ b/docs/content/references/js-client/classes/ReturnsResource.md @@ -27,4 +27,4 @@ Creates a return request #### Defined in -[medusa-js/src/resources/returns.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/returns.ts#L12) +[medusa-js/src/resources/returns.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/returns.ts#L12) diff --git a/docs/content/references/js-client/classes/ShippingOptionsResource.md b/docs/content/references/js-client/classes/ShippingOptionsResource.md index 7eaa682d64d7a..19d2e7b0bae01 100644 --- a/docs/content/references/js-client/classes/ShippingOptionsResource.md +++ b/docs/content/references/js-client/classes/ShippingOptionsResource.md @@ -29,7 +29,7 @@ Lists shiping options available #### Defined in -[medusa-js/src/resources/shipping-options.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/shipping-options.ts#L27) +[medusa-js/src/resources/shipping-options.ts:27](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/shipping-options.ts#L27) ___ @@ -54,4 +54,4 @@ Lists shiping options available for a cart #### Defined in -[medusa-js/src/resources/shipping-options.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/shipping-options.ts#L16) +[medusa-js/src/resources/shipping-options.ts:16](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/shipping-options.ts#L16) diff --git a/docs/content/references/js-client/classes/SwapsResource.md b/docs/content/references/js-client/classes/SwapsResource.md index c37ffe8f5f26f..f7a60c1d14845 100644 --- a/docs/content/references/js-client/classes/SwapsResource.md +++ b/docs/content/references/js-client/classes/SwapsResource.md @@ -29,7 +29,7 @@ Creates a swap from a cart #### Defined in -[medusa-js/src/resources/swaps.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/swaps.ts#L12) +[medusa-js/src/resources/swaps.ts:12](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/swaps.ts#L12) ___ @@ -54,4 +54,4 @@ Retrieves a swap by cart id #### Defined in -[medusa-js/src/resources/swaps.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/resources/swaps.ts#L23) +[medusa-js/src/resources/swaps.ts:23](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/swaps.ts#L23) diff --git a/docs/content/references/js-client/classes/internal-1.AdminPostAuthReq.md b/docs/content/references/js-client/classes/internal-1.AdminPostAuthReq.md index 98c60d0051bc1..d33e26f840d6d 100644 --- a/docs/content/references/js-client/classes/internal-1.AdminPostAuthReq.md +++ b/docs/content/references/js-client/classes/internal-1.AdminPostAuthReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/auth/create-session.d.ts:74 +medusa/dist/api/routes/admin/auth/create-session.d.ts:76 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/auth/create-session.d.ts:75 +medusa/dist/api/routes/admin/auth/create-session.d.ts:77 diff --git a/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptReq.md b/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptReq.md index adae519c79578..133fde0b397ca 100644 --- a/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptReq.md +++ b/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/invites/accept-invite.d.ts:99 +medusa/dist/api/routes/admin/invites/accept-invite.d.ts:100 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/invites/accept-invite.d.ts:100 +medusa/dist/api/routes/admin/invites/accept-invite.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptUserReq.md b/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptUserReq.md index 784539422932d..ece038ab37416 100644 --- a/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptUserReq.md +++ b/docs/content/references/js-client/classes/internal-10.AdminPostInvitesInviteAcceptUserReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/invites/accept-invite.d.ts:94 +medusa/dist/api/routes/admin/invites/accept-invite.d.ts:95 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/invites/accept-invite.d.ts:95 +medusa/dist/api/routes/admin/invites/accept-invite.d.ts:96 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/invites/accept-invite.d.ts:96 +medusa/dist/api/routes/admin/invites/accept-invite.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-10.AdminPostInvitesReq.md b/docs/content/references/js-client/classes/internal-10.AdminPostInvitesReq.md index 2224323962dc4..0bc3c29fce738 100644 --- a/docs/content/references/js-client/classes/internal-10.AdminPostInvitesReq.md +++ b/docs/content/references/js-client/classes/internal-10.AdminPostInvitesReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/invites/create-invite.d.ts:76 +medusa/dist/api/routes/admin/invites/create-invite.d.ts:77 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/invites/create-invite.d.ts:75 +medusa/dist/api/routes/admin/invites/create-invite.d.ts:76 diff --git a/docs/content/references/js-client/classes/internal-11.AdminGetNotesParams.md b/docs/content/references/js-client/classes/internal-11.AdminGetNotesParams.md index c8f1f5dccd2bb..3f4178d60400c 100644 --- a/docs/content/references/js-client/classes/internal-11.AdminGetNotesParams.md +++ b/docs/content/references/js-client/classes/internal-11.AdminGetNotesParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/notes/list-notes.d.ts:69 +medusa/dist/api/routes/admin/notes/list-notes.d.ts:70 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notes/list-notes.d.ts:70 +medusa/dist/api/routes/admin/notes/list-notes.d.ts:71 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notes/list-notes.d.ts:68 +medusa/dist/api/routes/admin/notes/list-notes.d.ts:69 diff --git a/docs/content/references/js-client/classes/internal-11.AdminPostNotesNoteReq.md b/docs/content/references/js-client/classes/internal-11.AdminPostNotesNoteReq.md index 21b2bddc6efe7..6a8c349f3f104 100644 --- a/docs/content/references/js-client/classes/internal-11.AdminPostNotesNoteReq.md +++ b/docs/content/references/js-client/classes/internal-11.AdminPostNotesNoteReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/notes/update-note.d.ts:71 +medusa/dist/api/routes/admin/notes/update-note.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-11.AdminPostNotesReq.md b/docs/content/references/js-client/classes/internal-11.AdminPostNotesReq.md index bb6d6c494b159..f15147baa8668 100644 --- a/docs/content/references/js-client/classes/internal-11.AdminPostNotesReq.md +++ b/docs/content/references/js-client/classes/internal-11.AdminPostNotesReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/notes/create-note.d.ts:82 +medusa/dist/api/routes/admin/notes/create-note.d.ts:84 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notes/create-note.d.ts:83 +medusa/dist/api/routes/admin/notes/create-note.d.ts:85 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notes/create-note.d.ts:84 +medusa/dist/api/routes/admin/notes/create-note.d.ts:86 diff --git a/docs/content/references/js-client/classes/internal-12.AdminGetNotificationsParams.md b/docs/content/references/js-client/classes/internal-12.AdminGetNotificationsParams.md index b55591a752e4e..1d4da95aa6a6b 100644 --- a/docs/content/references/js-client/classes/internal-12.AdminGetNotificationsParams.md +++ b/docs/content/references/js-client/classes/internal-12.AdminGetNotificationsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:69 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:70 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:68 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:69 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:67 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:68 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:73 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:74 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:65 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:66 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:66 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:67 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:71 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:72 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:70 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:71 ___ @@ -90,4 +90,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:72 +medusa/dist/api/routes/admin/notifications/list-notifications.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-12.AdminPostNotificationsNotificationResendReq.md b/docs/content/references/js-client/classes/internal-12.AdminPostNotificationsNotificationResendReq.md index 93770c95e5159..3b8965b6f2728 100644 --- a/docs/content/references/js-client/classes/internal-12.AdminPostNotificationsNotificationResendReq.md +++ b/docs/content/references/js-client/classes/internal-12.AdminPostNotificationsNotificationResendReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/notifications/resend-notification.d.ts:63 +medusa/dist/api/routes/admin/notifications/resend-notification.d.ts:65 diff --git a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsLineItemReq.md b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsLineItemReq.md index 7894da174e5c2..77846d28cfaf6 100644 --- a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsLineItemReq.md +++ b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsLineItemReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/order-edits/update-order-edit-line-item.d.ts:71 +medusa/dist/api/routes/admin/order-edits/update-order-edit-line-item.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsReq.md b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsReq.md index 0351bd0ba4406..5dc51b19b67ac 100644 --- a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsReq.md +++ b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsEditLineItemsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/order-edits/add-line-item.d.ts:80 +medusa/dist/api/routes/admin/order-edits/add-line-item.d.ts:82 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/order-edits/add-line-item.d.ts:79 +medusa/dist/api/routes/admin/order-edits/add-line-item.d.ts:81 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/order-edits/add-line-item.d.ts:78 +medusa/dist/api/routes/admin/order-edits/add-line-item.d.ts:80 diff --git a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsOrderEditReq.md b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsOrderEditReq.md index b2cdf18ef55ca..bd242ee1c2464 100644 --- a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsOrderEditReq.md +++ b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsOrderEditReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/order-edits/update-order-edit.d.ts:70 +medusa/dist/api/routes/admin/order-edits/update-order-edit.d.ts:72 diff --git a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsReq.md b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsReq.md index 689f0dea3e9b1..802f405149ac4 100644 --- a/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsReq.md +++ b/docs/content/references/js-client/classes/internal-13.AdminPostOrderEditsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/order-edits/create-order-edit.d.ts:70 +medusa/dist/api/routes/admin/order-edits/create-order-edit.d.ts:72 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/order-edits/create-order-edit.d.ts:69 +medusa/dist/api/routes/admin/order-edits/create-order-edit.d.ts:71 diff --git a/docs/content/references/js-client/classes/internal-13.GetOrderEditsParams.md b/docs/content/references/js-client/classes/internal-13.GetOrderEditsParams.md index 464ea24de9adc..f88df55ac84fc 100644 --- a/docs/content/references/js-client/classes/internal-13.GetOrderEditsParams.md +++ b/docs/content/references/js-client/classes/internal-13.GetOrderEditsParams.md @@ -72,7 +72,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/order-edits/list-order-edit.d.ts:73 +medusa/dist/api/routes/admin/order-edits/list-order-edit.d.ts:74 ___ @@ -82,4 +82,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/order-edits/list-order-edit.d.ts:72 +medusa/dist/api/routes/admin/order-edits/list-order-edit.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-14.AdditionalItem-1.md b/docs/content/references/js-client/classes/internal-14.AdditionalItem-1.md index 4e1ad575778c1..d52a95ccca02e 100644 --- a/docs/content/references/js-client/classes/internal-14.AdditionalItem-1.md +++ b/docs/content/references/js-client/classes/internal-14.AdditionalItem-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:204 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:206 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:203 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:205 diff --git a/docs/content/references/js-client/classes/internal-14.AdditionalItem.md b/docs/content/references/js-client/classes/internal-14.AdditionalItem.md index 8baadd9e1bc38..ae309e28c318c 100644 --- a/docs/content/references/js-client/classes/internal-14.AdditionalItem.md +++ b/docs/content/references/js-client/classes/internal-14.AdditionalItem.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:168 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:170 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:167 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:169 diff --git a/docs/content/references/js-client/classes/internal-14.AdminGetOrdersParams.md b/docs/content/references/js-client/classes/internal-14.AdminGetOrdersParams.md index f0500d39f6d60..5b8277937c226 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminGetOrdersParams.md +++ b/docs/content/references/js-client/classes/internal-14.AdminGetOrdersParams.md @@ -114,7 +114,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/list-orders.d.ts:208 +medusa/dist/api/routes/admin/orders/list-orders.d.ts:209 ___ @@ -124,7 +124,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/list-orders.d.ts:209 +medusa/dist/api/routes/admin/orders/list-orders.d.ts:210 ___ @@ -162,7 +162,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/list-orders.d.ts:207 +medusa/dist/api/routes/admin/orders/list-orders.d.ts:208 ___ @@ -172,7 +172,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/list-orders.d.ts:206 +medusa/dist/api/routes/admin/orders/list-orders.d.ts:207 ___ diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimFulfillmentsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimFulfillmentsReq.md index adf80a68c9fd5..f07cf4b132f78 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimFulfillmentsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimFulfillmentsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/fulfill-claim.d.ts:67 +medusa/dist/api/routes/admin/orders/fulfill-claim.d.ts:69 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/fulfill-claim.d.ts:68 +medusa/dist/api/routes/admin/orders/fulfill-claim.d.ts:70 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimReq.md index b10dcc75082fd..493daaba98c35 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:143 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:145 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:146 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:148 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:145 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:147 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:144 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:146 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimShipmentsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimShipmentsReq.md index cd67427abde3b..14f7fe659ebcc 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimShipmentsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsClaimShipmentsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim-shipment.d.ts:77 +medusa/dist/api/routes/admin/orders/create-claim-shipment.d.ts:79 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim-shipment.d.ts:78 +medusa/dist/api/routes/admin/orders/create-claim-shipment.d.ts:80 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsReq.md index 1c5ec34400149..2fc47d1ed791b 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderClaimsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:178 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:180 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:176 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:178 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:183 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:185 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:182 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:184 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:180 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:182 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:177 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:179 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:181 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:183 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:179 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:181 ___ @@ -90,4 +90,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:175 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:177 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderFulfillmentsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderFulfillmentsReq.md index b83f1fa1b3fc0..83639eae9434d 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderFulfillmentsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderFulfillmentsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:98 +medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:100 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:100 +medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:102 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:99 +medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderRefundsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderRefundsReq.md index eebd16b30ff6b..3037fa33afda1 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderRefundsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderRefundsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/refund-payment.d.ts:83 +medusa/dist/api/routes/admin/orders/refund-payment.d.ts:85 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/refund-payment.d.ts:86 +medusa/dist/api/routes/admin/orders/refund-payment.d.ts:88 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/refund-payment.d.ts:85 +medusa/dist/api/routes/admin/orders/refund-payment.d.ts:87 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/refund-payment.d.ts:84 +medusa/dist/api/routes/admin/orders/refund-payment.d.ts:86 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReq.md index f1c3c6a648054..b8a92e4ee1c7d 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:129 +medusa/dist/api/routes/admin/orders/update-order.d.ts:131 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:134 +medusa/dist/api/routes/admin/orders/update-order.d.ts:136 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:133 +medusa/dist/api/routes/admin/orders/update-order.d.ts:135 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:128 +medusa/dist/api/routes/admin/orders/update-order.d.ts:130 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:131 +medusa/dist/api/routes/admin/orders/update-order.d.ts:133 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:137 +medusa/dist/api/routes/admin/orders/update-order.d.ts:139 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:135 +medusa/dist/api/routes/admin/orders/update-order.d.ts:137 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:132 +medusa/dist/api/routes/admin/orders/update-order.d.ts:134 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:130 +medusa/dist/api/routes/admin/orders/update-order.d.ts:132 ___ @@ -100,4 +100,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:136 +medusa/dist/api/routes/admin/orders/update-order.d.ts:138 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReturnsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReturnsReq.md index f1e0af5dc1677..dbceebf080de1 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReturnsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderReturnsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:123 +medusa/dist/api/routes/admin/orders/request-return.d.ts:125 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:127 +medusa/dist/api/routes/admin/orders/request-return.d.ts:129 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:125 +medusa/dist/api/routes/admin/orders/request-return.d.ts:127 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:126 +medusa/dist/api/routes/admin/orders/request-return.d.ts:128 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:128 +medusa/dist/api/routes/admin/orders/request-return.d.ts:130 ___ @@ -60,4 +60,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:124 +medusa/dist/api/routes/admin/orders/request-return.d.ts:126 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShipmentReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShipmentReq.md index bf0b690d95b58..7be2b882b4088 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShipmentReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShipmentReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-shipment.d.ts:79 +medusa/dist/api/routes/admin/orders/create-shipment.d.ts:81 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-shipment.d.ts:81 +medusa/dist/api/routes/admin/orders/create-shipment.d.ts:83 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-shipment.d.ts:80 +medusa/dist/api/routes/admin/orders/create-shipment.d.ts:82 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShippingMethodsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShippingMethodsReq.md index 96ad1d39a61c4..b1865a689ba3e 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShippingMethodsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderShippingMethodsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/add-shipping-method.d.ts:68 +medusa/dist/api/routes/admin/orders/add-shipping-method.d.ts:69 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/add-shipping-method.d.ts:67 +medusa/dist/api/routes/admin/orders/add-shipping-method.d.ts:68 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/add-shipping-method.d.ts:66 +medusa/dist/api/routes/admin/orders/add-shipping-method.d.ts:67 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsReq.md index a61a760860dd3..27b76027e0f55 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:147 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:149 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:150 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:152 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:148 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:150 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:149 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:151 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:145 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:147 ___ @@ -60,4 +60,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:146 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:148 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapFulfillmentsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapFulfillmentsReq.md index 87c0c276fc893..b46a80480804e 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapFulfillmentsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapFulfillmentsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/fulfill-swap.d.ts:67 +medusa/dist/api/routes/admin/orders/fulfill-swap.d.ts:69 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/fulfill-swap.d.ts:68 +medusa/dist/api/routes/admin/orders/fulfill-swap.d.ts:70 diff --git a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapShipmentsReq.md b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapShipmentsReq.md index 545067fe44c00..07298bca472ec 100644 --- a/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapShipmentsReq.md +++ b/docs/content/references/js-client/classes/internal-14.AdminPostOrdersOrderSwapsSwapShipmentsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap-shipment.d.ts:80 +medusa/dist/api/routes/admin/orders/create-swap-shipment.d.ts:82 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap-shipment.d.ts:82 +medusa/dist/api/routes/admin/orders/create-swap-shipment.d.ts:84 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap-shipment.d.ts:81 +medusa/dist/api/routes/admin/orders/create-swap-shipment.d.ts:83 diff --git a/docs/content/references/js-client/classes/internal-14.CustomShippingOption.md b/docs/content/references/js-client/classes/internal-14.CustomShippingOption.md index faad1211557a1..1c3467ab19ffd 100644 --- a/docs/content/references/js-client/classes/internal-14.CustomShippingOption.md +++ b/docs/content/references/js-client/classes/internal-14.CustomShippingOption.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:163 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:165 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:164 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:166 diff --git a/docs/content/references/js-client/classes/internal-14.Image.md b/docs/content/references/js-client/classes/internal-14.Image.md index d38172f0f8c3d..d137ceeced097 100644 --- a/docs/content/references/js-client/classes/internal-14.Image.md +++ b/docs/content/references/js-client/classes/internal-14.Image.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:162 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:164 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:163 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:165 diff --git a/docs/content/references/js-client/classes/internal-14.Item-1.md b/docs/content/references/js-client/classes/internal-14.Item-1.md index 621608b3828d1..98fe14fe2f6da 100644 --- a/docs/content/references/js-client/classes/internal-14.Item-1.md +++ b/docs/content/references/js-client/classes/internal-14.Item-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:200 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:202 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:195 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:197 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:197 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:199 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:196 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:198 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:198 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:200 ___ @@ -60,4 +60,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:199 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:201 diff --git a/docs/content/references/js-client/classes/internal-14.Item-2.md b/docs/content/references/js-client/classes/internal-14.Item-2.md index 406bccf505b75..d90a1aef2e3f2 100644 --- a/docs/content/references/js-client/classes/internal-14.Item-2.md +++ b/docs/content/references/js-client/classes/internal-14.Item-2.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:154 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:156 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:157 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:159 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:159 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:161 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:155 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:157 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:156 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:158 ___ @@ -60,4 +60,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:158 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:160 diff --git a/docs/content/references/js-client/classes/internal-14.Item.md b/docs/content/references/js-client/classes/internal-14.Item.md index 050e6cf91f2ae..8d1ee7082be69 100644 --- a/docs/content/references/js-client/classes/internal-14.Item.md +++ b/docs/content/references/js-client/classes/internal-14.Item.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:103 +medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:105 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:104 +medusa/dist/api/routes/admin/orders/create-fulfillment.d.ts:106 diff --git a/docs/content/references/js-client/classes/internal-14.PaymentMethod.md b/docs/content/references/js-client/classes/internal-14.PaymentMethod.md index e5382857b75b1..a4e0fc301299b 100644 --- a/docs/content/references/js-client/classes/internal-14.PaymentMethod.md +++ b/docs/content/references/js-client/classes/internal-14.PaymentMethod.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:141 +medusa/dist/api/routes/admin/orders/update-order.d.ts:143 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:140 +medusa/dist/api/routes/admin/orders/update-order.d.ts:142 diff --git a/docs/content/references/js-client/classes/internal-14.ReturnItem.md b/docs/content/references/js-client/classes/internal-14.ReturnItem.md index 5fb71e327cadf..917cf7a34248c 100644 --- a/docs/content/references/js-client/classes/internal-14.ReturnItem.md +++ b/docs/content/references/js-client/classes/internal-14.ReturnItem.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:153 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:155 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:156 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:158 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:154 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:156 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:155 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:157 diff --git a/docs/content/references/js-client/classes/internal-14.ReturnShipping-1.md b/docs/content/references/js-client/classes/internal-14.ReturnShipping-1.md index d89795baa6684..3755799151957 100644 --- a/docs/content/references/js-client/classes/internal-14.ReturnShipping-1.md +++ b/docs/content/references/js-client/classes/internal-14.ReturnShipping-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:159 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:161 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-swap.d.ts:160 +medusa/dist/api/routes/admin/orders/create-swap.d.ts:162 diff --git a/docs/content/references/js-client/classes/internal-14.ReturnShipping-2.md b/docs/content/references/js-client/classes/internal-14.ReturnShipping-2.md index 316389a048ef5..5eb1ab7531802 100644 --- a/docs/content/references/js-client/classes/internal-14.ReturnShipping-2.md +++ b/docs/content/references/js-client/classes/internal-14.ReturnShipping-2.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:186 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:188 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:187 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:189 diff --git a/docs/content/references/js-client/classes/internal-14.ReturnShipping.md b/docs/content/references/js-client/classes/internal-14.ReturnShipping.md index 4bc9ab4b3ff3c..c61d8af6a5b1e 100644 --- a/docs/content/references/js-client/classes/internal-14.ReturnShipping.md +++ b/docs/content/references/js-client/classes/internal-14.ReturnShipping.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:131 +medusa/dist/api/routes/admin/orders/request-return.d.ts:133 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/request-return.d.ts:132 +medusa/dist/api/routes/admin/orders/request-return.d.ts:134 diff --git a/docs/content/references/js-client/classes/internal-14.ShippingMethod-1.md b/docs/content/references/js-client/classes/internal-14.ShippingMethod-1.md index 4daff510489f9..f09662befc21f 100644 --- a/docs/content/references/js-client/classes/internal-14.ShippingMethod-1.md +++ b/docs/content/references/js-client/classes/internal-14.ShippingMethod-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:190 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:192 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:191 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:193 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/create-claim.d.ts:192 +medusa/dist/api/routes/admin/orders/create-claim.d.ts:194 diff --git a/docs/content/references/js-client/classes/internal-14.ShippingMethod-2.md b/docs/content/references/js-client/classes/internal-14.ShippingMethod-2.md index 945a40d7b3a9d..23359e1af32d7 100644 --- a/docs/content/references/js-client/classes/internal-14.ShippingMethod-2.md +++ b/docs/content/references/js-client/classes/internal-14.ShippingMethod-2.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:149 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:151 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:150 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:152 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:151 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:153 diff --git a/docs/content/references/js-client/classes/internal-14.ShippingMethod.md b/docs/content/references/js-client/classes/internal-14.ShippingMethod.md index 9aa6d785f38ef..d35a958e06336 100644 --- a/docs/content/references/js-client/classes/internal-14.ShippingMethod.md +++ b/docs/content/references/js-client/classes/internal-14.ShippingMethod.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:147 +medusa/dist/api/routes/admin/orders/update-order.d.ts:149 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:148 +medusa/dist/api/routes/admin/orders/update-order.d.ts:150 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:146 +medusa/dist/api/routes/admin/orders/update-order.d.ts:148 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:145 +medusa/dist/api/routes/admin/orders/update-order.d.ts:147 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-order.d.ts:144 +medusa/dist/api/routes/admin/orders/update-order.d.ts:146 diff --git a/docs/content/references/js-client/classes/internal-14.Tag.md b/docs/content/references/js-client/classes/internal-14.Tag.md index 2ba26fff1b026..81c6a5e44c7b2 100644 --- a/docs/content/references/js-client/classes/internal-14.Tag.md +++ b/docs/content/references/js-client/classes/internal-14.Tag.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:166 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:168 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/orders/update-claim.d.ts:167 +medusa/dist/api/routes/admin/orders/update-claim.d.ts:169 diff --git a/docs/content/references/js-client/classes/internal-15.AdminUpdatePaymentCollectionRequest.md b/docs/content/references/js-client/classes/internal-15.AdminUpdatePaymentCollectionsReq.md similarity index 80% rename from docs/content/references/js-client/classes/internal-15.AdminUpdatePaymentCollectionRequest.md rename to docs/content/references/js-client/classes/internal-15.AdminUpdatePaymentCollectionsReq.md index 1f3f5ba7cf323..dffb47e2da8e9 100644 --- a/docs/content/references/js-client/classes/internal-15.AdminUpdatePaymentCollectionRequest.md +++ b/docs/content/references/js-client/classes/internal-15.AdminUpdatePaymentCollectionsReq.md @@ -1,6 +1,6 @@ -# Class: AdminUpdatePaymentCollectionRequest +# Class: AdminUpdatePaymentCollectionsReq -[internal](../modules/internal-15.md).AdminUpdatePaymentCollectionRequest +[internal](../modules/internal-15.md).AdminUpdatePaymentCollectionsReq ## Properties @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/payment-collections/update-payment-collection.d.ts:72 +medusa/dist/api/routes/admin/payment-collections/update-payment-collection.d.ts:74 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/payment-collections/update-payment-collection.d.ts:73 +medusa/dist/api/routes/admin/payment-collections/update-payment-collection.d.ts:75 diff --git a/docs/content/references/js-client/classes/internal-16.AdminPostPaymentRefundsReq.md b/docs/content/references/js-client/classes/internal-16.AdminPostPaymentRefundsReq.md index ff1ce19a41e72..5c05f008c40e6 100644 --- a/docs/content/references/js-client/classes/internal-16.AdminPostPaymentRefundsReq.md +++ b/docs/content/references/js-client/classes/internal-16.AdminPostPaymentRefundsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/payments/refund-payment.d.ts:83 +medusa/dist/api/routes/admin/payments/refund-payment.d.ts:85 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/payments/refund-payment.d.ts:85 +medusa/dist/api/routes/admin/payments/refund-payment.d.ts:87 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/payments/refund-payment.d.ts:84 +medusa/dist/api/routes/admin/payments/refund-payment.d.ts:86 diff --git a/docs/content/references/js-client/classes/internal-17.AdminDeletePriceListPricesPricesReq.md b/docs/content/references/js-client/classes/internal-17.AdminDeletePriceListPricesPricesReq.md index 5a50700f0e5bb..4d1227c4b7426 100644 --- a/docs/content/references/js-client/classes/internal-17.AdminDeletePriceListPricesPricesReq.md +++ b/docs/content/references/js-client/classes/internal-17.AdminDeletePriceListPricesPricesReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/delete-prices-batch.d.ts:86 +medusa/dist/api/routes/admin/price-lists/delete-prices-batch.d.ts:88 diff --git a/docs/content/references/js-client/classes/internal-17.AdminGetPriceListPaginationParams.md b/docs/content/references/js-client/classes/internal-17.AdminGetPriceListPaginationParams.md index f307a8b445622..3dff579444c52 100644 --- a/docs/content/references/js-client/classes/internal-17.AdminGetPriceListPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-17.AdminGetPriceListPaginationParams.md @@ -72,7 +72,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:171 +medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:172 ___ @@ -96,7 +96,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:170 +medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:171 ___ @@ -120,7 +120,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:169 +medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:170 ___ @@ -130,7 +130,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:172 +medusa/dist/api/routes/admin/price-lists/list-price-lists.d.ts:173 ___ diff --git a/docs/content/references/js-client/classes/internal-17.AdminGetPriceListsPriceListProductsParams.md b/docs/content/references/js-client/classes/internal-17.AdminGetPriceListsPriceListProductsParams.md index c0d7660cbdcd0..e6f8e881757b0 100644 --- a/docs/content/references/js-client/classes/internal-17.AdminGetPriceListsPriceListProductsParams.md +++ b/docs/content/references/js-client/classes/internal-17.AdminGetPriceListsPriceListProductsParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:179 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:180 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:187 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:188 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:189 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:190 ___ @@ -46,7 +46,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:182 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:183 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:183 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:184 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:176 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:177 ___ @@ -104,7 +104,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:184 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:185 ___ @@ -142,7 +142,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:186 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:187 ___ @@ -152,7 +152,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:177 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:178 ___ @@ -162,7 +162,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:178 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:179 ___ @@ -172,7 +172,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:180 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:181 ___ @@ -182,7 +182,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:181 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:182 ___ @@ -192,7 +192,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:185 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:186 ___ @@ -202,4 +202,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:188 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:189 diff --git a/docs/content/references/js-client/classes/internal-17.AdminPostPriceListPricesPricesReq.md b/docs/content/references/js-client/classes/internal-17.AdminPostPriceListPricesPricesReq.md index b384afd104c55..e523fa51b7cca 100644 --- a/docs/content/references/js-client/classes/internal-17.AdminPostPriceListPricesPricesReq.md +++ b/docs/content/references/js-client/classes/internal-17.AdminPostPriceListPricesPricesReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/add-prices-batch.d.ts:115 +medusa/dist/api/routes/admin/price-lists/add-prices-batch.d.ts:117 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/add-prices-batch.d.ts:114 +medusa/dist/api/routes/admin/price-lists/add-prices-batch.d.ts:116 diff --git a/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListPriceListReq.md b/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListPriceListReq.md index 0ce71a8aff7c4..e6d2eabc4ef63 100644 --- a/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListPriceListReq.md +++ b/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListPriceListReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:148 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:150 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:142 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:144 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:144 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:146 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:149 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:151 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:141 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:143 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:147 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:149 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:143 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:145 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:145 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:147 ___ @@ -90,4 +90,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:146 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:148 diff --git a/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListReq.md b/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListReq.md index 9e1805fe73b51..5dfe07f3dc1cd 100644 --- a/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListReq.md +++ b/docs/content/references/js-client/classes/internal-17.AdminPostPriceListsPriceListReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:168 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:170 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:162 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:164 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:164 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:166 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:169 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:171 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:161 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:163 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:167 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:169 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:163 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:165 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:165 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:167 ___ @@ -90,4 +90,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:166 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:168 diff --git a/docs/content/references/js-client/classes/internal-17.CustomerGroup-1.md b/docs/content/references/js-client/classes/internal-17.CustomerGroup-1.md index 92f1378bdfaae..906c215424db6 100644 --- a/docs/content/references/js-client/classes/internal-17.CustomerGroup-1.md +++ b/docs/content/references/js-client/classes/internal-17.CustomerGroup-1.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:138 +medusa/dist/api/routes/admin/price-lists/update-price-list.d.ts:140 diff --git a/docs/content/references/js-client/classes/internal-17.CustomerGroup.md b/docs/content/references/js-client/classes/internal-17.CustomerGroup.md index 144c177b4bd3b..0a2a04fea0cc7 100644 --- a/docs/content/references/js-client/classes/internal-17.CustomerGroup.md +++ b/docs/content/references/js-client/classes/internal-17.CustomerGroup.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:158 +medusa/dist/api/routes/admin/price-lists/create-price-list.d.ts:160 diff --git a/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsPaginationParams.md b/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsPaginationParams.md index ac21c5b73d8f7..b1546ec274858 100644 --- a/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsPaginationParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:132 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:133 ___ @@ -26,4 +26,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:133 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:134 diff --git a/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsParams.md b/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsParams.md index 0fc5b85e6caca..5ebfcad538853 100644 --- a/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsParams.md +++ b/docs/content/references/js-client/classes/internal-18.AdminGetProductTagsParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:139 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:140 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:142 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:143 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:136 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:137 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:132 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:133 ___ @@ -64,7 +64,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:133 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:134 ___ @@ -74,7 +74,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:141 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:142 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:137 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:138 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:140 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:141 ___ @@ -104,4 +104,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:138 +medusa/dist/api/routes/admin/product-tags/list-product-tags.d.ts:139 diff --git a/docs/content/references/js-client/classes/internal-19.AdminGetProductTypesParams.md b/docs/content/references/js-client/classes/internal-19.AdminGetProductTypesParams.md index 61607b47d1e46..8dee77219bcba 100644 --- a/docs/content/references/js-client/classes/internal-19.AdminGetProductTypesParams.md +++ b/docs/content/references/js-client/classes/internal-19.AdminGetProductTypesParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:134 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:135 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:137 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:138 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:131 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:132 ___ @@ -74,7 +74,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:136 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:137 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:132 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:133 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:135 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:136 ___ @@ -104,4 +104,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:133 +medusa/dist/api/routes/admin/product-types/list-product-types.d.ts:134 diff --git a/docs/content/references/js-client/classes/internal-2.AdminGetBatchPaginationParams.md b/docs/content/references/js-client/classes/internal-2.AdminGetBatchPaginationParams.md index 53ae088fcd44d..653fbfd181f63 100644 --- a/docs/content/references/js-client/classes/internal-2.AdminGetBatchPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-2.AdminGetBatchPaginationParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:264 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:265 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:265 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:266 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:262 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:263 ___ @@ -46,7 +46,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:263 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:264 ___ @@ -56,4 +56,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:266 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:267 diff --git a/docs/content/references/js-client/classes/internal-2.AdminGetBatchParams.md b/docs/content/references/js-client/classes/internal-2.AdminGetBatchParams.md index f2505482946c8..cd8b2479bc771 100644 --- a/docs/content/references/js-client/classes/internal-2.AdminGetBatchParams.md +++ b/docs/content/references/js-client/classes/internal-2.AdminGetBatchParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:275 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:276 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:273 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:274 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:271 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:272 ___ @@ -46,7 +46,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:276 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:277 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:264 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:265 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:274 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:275 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:265 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:266 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:269 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:270 ___ @@ -108,7 +108,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:262 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:263 ___ @@ -122,7 +122,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:263 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:264 ___ @@ -136,7 +136,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:266 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:267 ___ @@ -146,7 +146,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:272 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:273 ___ @@ -156,7 +156,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:270 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:271 ___ @@ -166,4 +166,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:277 +medusa/dist/api/routes/admin/batch/list-batch-jobs.d.ts:278 diff --git a/docs/content/references/js-client/classes/internal-2.AdminPostBatchesReq.md b/docs/content/references/js-client/classes/internal-2.AdminPostBatchesReq.md index 980404ad14fad..dc25f2e2aff33 100644 --- a/docs/content/references/js-client/classes/internal-2.AdminPostBatchesReq.md +++ b/docs/content/references/js-client/classes/internal-2.AdminPostBatchesReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/batch/create-batch-job.d.ts:98 +medusa/dist/api/routes/admin/batch/create-batch-job.d.ts:100 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/create-batch-job.d.ts:99 +medusa/dist/api/routes/admin/batch/create-batch-job.d.ts:101 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/batch/create-batch-job.d.ts:97 +medusa/dist/api/routes/admin/batch/create-batch-job.d.ts:99 diff --git a/docs/content/references/js-client/classes/internal-20.AdminGetProductsParams.md b/docs/content/references/js-client/classes/internal-20.AdminGetProductsParams.md index d3fcbb1b0fc84..850053c438d46 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminGetProductsParams.md +++ b/docs/content/references/js-client/classes/internal-20.AdminGetProductsParams.md @@ -88,7 +88,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/list-products.d.ts:212 +medusa/dist/api/routes/admin/products/list-products.d.ts:213 ___ @@ -98,7 +98,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/list-products.d.ts:213 +medusa/dist/api/routes/admin/products/list-products.d.ts:214 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/list-products.d.ts:211 +medusa/dist/api/routes/admin/products/list-products.d.ts:212 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/list-products.d.ts:210 +medusa/dist/api/routes/admin/products/list-products.d.ts:211 ___ diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductMetadataReq.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductMetadataReq.md index d8bd611b869c3..d86ee737fbdfb 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductMetadataReq.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductMetadataReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/set-metadata.d.ts:77 +medusa/dist/api/routes/admin/products/set-metadata.d.ts:79 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/set-metadata.d.ts:78 +medusa/dist/api/routes/admin/products/set-metadata.d.ts:80 diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsOption.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsOption.md index 1580001aabfc3..7d305c8dce93f 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsOption.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsOption.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/products/update-option.d.ts:72 +medusa/dist/api/routes/admin/products/update-option.d.ts:74 diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsReq.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsReq.md index 0f022a38c7430..b800fb7f8e464 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsReq.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductOptionsReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/products/add-option.d.ts:71 +medusa/dist/api/routes/admin/products/add-option.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductReq.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductReq.md index 72c9bf1468ebf..40c1a9c9bd5ff 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductReq.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:293 +medusa/dist/api/routes/admin/products/update-product.d.ts:295 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:286 +medusa/dist/api/routes/admin/products/update-product.d.ts:288 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:287 +medusa/dist/api/routes/admin/products/update-product.d.ts:289 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:290 +medusa/dist/api/routes/admin/products/update-product.d.ts:292 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:299 +medusa/dist/api/routes/admin/products/update-product.d.ts:301 ___ @@ -60,17 +60,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:301 +medusa/dist/api/routes/admin/products/update-product.d.ts:303 ___ ### images -• **images**: `string`[] +• `Optional` **images**: `string`[] #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:288 +medusa/dist/api/routes/admin/products/update-product.d.ts:290 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:298 +medusa/dist/api/routes/admin/products/update-product.d.ts:300 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:304 +medusa/dist/api/routes/admin/products/update-product.d.ts:306 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:305 +medusa/dist/api/routes/admin/products/update-product.d.ts:307 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:303 +medusa/dist/api/routes/admin/products/update-product.d.ts:305 ___ @@ -120,17 +120,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:302 +medusa/dist/api/routes/admin/products/update-product.d.ts:304 ___ ### sales\_channels -• **sales\_channels**: ``null`` \| [`ProductSalesChannelReq`](internal-20.ProductSalesChannelReq.md)[] +• `Optional` **sales\_channels**: ``null`` \| [`ProductSalesChannelReq`](internal-20.ProductSalesChannelReq.md)[] #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:295 +medusa/dist/api/routes/admin/products/update-product.d.ts:297 ___ @@ -140,7 +140,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:291 +medusa/dist/api/routes/admin/products/update-product.d.ts:293 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:285 +medusa/dist/api/routes/admin/products/update-product.d.ts:287 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:294 +medusa/dist/api/routes/admin/products/update-product.d.ts:296 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:289 +medusa/dist/api/routes/admin/products/update-product.d.ts:291 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:284 +medusa/dist/api/routes/admin/products/update-product.d.ts:286 ___ @@ -190,7 +190,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:292 +medusa/dist/api/routes/admin/products/update-product.d.ts:294 ___ @@ -200,7 +200,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:296 +medusa/dist/api/routes/admin/products/update-product.d.ts:298 ___ @@ -210,7 +210,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:297 +medusa/dist/api/routes/admin/products/update-product.d.ts:299 ___ @@ -220,4 +220,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:300 +medusa/dist/api/routes/admin/products/update-product.d.ts:302 diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsReq.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsReq.md index 74047a11480e7..02d4cc5096621 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsReq.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:199 +medusa/dist/api/routes/admin/products/create-variant.d.ts:201 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:196 +medusa/dist/api/routes/admin/products/create-variant.d.ts:198 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:194 +medusa/dist/api/routes/admin/products/create-variant.d.ts:196 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:203 +medusa/dist/api/routes/admin/products/create-variant.d.ts:205 ___ @@ -50,17 +50,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:197 +medusa/dist/api/routes/admin/products/create-variant.d.ts:199 ___ ### inventory\_quantity -• **inventory\_quantity**: `number` +• `Optional` **inventory\_quantity**: `number` #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:198 +medusa/dist/api/routes/admin/products/create-variant.d.ts:200 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:202 +medusa/dist/api/routes/admin/products/create-variant.d.ts:204 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:200 +medusa/dist/api/routes/admin/products/create-variant.d.ts:202 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:207 +medusa/dist/api/routes/admin/products/create-variant.d.ts:209 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:208 +medusa/dist/api/routes/admin/products/create-variant.d.ts:210 ___ @@ -110,17 +110,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:206 +medusa/dist/api/routes/admin/products/create-variant.d.ts:208 ___ ### options -• **options**: [`ProductVariantOptionReq`](internal-20.ProductVariantOptionReq.md)[] +• `Optional` **options**: [`ProductVariantOptionReq`](internal-20.ProductVariantOptionReq.md)[] #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:210 +medusa/dist/api/routes/admin/products/create-variant.d.ts:212 ___ @@ -130,7 +130,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:205 +medusa/dist/api/routes/admin/products/create-variant.d.ts:207 ___ @@ -140,7 +140,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:209 +medusa/dist/api/routes/admin/products/create-variant.d.ts:211 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:193 +medusa/dist/api/routes/admin/products/create-variant.d.ts:195 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:192 +medusa/dist/api/routes/admin/products/create-variant.d.ts:194 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:195 +medusa/dist/api/routes/admin/products/create-variant.d.ts:197 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:201 +medusa/dist/api/routes/admin/products/create-variant.d.ts:203 ___ @@ -190,4 +190,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:204 +medusa/dist/api/routes/admin/products/create-variant.d.ts:206 diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsVariantReq.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsVariantReq.md index 709532caf0595..739a4d41b0100 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsVariantReq.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsProductVariantsVariantReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:191 +medusa/dist/api/routes/admin/products/update-variant.d.ts:193 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:188 +medusa/dist/api/routes/admin/products/update-variant.d.ts:190 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:186 +medusa/dist/api/routes/admin/products/update-variant.d.ts:188 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:195 +medusa/dist/api/routes/admin/products/update-variant.d.ts:197 ___ @@ -50,17 +50,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:189 +medusa/dist/api/routes/admin/products/update-variant.d.ts:191 ___ ### inventory\_quantity -• **inventory\_quantity**: `number` +• `Optional` **inventory\_quantity**: `number` #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:190 +medusa/dist/api/routes/admin/products/update-variant.d.ts:192 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:194 +medusa/dist/api/routes/admin/products/update-variant.d.ts:196 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:192 +medusa/dist/api/routes/admin/products/update-variant.d.ts:194 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:199 +medusa/dist/api/routes/admin/products/update-variant.d.ts:201 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:200 +medusa/dist/api/routes/admin/products/update-variant.d.ts:202 ___ @@ -110,17 +110,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:198 +medusa/dist/api/routes/admin/products/update-variant.d.ts:200 ___ ### options -• **options**: [`ProductVariantOptionReq`](internal-20.ProductVariantOptionReq-1.md)[] +• `Optional` **options**: [`ProductVariantOptionReq`](internal-20.ProductVariantOptionReq-1.md)[] #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:202 +medusa/dist/api/routes/admin/products/update-variant.d.ts:204 ___ @@ -130,17 +130,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:197 +medusa/dist/api/routes/admin/products/update-variant.d.ts:199 ___ ### prices -• **prices**: [`ProductVariantPricesUpdateReq`](internal-20.ProductVariantPricesUpdateReq.md)[] +• `Optional` **prices**: [`ProductVariantPricesUpdateReq`](internal-20.ProductVariantPricesUpdateReq.md)[] #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:201 +medusa/dist/api/routes/admin/products/update-variant.d.ts:203 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:185 +medusa/dist/api/routes/admin/products/update-variant.d.ts:187 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:184 +medusa/dist/api/routes/admin/products/update-variant.d.ts:186 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:187 +medusa/dist/api/routes/admin/products/update-variant.d.ts:189 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:193 +medusa/dist/api/routes/admin/products/update-variant.d.ts:195 ___ @@ -190,4 +190,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:196 +medusa/dist/api/routes/admin/products/update-variant.d.ts:198 diff --git a/docs/content/references/js-client/classes/internal-20.AdminPostProductsReq.md b/docs/content/references/js-client/classes/internal-20.AdminPostProductsReq.md index 662da22199f44..142056af54285 100644 --- a/docs/content/references/js-client/classes/internal-20.AdminPostProductsReq.md +++ b/docs/content/references/js-client/classes/internal-20.AdminPostProductsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:308 +medusa/dist/api/routes/admin/products/create-product.d.ts:310 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:300 +medusa/dist/api/routes/admin/products/create-product.d.ts:302 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:302 +medusa/dist/api/routes/admin/products/create-product.d.ts:304 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:305 +medusa/dist/api/routes/admin/products/create-product.d.ts:307 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:315 +medusa/dist/api/routes/admin/products/create-product.d.ts:317 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:317 +medusa/dist/api/routes/admin/products/create-product.d.ts:319 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:303 +medusa/dist/api/routes/admin/products/create-product.d.ts:305 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:301 +medusa/dist/api/routes/admin/products/create-product.d.ts:303 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:314 +medusa/dist/api/routes/admin/products/create-product.d.ts:316 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:320 +medusa/dist/api/routes/admin/products/create-product.d.ts:322 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:321 +medusa/dist/api/routes/admin/products/create-product.d.ts:323 ___ @@ -120,7 +120,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:319 +medusa/dist/api/routes/admin/products/create-product.d.ts:321 ___ @@ -130,7 +130,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:311 +medusa/dist/api/routes/admin/products/create-product.d.ts:313 ___ @@ -140,7 +140,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:318 +medusa/dist/api/routes/admin/products/create-product.d.ts:320 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:310 +medusa/dist/api/routes/admin/products/create-product.d.ts:312 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:306 +medusa/dist/api/routes/admin/products/create-product.d.ts:308 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:299 +medusa/dist/api/routes/admin/products/create-product.d.ts:301 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:309 +medusa/dist/api/routes/admin/products/create-product.d.ts:311 ___ @@ -190,7 +190,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:304 +medusa/dist/api/routes/admin/products/create-product.d.ts:306 ___ @@ -200,7 +200,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:298 +medusa/dist/api/routes/admin/products/create-product.d.ts:300 ___ @@ -210,7 +210,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:307 +medusa/dist/api/routes/admin/products/create-product.d.ts:309 ___ @@ -220,7 +220,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:312 +medusa/dist/api/routes/admin/products/create-product.d.ts:314 ___ @@ -230,7 +230,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:313 +medusa/dist/api/routes/admin/products/create-product.d.ts:315 ___ @@ -240,4 +240,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:316 +medusa/dist/api/routes/admin/products/create-product.d.ts:318 diff --git a/docs/content/references/js-client/classes/internal-20.ProductOptionReq.md b/docs/content/references/js-client/classes/internal-20.ProductOptionReq.md index b85ad8d0686d9..a1841a327f2ba 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductOptionReq.md +++ b/docs/content/references/js-client/classes/internal-20.ProductOptionReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:274 +medusa/dist/api/routes/admin/products/create-product.d.ts:276 diff --git a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-1.md b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-1.md index 0043a67ea2597..1d6f9f1a66908 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-1.md +++ b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:181 +medusa/dist/api/routes/admin/products/update-variant.d.ts:183 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-variant.d.ts:180 +medusa/dist/api/routes/admin/products/update-variant.d.ts:182 diff --git a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-2.md b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-2.md index ed255e39c6e44..1938cab9e1e90 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-2.md +++ b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-2.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:271 +medusa/dist/api/routes/admin/products/create-product.d.ts:273 diff --git a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-3.md b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-3.md index 7d423d0287ca3..403bea4beacd6 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-3.md +++ b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq-3.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:259 +medusa/dist/api/routes/admin/products/update-product.d.ts:261 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:258 +medusa/dist/api/routes/admin/products/update-product.d.ts:260 diff --git a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq.md b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq.md index 6eb83c094f298..6926d540679df 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq.md +++ b/docs/content/references/js-client/classes/internal-20.ProductVariantOptionReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:189 +medusa/dist/api/routes/admin/products/create-variant.d.ts:191 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-variant.d.ts:188 +medusa/dist/api/routes/admin/products/create-variant.d.ts:190 diff --git a/docs/content/references/js-client/classes/internal-20.ProductVariantReq-1.md b/docs/content/references/js-client/classes/internal-20.ProductVariantReq-1.md index 951a62d0f37c3..8d45daab87456 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductVariantReq-1.md +++ b/docs/content/references/js-client/classes/internal-20.ProductVariantReq-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:270 +medusa/dist/api/routes/admin/products/update-product.d.ts:272 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:267 +medusa/dist/api/routes/admin/products/update-product.d.ts:269 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:265 +medusa/dist/api/routes/admin/products/update-product.d.ts:267 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:274 +medusa/dist/api/routes/admin/products/update-product.d.ts:276 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:268 +medusa/dist/api/routes/admin/products/update-product.d.ts:270 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:262 +medusa/dist/api/routes/admin/products/update-product.d.ts:264 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:269 +medusa/dist/api/routes/admin/products/update-product.d.ts:271 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:273 +medusa/dist/api/routes/admin/products/update-product.d.ts:275 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:271 +medusa/dist/api/routes/admin/products/update-product.d.ts:273 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:278 +medusa/dist/api/routes/admin/products/update-product.d.ts:280 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:279 +medusa/dist/api/routes/admin/products/update-product.d.ts:281 ___ @@ -120,7 +120,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:277 +medusa/dist/api/routes/admin/products/update-product.d.ts:279 ___ @@ -130,7 +130,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:281 +medusa/dist/api/routes/admin/products/update-product.d.ts:283 ___ @@ -140,17 +140,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:276 +medusa/dist/api/routes/admin/products/update-product.d.ts:278 ___ ### prices -• **prices**: [`ProductVariantPricesUpdateReq`](internal-20.ProductVariantPricesUpdateReq.md)[] +• `Optional` **prices**: [`ProductVariantPricesUpdateReq`](internal-20.ProductVariantPricesUpdateReq.md)[] #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:280 +medusa/dist/api/routes/admin/products/update-product.d.ts:282 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:264 +medusa/dist/api/routes/admin/products/update-product.d.ts:266 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:263 +medusa/dist/api/routes/admin/products/update-product.d.ts:265 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:266 +medusa/dist/api/routes/admin/products/update-product.d.ts:268 ___ @@ -190,7 +190,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:272 +medusa/dist/api/routes/admin/products/update-product.d.ts:274 ___ @@ -200,4 +200,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/update-product.d.ts:275 +medusa/dist/api/routes/admin/products/update-product.d.ts:277 diff --git a/docs/content/references/js-client/classes/internal-20.ProductVariantReq.md b/docs/content/references/js-client/classes/internal-20.ProductVariantReq.md index 363b3ee7f67fa..5d58dde0ac9c8 100644 --- a/docs/content/references/js-client/classes/internal-20.ProductVariantReq.md +++ b/docs/content/references/js-client/classes/internal-20.ProductVariantReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:284 +medusa/dist/api/routes/admin/products/create-product.d.ts:286 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:281 +medusa/dist/api/routes/admin/products/create-product.d.ts:283 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:279 +medusa/dist/api/routes/admin/products/create-product.d.ts:281 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:288 +medusa/dist/api/routes/admin/products/create-product.d.ts:290 ___ @@ -50,17 +50,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:282 +medusa/dist/api/routes/admin/products/create-product.d.ts:284 ___ ### inventory\_quantity -• **inventory\_quantity**: `number` +• `Optional` **inventory\_quantity**: `number` #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:283 +medusa/dist/api/routes/admin/products/create-product.d.ts:285 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:287 +medusa/dist/api/routes/admin/products/create-product.d.ts:289 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:285 +medusa/dist/api/routes/admin/products/create-product.d.ts:287 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:292 +medusa/dist/api/routes/admin/products/create-product.d.ts:294 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:293 +medusa/dist/api/routes/admin/products/create-product.d.ts:295 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:291 +medusa/dist/api/routes/admin/products/create-product.d.ts:293 ___ @@ -120,7 +120,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:295 +medusa/dist/api/routes/admin/products/create-product.d.ts:297 ___ @@ -130,7 +130,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:290 +medusa/dist/api/routes/admin/products/create-product.d.ts:292 ___ @@ -140,7 +140,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:294 +medusa/dist/api/routes/admin/products/create-product.d.ts:296 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:278 +medusa/dist/api/routes/admin/products/create-product.d.ts:280 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:277 +medusa/dist/api/routes/admin/products/create-product.d.ts:279 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:280 +medusa/dist/api/routes/admin/products/create-product.d.ts:282 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:286 +medusa/dist/api/routes/admin/products/create-product.d.ts:288 ___ @@ -190,4 +190,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/products/create-product.d.ts:289 +medusa/dist/api/routes/admin/products/create-product.d.ts:291 diff --git a/docs/content/references/js-client/classes/internal-21.AdminDeletePublishableApiKeySalesChannelsBatchReq.md b/docs/content/references/js-client/classes/internal-21.AdminDeletePublishableApiKeySalesChannelsBatchReq.md new file mode 100644 index 0000000000000..c3f047361a04d --- /dev/null +++ b/docs/content/references/js-client/classes/internal-21.AdminDeletePublishableApiKeySalesChannelsBatchReq.md @@ -0,0 +1,13 @@ +# Class: AdminDeletePublishableApiKeySalesChannelsBatchReq + +[internal](../modules/internal-21.md).AdminDeletePublishableApiKeySalesChannelsBatchReq + +## Properties + +### sales\_channel\_ids + +• **sales\_channel\_ids**: [`ProductBatchSalesChannel`](internal-21.ProductBatchSalesChannel.md)[] + +#### Defined in + +medusa/dist/api/routes/admin/publishable-api-keys/delete-channels-batch.d.ts:89 diff --git a/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeySalesChannelsBatchReq.md b/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeySalesChannelsBatchReq.md new file mode 100644 index 0000000000000..7e3ca74b1c6d2 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeySalesChannelsBatchReq.md @@ -0,0 +1,13 @@ +# Class: AdminPostPublishableApiKeySalesChannelsBatchReq + +[internal](../modules/internal-21.md).AdminPostPublishableApiKeySalesChannelsBatchReq + +## Properties + +### sales\_channel\_ids + +• **sales\_channel\_ids**: [`ProductBatchSalesChannel`](internal-21.ProductBatchSalesChannel.md)[] + +#### Defined in + +medusa/dist/api/routes/admin/publishable-api-keys/add-channels-batch.d.ts:89 diff --git a/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysPublishableApiKeyReq.md b/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysPublishableApiKeyReq.md index 7fee3ab5ebeb4..129d895d055c8 100644 --- a/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysPublishableApiKeyReq.md +++ b/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysPublishableApiKeyReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/publishable-api-keys/update-publishable-api-key.d.ts:70 +medusa/dist/api/routes/admin/publishable-api-keys/update-publishable-api-key.d.ts:72 diff --git a/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysReq.md b/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysReq.md index 1e63d26b14690..3a0217b4babf4 100644 --- a/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysReq.md +++ b/docs/content/references/js-client/classes/internal-21.AdminPostPublishableApiKeysReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/publishable-api-keys/create-publishable-api-key.d.ts:65 +medusa/dist/api/routes/admin/publishable-api-keys/create-publishable-api-key.d.ts:67 diff --git a/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeySalesChannelsParams.md b/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeySalesChannelsParams.md new file mode 100644 index 0000000000000..200d6f73ae653 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeySalesChannelsParams.md @@ -0,0 +1,3 @@ +# Class: GetPublishableApiKeySalesChannelsParams + +[internal](../modules/internal-21.md).GetPublishableApiKeySalesChannelsParams diff --git a/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeysParams.md b/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeysParams.md index 50ab9eae4f774..10ebffc9fffe8 100644 --- a/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeysParams.md +++ b/docs/content/references/js-client/classes/internal-21.GetPublishableApiKeysParams.md @@ -72,4 +72,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/publishable-api-keys/list-publishable-api-keys.d.ts:62 +medusa/dist/api/routes/admin/publishable-api-keys/list-publishable-api-keys.d.ts:63 diff --git a/docs/content/references/js-client/classes/internal-25.ProductBatchSalesChannel.md b/docs/content/references/js-client/classes/internal-21.ProductBatchSalesChannel.md similarity index 68% rename from docs/content/references/js-client/classes/internal-25.ProductBatchSalesChannel.md rename to docs/content/references/js-client/classes/internal-21.ProductBatchSalesChannel.md index 0013d094f9549..f57c20de78bac 100644 --- a/docs/content/references/js-client/classes/internal-25.ProductBatchSalesChannel.md +++ b/docs/content/references/js-client/classes/internal-21.ProductBatchSalesChannel.md @@ -1,6 +1,6 @@ # Class: ProductBatchSalesChannel -[internal](../modules/internal-25.md).ProductBatchSalesChannel +[internal](../modules/internal-21.md).ProductBatchSalesChannel ## Properties diff --git a/docs/content/references/js-client/classes/internal-22.AdminGetRegionsPaginationParams.md b/docs/content/references/js-client/classes/internal-22.AdminGetRegionsPaginationParams.md index a101234c6032d..139c1d13e6415 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminGetRegionsPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-22.AdminGetRegionsPaginationParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:98 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:99 ___ @@ -26,4 +26,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:99 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:100 diff --git a/docs/content/references/js-client/classes/internal-22.AdminGetRegionsParams.md b/docs/content/references/js-client/classes/internal-22.AdminGetRegionsParams.md index c6581efdb8dba..eeaf34a51ab9f 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminGetRegionsParams.md +++ b/docs/content/references/js-client/classes/internal-22.AdminGetRegionsParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:102 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:103 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:104 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:105 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:98 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:99 ___ @@ -54,7 +54,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:99 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:100 ___ @@ -64,4 +64,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/list-regions.d.ts:103 +medusa/dist/api/routes/admin/regions/list-regions.d.ts:104 diff --git a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionCountriesReq.md b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionCountriesReq.md index 7920b5a6b362a..07837873d1783 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionCountriesReq.md +++ b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionCountriesReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/regions/add-country.d.ts:74 +medusa/dist/api/routes/admin/regions/add-country.d.ts:76 diff --git a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionFulfillmentProvidersReq.md b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionFulfillmentProvidersReq.md index 8f804fc377117..7ee04dadb1ff1 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionFulfillmentProvidersReq.md +++ b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionFulfillmentProvidersReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/regions/add-fulfillment-provider.d.ts:71 +medusa/dist/api/routes/admin/regions/add-fulfillment-provider.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionPaymentProvidersReq.md b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionPaymentProvidersReq.md index 04f5148eed0e0..43646f348b1d5 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionPaymentProvidersReq.md +++ b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionPaymentProvidersReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/regions/add-payment-provider.d.ts:71 +medusa/dist/api/routes/admin/regions/add-payment-provider.d.ts:73 diff --git a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionReq.md b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionReq.md index 92e171b00fd8f..64e7cc724aa6d 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionReq.md +++ b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsRegionReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:113 +medusa/dist/api/routes/admin/regions/update-region.d.ts:115 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:117 +medusa/dist/api/routes/admin/regions/update-region.d.ts:119 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:109 +medusa/dist/api/routes/admin/regions/update-region.d.ts:111 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:116 +medusa/dist/api/routes/admin/regions/update-region.d.ts:118 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:112 +medusa/dist/api/routes/admin/regions/update-region.d.ts:114 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:118 +medusa/dist/api/routes/admin/regions/update-region.d.ts:120 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:119 +medusa/dist/api/routes/admin/regions/update-region.d.ts:121 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:108 +medusa/dist/api/routes/admin/regions/update-region.d.ts:110 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:115 +medusa/dist/api/routes/admin/regions/update-region.d.ts:117 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:110 +medusa/dist/api/routes/admin/regions/update-region.d.ts:112 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:114 +medusa/dist/api/routes/admin/regions/update-region.d.ts:116 ___ @@ -120,4 +120,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/update-region.d.ts:111 +medusa/dist/api/routes/admin/regions/update-region.d.ts:113 diff --git a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsReq.md b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsReq.md index e92bd12e12b32..18606cde29c4c 100644 --- a/docs/content/references/js-client/classes/internal-22.AdminPostRegionsReq.md +++ b/docs/content/references/js-client/classes/internal-22.AdminPostRegionsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:133 +medusa/dist/api/routes/admin/regions/create-region.d.ts:135 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:128 +medusa/dist/api/routes/admin/regions/create-region.d.ts:130 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:132 +medusa/dist/api/routes/admin/regions/create-region.d.ts:134 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:134 +medusa/dist/api/routes/admin/regions/create-region.d.ts:136 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:135 +medusa/dist/api/routes/admin/regions/create-region.d.ts:137 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:127 +medusa/dist/api/routes/admin/regions/create-region.d.ts:129 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:131 +medusa/dist/api/routes/admin/regions/create-region.d.ts:133 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:129 +medusa/dist/api/routes/admin/regions/create-region.d.ts:131 ___ @@ -90,4 +90,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/regions/create-region.d.ts:130 +medusa/dist/api/routes/admin/regions/create-region.d.ts:132 diff --git a/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReasonReq.md b/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReasonReq.md index 33b9548bf4cba..2982dbb6a4099 100644 --- a/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReasonReq.md +++ b/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReasonReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:80 +medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:82 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:78 +medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:80 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:81 +medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:83 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:79 +medusa/dist/api/routes/admin/return-reasons/update-reason.d.ts:81 diff --git a/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReq.md b/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReq.md index 6f8d2c5980818..e0cfd3d69ee33 100644 --- a/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReq.md +++ b/docs/content/references/js-client/classes/internal-23.AdminPostReturnReasonsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:87 +medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:89 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:85 +medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:87 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:88 +medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:90 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:86 +medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:88 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:84 +medusa/dist/api/routes/admin/return-reasons/create-reason.d.ts:86 diff --git a/docs/content/references/js-client/classes/internal-24.AdminGetReturnsParams.md b/docs/content/references/js-client/classes/internal-24.AdminGetReturnsParams.md index f34e944321137..87a6f08ad9089 100644 --- a/docs/content/references/js-client/classes/internal-24.AdminGetReturnsParams.md +++ b/docs/content/references/js-client/classes/internal-24.AdminGetReturnsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/returns/list-returns.d.ts:66 +medusa/dist/api/routes/admin/returns/list-returns.d.ts:67 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/returns/list-returns.d.ts:67 +medusa/dist/api/routes/admin/returns/list-returns.d.ts:68 diff --git a/docs/content/references/js-client/classes/internal-24.AdminPostReturnsReturnReceiveReq.md b/docs/content/references/js-client/classes/internal-24.AdminPostReturnsReturnReceiveReq.md index a1f7ea4b20419..a71a3d036fe98 100644 --- a/docs/content/references/js-client/classes/internal-24.AdminPostReturnsReturnReceiveReq.md +++ b/docs/content/references/js-client/classes/internal-24.AdminPostReturnsReturnReceiveReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/returns/receive-return.d.ts:98 +medusa/dist/api/routes/admin/returns/receive-return.d.ts:100 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/returns/receive-return.d.ts:99 +medusa/dist/api/routes/admin/returns/receive-return.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-24.Item.md b/docs/content/references/js-client/classes/internal-24.Item.md index 29b107310197a..7f23b3b6311e3 100644 --- a/docs/content/references/js-client/classes/internal-24.Item.md +++ b/docs/content/references/js-client/classes/internal-24.Item.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/returns/receive-return.d.ts:94 +medusa/dist/api/routes/admin/returns/receive-return.d.ts:96 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/returns/receive-return.d.ts:95 +medusa/dist/api/routes/admin/returns/receive-return.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-25.AdminDeleteSalesChannelsChannelProductsBatchReq.md b/docs/content/references/js-client/classes/internal-25.AdminDeleteSalesChannelsChannelProductsBatchReq.md index 796cac9f0f361..5e83e85e3d633 100644 --- a/docs/content/references/js-client/classes/internal-25.AdminDeleteSalesChannelsChannelProductsBatchReq.md +++ b/docs/content/references/js-client/classes/internal-25.AdminDeleteSalesChannelsChannelProductsBatchReq.md @@ -6,8 +6,8 @@ ### product\_ids -• **product\_ids**: [`ProductBatchSalesChannel`](internal-25.ProductBatchSalesChannel.md)[] +• **product\_ids**: [`ProductBatchSalesChannel`](internal-21.ProductBatchSalesChannel.md)[] #### Defined in -medusa/dist/api/routes/admin/sales-channels/delete-products-batch.d.ts:89 +medusa/dist/api/routes/admin/sales-channels/delete-products-batch.d.ts:91 diff --git a/docs/content/references/js-client/classes/internal-25.AdminGetSalesChannelsParams.md b/docs/content/references/js-client/classes/internal-25.AdminGetSalesChannelsParams.md index e48f176cb2827..01e08d0384677 100644 --- a/docs/content/references/js-client/classes/internal-25.AdminGetSalesChannelsParams.md +++ b/docs/content/references/js-client/classes/internal-25.AdminGetSalesChannelsParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:147 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:148 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:149 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:150 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:146 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:147 ___ @@ -74,7 +74,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:143 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:144 ___ @@ -98,7 +98,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:145 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:146 ___ @@ -122,7 +122,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:150 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:151 ___ @@ -132,7 +132,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:144 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:145 ___ @@ -142,4 +142,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:148 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:149 diff --git a/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsChannelProductsBatchReq.md b/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsChannelProductsBatchReq.md index e181338c267f3..199f477c399f4 100644 --- a/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsChannelProductsBatchReq.md +++ b/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsChannelProductsBatchReq.md @@ -6,8 +6,8 @@ ### product\_ids -• **product\_ids**: [`ProductBatchSalesChannel`](internal-25.ProductBatchSalesChannel.md)[] +• **product\_ids**: [`ProductBatchSalesChannel`](internal-21.ProductBatchSalesChannel.md)[] #### Defined in -medusa/dist/api/routes/admin/sales-channels/add-product-batch.d.ts:89 +medusa/dist/api/routes/admin/sales-channels/add-product-batch.d.ts:91 diff --git a/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsReq.md b/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsReq.md index 64af2c7abc5ca..ebb10084bda55 100644 --- a/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsReq.md +++ b/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts:78 +medusa/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts:80 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts:79 +medusa/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts:81 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts:77 +medusa/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts:79 diff --git a/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsSalesChannelReq.md b/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsSalesChannelReq.md index 5737c27434064..58ea870c20875 100644 --- a/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsSalesChannelReq.md +++ b/docs/content/references/js-client/classes/internal-25.AdminPostSalesChannelsSalesChannelReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts:77 +medusa/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts:79 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts:78 +medusa/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts:80 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts:76 +medusa/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts:78 diff --git a/docs/content/references/js-client/classes/internal-26.AdminGetShippingOptionsParams.md b/docs/content/references/js-client/classes/internal-26.AdminGetShippingOptionsParams.md index ccb6c5956529a..457ae342d7150 100644 --- a/docs/content/references/js-client/classes/internal-26.AdminGetShippingOptionsParams.md +++ b/docs/content/references/js-client/classes/internal-26.AdminGetShippingOptionsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts:76 +medusa/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts:77 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts:75 +medusa/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts:76 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts:74 +medusa/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts:75 diff --git a/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsOptionReq.md b/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsOptionReq.md index 6cbd32839ec21..4852ae867b89d 100644 --- a/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsOptionReq.md +++ b/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsOptionReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:123 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:125 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:121 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:123 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:125 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:127 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:124 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:126 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:120 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:122 ___ @@ -60,4 +60,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:122 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:124 diff --git a/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsReq.md b/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsReq.md index 8ca0ef3558c22..4329f33575103 100644 --- a/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsReq.md +++ b/docs/content/references/js-client/classes/internal-26.AdminPostShippingOptionsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:146 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:148 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:144 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:146 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:142 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:144 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:149 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:151 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:147 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:149 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:148 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:150 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:138 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:140 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:143 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:145 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:141 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:143 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:140 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:142 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:139 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:141 ___ @@ -120,4 +120,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:145 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:147 diff --git a/docs/content/references/js-client/classes/internal-26.OptionRequirement-1.md b/docs/content/references/js-client/classes/internal-26.OptionRequirement-1.md index aa91f9cf4749c..7224de5acf693 100644 --- a/docs/content/references/js-client/classes/internal-26.OptionRequirement-1.md +++ b/docs/content/references/js-client/classes/internal-26.OptionRequirement-1.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:117 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:119 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:115 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:117 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:116 +medusa/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts:118 diff --git a/docs/content/references/js-client/classes/internal-26.OptionRequirement.md b/docs/content/references/js-client/classes/internal-26.OptionRequirement.md index b6a186342614c..043b359c03bfd 100644 --- a/docs/content/references/js-client/classes/internal-26.OptionRequirement.md +++ b/docs/content/references/js-client/classes/internal-26.OptionRequirement.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:135 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:137 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:134 +medusa/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts:136 diff --git a/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesProfileReq.md b/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesProfileReq.md index 18c652724c7da..2d91f7b5dcc63 100644 --- a/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesProfileReq.md +++ b/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesProfileReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-profiles/update-shipping-profile.d.ts:68 +medusa/dist/api/routes/admin/shipping-profiles/update-shipping-profile.d.ts:70 diff --git a/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesReq.md b/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesReq.md index 62d38eef0599e..a344c77bdd497 100644 --- a/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesReq.md +++ b/docs/content/references/js-client/classes/internal-27.AdminPostShippingProfilesReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/shipping-profiles/create-shipping-profile.d.ts:69 +medusa/dist/api/routes/admin/shipping-profiles/create-shipping-profile.d.ts:71 diff --git a/docs/content/references/js-client/classes/internal-28.AdminPostStoreReq.md b/docs/content/references/js-client/classes/internal-28.AdminPostStoreReq.md index ba0da6abb3dc1..6f5799ff162ad 100644 --- a/docs/content/references/js-client/classes/internal-28.AdminPostStoreReq.md +++ b/docs/content/references/js-client/classes/internal-28.AdminPostStoreReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:95 +medusa/dist/api/routes/admin/store/update-store.d.ts:97 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:94 +medusa/dist/api/routes/admin/store/update-store.d.ts:96 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:93 +medusa/dist/api/routes/admin/store/update-store.d.ts:95 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:96 +medusa/dist/api/routes/admin/store/update-store.d.ts:98 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:90 +medusa/dist/api/routes/admin/store/update-store.d.ts:92 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:92 +medusa/dist/api/routes/admin/store/update-store.d.ts:94 ___ @@ -70,4 +70,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/store/update-store.d.ts:91 +medusa/dist/api/routes/admin/store/update-store.d.ts:93 diff --git a/docs/content/references/js-client/classes/internal-29.AdminGetSwapsParams.md b/docs/content/references/js-client/classes/internal-29.AdminGetSwapsParams.md index 2fd81220132f4..871928d64e031 100644 --- a/docs/content/references/js-client/classes/internal-29.AdminGetSwapsParams.md +++ b/docs/content/references/js-client/classes/internal-29.AdminGetSwapsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/swaps/list-swaps.d.ts:67 +medusa/dist/api/routes/admin/swaps/list-swaps.d.ts:68 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/swaps/list-swaps.d.ts:68 +medusa/dist/api/routes/admin/swaps/list-swaps.d.ts:69 diff --git a/docs/content/references/js-client/classes/internal-3.AdminDeleteProductsFromCollectionReq.md b/docs/content/references/js-client/classes/internal-3.AdminDeleteProductsFromCollectionReq.md index 471d3af660641..170b01c70bfa7 100644 --- a/docs/content/references/js-client/classes/internal-3.AdminDeleteProductsFromCollectionReq.md +++ b/docs/content/references/js-client/classes/internal-3.AdminDeleteProductsFromCollectionReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/collections/remove-products.d.ts:76 +medusa/dist/api/routes/admin/collections/remove-products.d.ts:78 diff --git a/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsPaginationParams.md b/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsPaginationParams.md index cd1c618f3b6db..f0946d662368e 100644 --- a/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsPaginationParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:139 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:140 ___ @@ -26,4 +26,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:140 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:141 diff --git a/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsParams.md b/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsParams.md index 46ccef68653f6..4b2e090eed3af 100644 --- a/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsParams.md +++ b/docs/content/references/js-client/classes/internal-3.AdminGetCollectionsParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:145 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:146 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:147 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:148 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:149 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:150 ___ @@ -46,7 +46,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:144 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:145 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:139 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:140 ___ @@ -74,7 +74,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:140 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:141 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:148 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:149 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:143 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:144 ___ @@ -104,4 +104,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/list-collections.d.ts:146 +medusa/dist/api/routes/admin/collections/list-collections.d.ts:147 diff --git a/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsCollectionReq.md b/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsCollectionReq.md index 7cb858efd3c9d..a1edb17930079 100644 --- a/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsCollectionReq.md +++ b/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsCollectionReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/collections/update-collection.d.ts:77 +medusa/dist/api/routes/admin/collections/update-collection.d.ts:79 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/update-collection.d.ts:78 +medusa/dist/api/routes/admin/collections/update-collection.d.ts:80 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/update-collection.d.ts:76 +medusa/dist/api/routes/admin/collections/update-collection.d.ts:78 diff --git a/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsReq.md b/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsReq.md index 0c7de4345ce02..5caa7ebb4f83e 100644 --- a/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsReq.md +++ b/docs/content/references/js-client/classes/internal-3.AdminPostCollectionsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/collections/create-collection.d.ts:77 +medusa/dist/api/routes/admin/collections/create-collection.d.ts:79 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/create-collection.d.ts:78 +medusa/dist/api/routes/admin/collections/create-collection.d.ts:80 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/collections/create-collection.d.ts:76 +medusa/dist/api/routes/admin/collections/create-collection.d.ts:78 diff --git a/docs/content/references/js-client/classes/internal-3.AdminPostProductsToCollectionReq.md b/docs/content/references/js-client/classes/internal-3.AdminPostProductsToCollectionReq.md index 99b7f4acdc80a..e123ff3642d28 100644 --- a/docs/content/references/js-client/classes/internal-3.AdminPostProductsToCollectionReq.md +++ b/docs/content/references/js-client/classes/internal-3.AdminPostProductsToCollectionReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/collections/add-products.d.ts:65 +medusa/dist/api/routes/admin/collections/add-products.d.ts:67 diff --git a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesParams.md b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesParams.md index e8082797862e3..e9aeb5c1d11ce 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesParams.md +++ b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts:98 +medusa/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts:100 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts:99 +medusa/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesReq.md b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesReq.md index bdfa885b51796..047f9fcbc467d 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductTypesReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts:95 +medusa/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsParams.md b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsParams.md index f047faa4ddc13..aa16de6379096 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsParams.md +++ b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-products.d.ts:98 +medusa/dist/api/routes/admin/tax-rates/remove-from-products.d.ts:100 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-products.d.ts:99 +medusa/dist/api/routes/admin/tax-rates/remove-from-products.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsReq.md b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsReq.md index c5c7706f33446..5dd3774f67bb5 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateProductsReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-products.d.ts:95 +medusa/dist/api/routes/admin/tax-rates/remove-from-products.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsParams.md b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsParams.md index 198905b9b5a96..db021b6e86268 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsParams.md +++ b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts:98 +medusa/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts:100 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts:99 +medusa/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsReq.md b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsReq.md index 1a074924b740b..fb87475a2eea1 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminDeleteTaxRatesTaxRateShippingOptionsReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts:95 +medusa/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesParams.md b/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesParams.md index 227cdee594de7..5a9ffb8256550 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesParams.md +++ b/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:123 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:124 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:127 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:128 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:128 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:129 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:126 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:127 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:122 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:123 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:125 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:126 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:124 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:125 ___ @@ -80,4 +80,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:121 +medusa/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts:122 diff --git a/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesTaxRateParams.md b/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesTaxRateParams.md index 33652119a6025..f5f30a2c77ebc 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesTaxRateParams.md +++ b/docs/content/references/js-client/classes/internal-30.AdminGetTaxRatesTaxRateParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts:73 +medusa/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts:74 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts:74 +medusa/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts:75 diff --git a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesReq.md b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesReq.md index 8fbd005c06ba1..6bd504c154e14 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:118 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:120 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:119 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:121 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:124 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:126 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:122 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:124 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:121 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:123 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:120 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:122 ___ @@ -70,4 +70,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:123 +medusa/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts:125 diff --git a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductTypesReq.md b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductTypesReq.md index d1b01e277e7ec..b34edfb827c39 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductTypesReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductTypesReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/add-to-product-types.d.ts:95 +medusa/dist/api/routes/admin/tax-rates/add-to-product-types.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductsReq.md b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductsReq.md index e3c70e8614da3..d8a4a23f54f6e 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductsReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateProductsReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/add-to-products.d.ts:95 +medusa/dist/api/routes/admin/tax-rates/add-to-products.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateReq.md b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateReq.md index 61555c467b84d..1496dd17ccc8e 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:111 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:113 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:112 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:114 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:117 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:119 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:115 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:117 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:114 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:116 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:113 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:115 ___ @@ -70,4 +70,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:116 +medusa/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts:118 diff --git a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateShippingOptionsReq.md b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateShippingOptionsReq.md index ecfa14e448740..15392d4796ae4 100644 --- a/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateShippingOptionsReq.md +++ b/docs/content/references/js-client/classes/internal-30.AdminPostTaxRatesTaxRateShippingOptionsReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/tax-rates/add-to-shipping-options.d.ts:95 +medusa/dist/api/routes/admin/tax-rates/add-to-shipping-options.d.ts:97 diff --git a/docs/content/references/js-client/classes/internal-31.AdminDeleteUploadsReq.md b/docs/content/references/js-client/classes/internal-31.AdminDeleteUploadsReq.md index 77496887dedc7..8ae33e5199851 100644 --- a/docs/content/references/js-client/classes/internal-31.AdminDeleteUploadsReq.md +++ b/docs/content/references/js-client/classes/internal-31.AdminDeleteUploadsReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/uploads/delete-upload.d.ts:78 +medusa/dist/api/routes/admin/uploads/delete-upload.d.ts:80 diff --git a/docs/content/references/js-client/classes/internal-31.AdminPostUploadsDownloadUrlReq.md b/docs/content/references/js-client/classes/internal-31.AdminPostUploadsDownloadUrlReq.md index 1b92af6968530..5dfa7cc70260a 100644 --- a/docs/content/references/js-client/classes/internal-31.AdminPostUploadsDownloadUrlReq.md +++ b/docs/content/references/js-client/classes/internal-31.AdminPostUploadsDownloadUrlReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/uploads/get-download-url.d.ts:70 +medusa/dist/api/routes/admin/uploads/get-download-url.d.ts:72 diff --git a/docs/content/references/js-client/classes/internal-31.IAdminPostUploadsFileReq.md b/docs/content/references/js-client/classes/internal-31.IAdminPostUploadsFileReq.md index 948262ee18635..f688b92c76cf4 100644 --- a/docs/content/references/js-client/classes/internal-31.IAdminPostUploadsFileReq.md +++ b/docs/content/references/js-client/classes/internal-31.IAdminPostUploadsFileReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/uploads/create-upload.d.ts:72 +medusa/dist/api/routes/admin/uploads/create-upload.d.ts:73 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/uploads/create-upload.d.ts:73 +medusa/dist/api/routes/admin/uploads/create-upload.d.ts:74 diff --git a/docs/content/references/js-client/classes/internal-32.AdminCreateUserRequest.md b/docs/content/references/js-client/classes/internal-32.AdminCreateUserRequest.md index fb7243287fa82..5f0e415a59ebc 100644 --- a/docs/content/references/js-client/classes/internal-32.AdminCreateUserRequest.md +++ b/docs/content/references/js-client/classes/internal-32.AdminCreateUserRequest.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/users/create-user.d.ts:88 +medusa/dist/api/routes/admin/users/create-user.d.ts:90 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/create-user.d.ts:89 +medusa/dist/api/routes/admin/users/create-user.d.ts:91 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/create-user.d.ts:90 +medusa/dist/api/routes/admin/users/create-user.d.ts:92 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/create-user.d.ts:92 +medusa/dist/api/routes/admin/users/create-user.d.ts:94 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/create-user.d.ts:91 +medusa/dist/api/routes/admin/users/create-user.d.ts:93 diff --git a/docs/content/references/js-client/classes/internal-32.AdminResetPasswordRequest.md b/docs/content/references/js-client/classes/internal-32.AdminResetPasswordRequest.md index 876d163662c49..078d703426032 100644 --- a/docs/content/references/js-client/classes/internal-32.AdminResetPasswordRequest.md +++ b/docs/content/references/js-client/classes/internal-32.AdminResetPasswordRequest.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/users/reset-password.d.ts:85 +medusa/dist/api/routes/admin/users/reset-password.d.ts:87 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/reset-password.d.ts:87 +medusa/dist/api/routes/admin/users/reset-password.d.ts:89 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/reset-password.d.ts:86 +medusa/dist/api/routes/admin/users/reset-password.d.ts:88 diff --git a/docs/content/references/js-client/classes/internal-32.AdminResetPasswordTokenRequest.md b/docs/content/references/js-client/classes/internal-32.AdminResetPasswordTokenRequest.md index f7c19f95a1258..ccc035552df3a 100644 --- a/docs/content/references/js-client/classes/internal-32.AdminResetPasswordTokenRequest.md +++ b/docs/content/references/js-client/classes/internal-32.AdminResetPasswordTokenRequest.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/users/reset-password-token.d.ts:67 +medusa/dist/api/routes/admin/users/reset-password-token.d.ts:68 diff --git a/docs/content/references/js-client/classes/internal-32.AdminUpdateUserRequest.md b/docs/content/references/js-client/classes/internal-32.AdminUpdateUserRequest.md index 74bfe874097ce..d6565e5511de5 100644 --- a/docs/content/references/js-client/classes/internal-32.AdminUpdateUserRequest.md +++ b/docs/content/references/js-client/classes/internal-32.AdminUpdateUserRequest.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/users/update-user.d.ts:86 +medusa/dist/api/routes/admin/users/update-user.d.ts:88 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/update-user.d.ts:83 +medusa/dist/api/routes/admin/users/update-user.d.ts:85 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/update-user.d.ts:84 +medusa/dist/api/routes/admin/users/update-user.d.ts:86 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/update-user.d.ts:87 +medusa/dist/api/routes/admin/users/update-user.d.ts:89 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/users/update-user.d.ts:85 +medusa/dist/api/routes/admin/users/update-user.d.ts:87 diff --git a/docs/content/references/js-client/classes/internal-33.AdminGetVariantsParams.md b/docs/content/references/js-client/classes/internal-33.AdminGetVariantsParams.md index 6ebed228b8d53..a6a71121f300c 100644 --- a/docs/content/references/js-client/classes/internal-33.AdminGetVariantsParams.md +++ b/docs/content/references/js-client/classes/internal-33.AdminGetVariantsParams.md @@ -58,7 +58,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:115 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:116 ___ @@ -68,7 +68,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:116 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:117 ___ @@ -78,7 +78,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:117 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:118 ___ @@ -88,7 +88,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:119 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:120 ___ @@ -98,7 +98,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:113 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:114 ___ @@ -108,7 +108,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:114 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:115 ___ @@ -118,7 +118,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:112 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:113 ___ @@ -142,4 +142,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/variants/list-variants.d.ts:118 +medusa/dist/api/routes/admin/variants/list-variants.d.ts:119 diff --git a/docs/content/references/js-client/classes/internal-34.StorePostAuthReq.md b/docs/content/references/js-client/classes/internal-34.StorePostAuthReq.md index 0bf88be06af24..73b4f5081e1e3 100644 --- a/docs/content/references/js-client/classes/internal-34.StorePostAuthReq.md +++ b/docs/content/references/js-client/classes/internal-34.StorePostAuthReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/auth/create-session.d.ts:58 +medusa/dist/api/routes/store/auth/create-session.d.ts:59 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/auth/create-session.d.ts:59 +medusa/dist/api/routes/store/auth/create-session.d.ts:60 diff --git a/docs/content/references/js-client/classes/internal-35.Discount.md b/docs/content/references/js-client/classes/internal-35.Discount.md index fe9926f41dcd0..2a2a3dc905752 100644 --- a/docs/content/references/js-client/classes/internal-35.Discount.md +++ b/docs/content/references/js-client/classes/internal-35.Discount.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:121 +medusa/dist/api/routes/store/carts/update-cart.d.ts:123 diff --git a/docs/content/references/js-client/classes/internal-35.GiftCard.md b/docs/content/references/js-client/classes/internal-35.GiftCard.md index e1aa29844959c..ac568c380b7df 100644 --- a/docs/content/references/js-client/classes/internal-35.GiftCard.md +++ b/docs/content/references/js-client/classes/internal-35.GiftCard.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:118 +medusa/dist/api/routes/store/carts/update-cart.d.ts:120 diff --git a/docs/content/references/js-client/classes/internal-35.Item.md b/docs/content/references/js-client/classes/internal-35.Item.md index e35bfa655a817..b23974ced1724 100644 --- a/docs/content/references/js-client/classes/internal-35.Item.md +++ b/docs/content/references/js-client/classes/internal-35.Item.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:86 +medusa/dist/api/routes/store/carts/create-cart.d.ts:88 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:85 +medusa/dist/api/routes/store/carts/create-cart.d.ts:87 diff --git a/docs/content/references/js-client/classes/internal-35.StorePostCartReq.md b/docs/content/references/js-client/classes/internal-35.StorePostCartReq.md index c391a91df5bcc..aae710b7eab90 100644 --- a/docs/content/references/js-client/classes/internal-35.StorePostCartReq.md +++ b/docs/content/references/js-client/classes/internal-35.StorePostCartReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:92 +medusa/dist/api/routes/store/carts/create-cart.d.ts:94 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:90 +medusa/dist/api/routes/store/carts/create-cart.d.ts:92 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:91 +medusa/dist/api/routes/store/carts/create-cart.d.ts:93 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:89 +medusa/dist/api/routes/store/carts/create-cart.d.ts:91 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-cart.d.ts:93 +medusa/dist/api/routes/store/carts/create-cart.d.ts:95 diff --git a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionReq.md b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionReq.md index e751d9bed762e..7d8d4e52abcc4 100644 --- a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionReq.md +++ b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/carts/set-payment-session.d.ts:54 +medusa/dist/api/routes/store/carts/set-payment-session.d.ts:55 diff --git a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionUpdateReq.md b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionUpdateReq.md index ffb2aff6bcc35..60fcf4db67fc4 100644 --- a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionUpdateReq.md +++ b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartPaymentSessionUpdateReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/carts/update-payment-session.d.ts:57 +medusa/dist/api/routes/store/carts/update-payment-session.d.ts:58 diff --git a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartReq.md b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartReq.md index fb21f6b3a1a61..fdba1ff22591f 100644 --- a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartReq.md +++ b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:127 +medusa/dist/api/routes/store/carts/update-cart.d.ts:129 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:132 +medusa/dist/api/routes/store/carts/update-cart.d.ts:134 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:125 +medusa/dist/api/routes/store/carts/update-cart.d.ts:127 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:131 +medusa/dist/api/routes/store/carts/update-cart.d.ts:133 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:130 +medusa/dist/api/routes/store/carts/update-cart.d.ts:132 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:126 +medusa/dist/api/routes/store/carts/update-cart.d.ts:128 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:129 +medusa/dist/api/routes/store/carts/update-cart.d.ts:131 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:124 +medusa/dist/api/routes/store/carts/update-cart.d.ts:126 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:133 +medusa/dist/api/routes/store/carts/update-cart.d.ts:135 ___ @@ -100,4 +100,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/update-cart.d.ts:128 +medusa/dist/api/routes/store/carts/update-cart.d.ts:130 diff --git a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartShippingMethodReq.md b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartShippingMethodReq.md index 4a924d4bc6502..ed5240ea405bd 100644 --- a/docs/content/references/js-client/classes/internal-35.StorePostCartsCartShippingMethodReq.md +++ b/docs/content/references/js-client/classes/internal-35.StorePostCartsCartShippingMethodReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/carts/add-shipping-method.d.ts:56 +medusa/dist/api/routes/store/carts/add-shipping-method.d.ts:57 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/add-shipping-method.d.ts:55 +medusa/dist/api/routes/store/carts/add-shipping-method.d.ts:56 diff --git a/docs/content/references/js-client/classes/internal-36.StoreGetCollectionsParams.md b/docs/content/references/js-client/classes/internal-36.StoreGetCollectionsParams.md index f1ea08e013715..e89a1d5f94a87 100644 --- a/docs/content/references/js-client/classes/internal-36.StoreGetCollectionsParams.md +++ b/docs/content/references/js-client/classes/internal-36.StoreGetCollectionsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/collections/list-collections.d.ts:107 +medusa/dist/api/routes/store/collections/list-collections.d.ts:108 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/collections/list-collections.d.ts:104 +medusa/dist/api/routes/store/collections/list-collections.d.ts:105 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/collections/list-collections.d.ts:105 +medusa/dist/api/routes/store/collections/list-collections.d.ts:106 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/collections/list-collections.d.ts:106 +medusa/dist/api/routes/store/collections/list-collections.d.ts:107 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/collections/list-collections.d.ts:108 +medusa/dist/api/routes/store/collections/list-collections.d.ts:109 diff --git a/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersPaginationParams.md b/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersPaginationParams.md index aa020f3a9f4e8..62444582d76ae 100644 --- a/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersPaginationParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:184 +medusa/dist/api/routes/store/customers/list-orders.d.ts:185 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:183 +medusa/dist/api/routes/store/customers/list-orders.d.ts:184 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:181 +medusa/dist/api/routes/store/customers/list-orders.d.ts:182 ___ @@ -46,4 +46,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:182 +medusa/dist/api/routes/store/customers/list-orders.d.ts:183 diff --git a/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersParams.md b/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersParams.md index 3dfbca09eac72..c2147b4ff58eb 100644 --- a/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersParams.md +++ b/docs/content/references/js-client/classes/internal-37.StoreGetCustomersCustomerOrdersParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:200 +medusa/dist/api/routes/store/customers/list-orders.d.ts:201 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:193 +medusa/dist/api/routes/store/customers/list-orders.d.ts:194 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:198 +medusa/dist/api/routes/store/customers/list-orders.d.ts:199 ___ @@ -46,7 +46,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:196 +medusa/dist/api/routes/store/customers/list-orders.d.ts:197 ___ @@ -56,7 +56,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:192 +medusa/dist/api/routes/store/customers/list-orders.d.ts:193 ___ @@ -66,7 +66,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:194 +medusa/dist/api/routes/store/customers/list-orders.d.ts:195 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:184 +medusa/dist/api/routes/store/customers/list-orders.d.ts:185 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:183 +medusa/dist/api/routes/store/customers/list-orders.d.ts:184 ___ @@ -104,7 +104,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:190 +medusa/dist/api/routes/store/customers/list-orders.d.ts:191 ___ @@ -114,7 +114,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:187 +medusa/dist/api/routes/store/customers/list-orders.d.ts:188 ___ @@ -128,7 +128,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:181 +medusa/dist/api/routes/store/customers/list-orders.d.ts:182 ___ @@ -142,7 +142,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:182 +medusa/dist/api/routes/store/customers/list-orders.d.ts:183 ___ @@ -152,7 +152,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:191 +medusa/dist/api/routes/store/customers/list-orders.d.ts:192 ___ @@ -162,7 +162,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:188 +medusa/dist/api/routes/store/customers/list-orders.d.ts:189 ___ @@ -172,7 +172,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:195 +medusa/dist/api/routes/store/customers/list-orders.d.ts:196 ___ @@ -182,7 +182,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:189 +medusa/dist/api/routes/store/customers/list-orders.d.ts:190 ___ @@ -192,7 +192,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:197 +medusa/dist/api/routes/store/customers/list-orders.d.ts:198 ___ @@ -202,4 +202,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/list-orders.d.ts:199 +medusa/dist/api/routes/store/customers/list-orders.d.ts:200 diff --git a/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerPasswordTokenReq.md b/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerPasswordTokenReq.md index 4492dc8979143..f6f433a3a69e0 100644 --- a/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerPasswordTokenReq.md +++ b/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerPasswordTokenReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/customers/reset-password-token.d.ts:61 +medusa/dist/api/routes/store/customers/reset-password-token.d.ts:62 diff --git a/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerReq.md b/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerReq.md index 13ce63dd244ea..9272687e74882 100644 --- a/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerReq.md +++ b/docs/content/references/js-client/classes/internal-37.StorePostCustomersCustomerReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:89 +medusa/dist/api/routes/store/customers/update-customer.d.ts:91 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:94 +medusa/dist/api/routes/store/customers/update-customer.d.ts:96 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:90 +medusa/dist/api/routes/store/customers/update-customer.d.ts:92 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:91 +medusa/dist/api/routes/store/customers/update-customer.d.ts:93 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:95 +medusa/dist/api/routes/store/customers/update-customer.d.ts:97 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:92 +medusa/dist/api/routes/store/customers/update-customer.d.ts:94 ___ @@ -70,4 +70,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/update-customer.d.ts:93 +medusa/dist/api/routes/store/customers/update-customer.d.ts:95 diff --git a/docs/content/references/js-client/classes/internal-37.StorePostCustomersReq.md b/docs/content/references/js-client/classes/internal-37.StorePostCustomersReq.md index 52492a18bd097..b6f75ae5d2440 100644 --- a/docs/content/references/js-client/classes/internal-37.StorePostCustomersReq.md +++ b/docs/content/references/js-client/classes/internal-37.StorePostCustomersReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/customers/create-customer.d.ts:103 +medusa/dist/api/routes/store/customers/create-customer.d.ts:106 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/create-customer.d.ts:101 +medusa/dist/api/routes/store/customers/create-customer.d.ts:104 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/create-customer.d.ts:102 +medusa/dist/api/routes/store/customers/create-customer.d.ts:105 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/create-customer.d.ts:104 +medusa/dist/api/routes/store/customers/create-customer.d.ts:107 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/create-customer.d.ts:105 +medusa/dist/api/routes/store/customers/create-customer.d.ts:108 diff --git a/docs/content/references/js-client/classes/internal-37.StorePostCustomersResetPasswordReq.md b/docs/content/references/js-client/classes/internal-37.StorePostCustomersResetPasswordReq.md index e59965d0c0674..b874035d51db4 100644 --- a/docs/content/references/js-client/classes/internal-37.StorePostCustomersResetPasswordReq.md +++ b/docs/content/references/js-client/classes/internal-37.StorePostCustomersResetPasswordReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/customers/reset-password.d.ts:77 +medusa/dist/api/routes/store/customers/reset-password.d.ts:79 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/reset-password.d.ts:79 +medusa/dist/api/routes/store/customers/reset-password.d.ts:81 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/customers/reset-password.d.ts:78 +medusa/dist/api/routes/store/customers/reset-password.d.ts:80 diff --git a/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsItemReq.md b/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsItemReq.md index aa96ed67c377b..fbf08e2d2747c 100644 --- a/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsItemReq.md +++ b/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsItemReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/carts/update-line-item.d.ts:55 +medusa/dist/api/routes/store/carts/update-line-item.d.ts:56 diff --git a/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsReq.md b/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsReq.md index 39a0999f75932..a48c03ccb6976 100644 --- a/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsReq.md +++ b/docs/content/references/js-client/classes/internal-39.StorePostCartsCartLineItemsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/carts/create-line-item/index.d.ts:61 +medusa/dist/api/routes/store/carts/create-line-item/index.d.ts:62 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-line-item/index.d.ts:60 +medusa/dist/api/routes/store/carts/create-line-item/index.d.ts:61 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/carts/create-line-item/index.d.ts:59 +medusa/dist/api/routes/store/carts/create-line-item/index.d.ts:60 diff --git a/docs/content/references/js-client/classes/internal-4.AdminGetCurrenciesParams.md b/docs/content/references/js-client/classes/internal-4.AdminGetCurrenciesParams.md index bf9960670ec0b..26a0255b141a2 100644 --- a/docs/content/references/js-client/classes/internal-4.AdminGetCurrenciesParams.md +++ b/docs/content/references/js-client/classes/internal-4.AdminGetCurrenciesParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/currencies/list-currencies.d.ts:58 +medusa/dist/api/routes/admin/currencies/list-currencies.d.ts:59 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/currencies/list-currencies.d.ts:59 +medusa/dist/api/routes/admin/currencies/list-currencies.d.ts:60 ___ @@ -64,4 +64,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/currencies/list-currencies.d.ts:60 +medusa/dist/api/routes/admin/currencies/list-currencies.d.ts:61 diff --git a/docs/content/references/js-client/classes/internal-4.AdminPostCurrenciesCurrencyReq.md b/docs/content/references/js-client/classes/internal-4.AdminPostCurrenciesCurrencyReq.md index 8f78fa582f6d7..9bf9280aa6703 100644 --- a/docs/content/references/js-client/classes/internal-4.AdminPostCurrenciesCurrencyReq.md +++ b/docs/content/references/js-client/classes/internal-4.AdminPostCurrenciesCurrencyReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/currencies/update-currency.d.ts:56 +medusa/dist/api/routes/admin/currencies/update-currency.d.ts:58 diff --git a/docs/content/references/js-client/classes/internal-40.StorePostOrderEditsOrderEditDecline.md b/docs/content/references/js-client/classes/internal-40.StorePostOrderEditsOrderEditDecline.md index 3c1c1e9e1b1da..f7649fe79b55d 100644 --- a/docs/content/references/js-client/classes/internal-40.StorePostOrderEditsOrderEditDecline.md +++ b/docs/content/references/js-client/classes/internal-40.StorePostOrderEditsOrderEditDecline.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/order-edits/decline-order-edit.d.ts:54 +medusa/dist/api/routes/store/order-edits/decline-order-edit.d.ts:56 diff --git a/docs/content/references/js-client/classes/internal-41.ShippingAddressPayload.md b/docs/content/references/js-client/classes/internal-41.ShippingAddressPayload.md index b4fba12f93025..e7937b6b8d519 100644 --- a/docs/content/references/js-client/classes/internal-41.ShippingAddressPayload.md +++ b/docs/content/references/js-client/classes/internal-41.ShippingAddressPayload.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/orders/lookup-order.d.ts:70 +medusa/dist/api/routes/store/orders/lookup-order.d.ts:71 diff --git a/docs/content/references/js-client/classes/internal-41.StoreGetOrdersParams.md b/docs/content/references/js-client/classes/internal-41.StoreGetOrdersParams.md index 128a6c5d936fd..81814b9ff0d75 100644 --- a/docs/content/references/js-client/classes/internal-41.StoreGetOrdersParams.md +++ b/docs/content/references/js-client/classes/internal-41.StoreGetOrdersParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/orders/lookup-order.d.ts:73 +medusa/dist/api/routes/store/orders/lookup-order.d.ts:74 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/orders/lookup-order.d.ts:74 +medusa/dist/api/routes/store/orders/lookup-order.d.ts:75 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/orders/lookup-order.d.ts:75 +medusa/dist/api/routes/store/orders/lookup-order.d.ts:76 diff --git a/docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerAcceptClaimReq.md b/docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerAcceptClaimReq.md new file mode 100644 index 0000000000000..62a173a2daf53 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerAcceptClaimReq.md @@ -0,0 +1,13 @@ +# Class: StorePostCustomersCustomerAcceptClaimReq + +[internal](../modules/internal-41.md).StorePostCustomersCustomerAcceptClaimReq + +## Properties + +### token + +• **token**: `string` + +#### Defined in + +medusa/dist/api/routes/store/orders/confirm-order-request.d.ts:64 diff --git a/docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerOrderClaimReq.md b/docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerOrderClaimReq.md new file mode 100644 index 0000000000000..cfb762f6416d6 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-41.StorePostCustomersCustomerOrderClaimReq.md @@ -0,0 +1,13 @@ +# Class: StorePostCustomersCustomerOrderClaimReq + +[internal](../modules/internal-41.md).StorePostCustomersCustomerOrderClaimReq + +## Properties + +### order\_ids + +• **order\_ids**: `string`[] + +#### Defined in + +medusa/dist/api/routes/store/orders/request-order.d.ts:66 diff --git a/docs/content/references/js-client/classes/internal-42.PaymentCollectionSessionInputRequest.md b/docs/content/references/js-client/classes/internal-42.PaymentCollectionSessionInputRequest.md deleted file mode 100644 index 0f2183dbd5476..0000000000000 --- a/docs/content/references/js-client/classes/internal-42.PaymentCollectionSessionInputRequest.md +++ /dev/null @@ -1,43 +0,0 @@ -# Class: PaymentCollectionSessionInputRequest - -[internal](../modules/internal-42.md).PaymentCollectionSessionInputRequest - -## Properties - -### amount - -• **amount**: `number` - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/manage-payment-sessions.d.ts:109 - -___ - -### customer\_id - -• **customer\_id**: `string` - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/manage-payment-sessions.d.ts:108 - -___ - -### provider\_id - -• **provider\_id**: `string` - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/manage-payment-sessions.d.ts:107 - -___ - -### session\_id - -• `Optional` **session\_id**: `string` - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/manage-payment-sessions.d.ts:110 diff --git a/docs/content/references/js-client/classes/internal-42.StoreManagePaymentCollectionSessionRequest.md b/docs/content/references/js-client/classes/internal-42.StoreManagePaymentCollectionSessionRequest.md deleted file mode 100644 index 082b55f58fa35..0000000000000 --- a/docs/content/references/js-client/classes/internal-42.StoreManagePaymentCollectionSessionRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# Class: StoreManagePaymentCollectionSessionRequest - -[internal](../modules/internal-42.md).StoreManagePaymentCollectionSessionRequest - -## Properties - -### sessions - -• **sessions**: [`PaymentCollectionSessionInputRequest`](internal-42.PaymentCollectionSessionInputRequest.md) \| [`PaymentCollectionSessionInputRequest`](internal-42.PaymentCollectionSessionInputRequest.md)[] - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/manage-payment-sessions.d.ts:113 diff --git a/docs/content/references/js-client/classes/internal-42.StorePaymentCollectionSessionsReq.md b/docs/content/references/js-client/classes/internal-42.StorePaymentCollectionSessionsReq.md new file mode 100644 index 0000000000000..be25d9ce68be7 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-42.StorePaymentCollectionSessionsReq.md @@ -0,0 +1,13 @@ +# Class: StorePaymentCollectionSessionsReq + +[internal](../modules/internal-42.md).StorePaymentCollectionSessionsReq + +## Properties + +### provider\_id + +• **provider\_id**: `string` + +#### Defined in + +medusa/dist/api/routes/store/payment-collections/manage-payment-session.d.ts:69 diff --git a/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsAuthorizeReq.md b/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsAuthorizeReq.md new file mode 100644 index 0000000000000..0602b7a2fa5d0 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsAuthorizeReq.md @@ -0,0 +1,13 @@ +# Class: StorePostPaymentCollectionsBatchSessionsAuthorizeReq + +[internal](../modules/internal-42.md).StorePostPaymentCollectionsBatchSessionsAuthorizeReq + +## Properties + +### session\_ids + +• **session\_ids**: `string`[] + +#### Defined in + +medusa/dist/api/routes/store/payment-collections/authorize-batch-payment-sessions.d.ts:64 diff --git a/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsReq.md b/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsReq.md new file mode 100644 index 0000000000000..9ba691ca89449 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsBatchSessionsReq.md @@ -0,0 +1,13 @@ +# Class: StorePostPaymentCollectionsBatchSessionsReq + +[internal](../modules/internal-42.md).StorePostPaymentCollectionsBatchSessionsReq + +## Properties + +### sessions + +• **sessions**: [`StorePostPaymentCollectionsSessionsReq`](internal-42.StorePostPaymentCollectionsSessionsReq.md)[] + +#### Defined in + +medusa/dist/api/routes/store/payment-collections/manage-batch-payment-sessions.d.ts:106 diff --git a/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsSessionsReq.md b/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsSessionsReq.md new file mode 100644 index 0000000000000..9e78e37cc0d64 --- /dev/null +++ b/docs/content/references/js-client/classes/internal-42.StorePostPaymentCollectionsSessionsReq.md @@ -0,0 +1,33 @@ +# Class: StorePostPaymentCollectionsSessionsReq + +[internal](../modules/internal-42.md).StorePostPaymentCollectionsSessionsReq + +## Properties + +### amount + +• **amount**: `number` + +#### Defined in + +medusa/dist/api/routes/store/payment-collections/manage-batch-payment-sessions.d.ts:102 + +___ + +### provider\_id + +• **provider\_id**: `string` + +#### Defined in + +medusa/dist/api/routes/store/payment-collections/manage-batch-payment-sessions.d.ts:101 + +___ + +### session\_id + +• `Optional` **session\_id**: `string` + +#### Defined in + +medusa/dist/api/routes/store/payment-collections/manage-batch-payment-sessions.d.ts:103 diff --git a/docs/content/references/js-client/classes/internal-42.StoreRefreshPaymentCollectionSessionRequest.md b/docs/content/references/js-client/classes/internal-42.StoreRefreshPaymentCollectionSessionRequest.md deleted file mode 100644 index 84fc48f4c1091..0000000000000 --- a/docs/content/references/js-client/classes/internal-42.StoreRefreshPaymentCollectionSessionRequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# Class: StoreRefreshPaymentCollectionSessionRequest - -[internal](../modules/internal-42.md).StoreRefreshPaymentCollectionSessionRequest - -## Properties - -### customer\_id - -• **customer\_id**: `string` - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/refresh-payment-session.d.ts:63 - -___ - -### provider\_id - -• **provider\_id**: `string` - -#### Defined in - -medusa/dist/api/routes/store/payment-collections/refresh-payment-session.d.ts:62 diff --git a/docs/content/references/js-client/classes/internal-44.StoreGetProductTypesParams.md b/docs/content/references/js-client/classes/internal-44.StoreGetProductTypesParams.md index 134ad7197ce06..f473392a691e4 100644 --- a/docs/content/references/js-client/classes/internal-44.StoreGetProductTypesParams.md +++ b/docs/content/references/js-client/classes/internal-44.StoreGetProductTypesParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:134 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:135 ___ @@ -26,7 +26,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:137 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:138 ___ @@ -36,7 +36,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:131 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:132 ___ @@ -74,7 +74,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:136 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:137 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:132 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:133 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:135 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:136 ___ @@ -104,4 +104,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/product-types/list-product-types.d.ts:133 +medusa/dist/api/routes/store/product-types/list-product-types.d.ts:134 diff --git a/docs/content/references/js-client/classes/internal-45.StoreGetVariantsParams.md b/docs/content/references/js-client/classes/internal-45.StoreGetVariantsParams.md index 97797ab3b5938..a3c26a5b9e5b5 100644 --- a/docs/content/references/js-client/classes/internal-45.StoreGetVariantsParams.md +++ b/docs/content/references/js-client/classes/internal-45.StoreGetVariantsParams.md @@ -44,7 +44,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:84 +medusa/dist/api/routes/store/variants/list-variants.d.ts:85 ___ @@ -54,7 +54,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:86 +medusa/dist/api/routes/store/variants/list-variants.d.ts:87 ___ @@ -64,7 +64,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:85 +medusa/dist/api/routes/store/variants/list-variants.d.ts:86 ___ @@ -74,7 +74,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:88 +medusa/dist/api/routes/store/variants/list-variants.d.ts:89 ___ @@ -84,7 +84,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:82 +medusa/dist/api/routes/store/variants/list-variants.d.ts:83 ___ @@ -94,7 +94,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:83 +medusa/dist/api/routes/store/variants/list-variants.d.ts:84 ___ @@ -118,4 +118,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/variants/list-variants.d.ts:87 +medusa/dist/api/routes/store/variants/list-variants.d.ts:88 diff --git a/docs/content/references/js-client/classes/internal-46.StoreGetProductsPaginationParams.md b/docs/content/references/js-client/classes/internal-46.StoreGetProductsPaginationParams.md index e8077b97cffb0..c4f4d7341f0bb 100644 --- a/docs/content/references/js-client/classes/internal-46.StoreGetProductsPaginationParams.md +++ b/docs/content/references/js-client/classes/internal-46.StoreGetProductsPaginationParams.md @@ -46,7 +46,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:169 +medusa/dist/api/routes/store/products/list-products.d.ts:170 ___ @@ -56,7 +56,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:168 +medusa/dist/api/routes/store/products/list-products.d.ts:169 ___ @@ -66,7 +66,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:171 +medusa/dist/api/routes/store/products/list-products.d.ts:172 ___ @@ -76,7 +76,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:170 +medusa/dist/api/routes/store/products/list-products.d.ts:171 ___ diff --git a/docs/content/references/js-client/classes/internal-46.StoreGetProductsParams.md b/docs/content/references/js-client/classes/internal-46.StoreGetProductsParams.md index 45e36b49eae93..28e7cc9f1bd0c 100644 --- a/docs/content/references/js-client/classes/internal-46.StoreGetProductsParams.md +++ b/docs/content/references/js-client/classes/internal-46.StoreGetProductsParams.md @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:176 +medusa/dist/api/routes/store/products/list-products.d.ts:177 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:184 +medusa/dist/api/routes/store/products/list-products.d.ts:185 ___ @@ -64,7 +64,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:179 +medusa/dist/api/routes/store/products/list-products.d.ts:180 ___ @@ -78,7 +78,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:169 +medusa/dist/api/routes/store/products/list-products.d.ts:170 ___ @@ -92,7 +92,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:168 +medusa/dist/api/routes/store/products/list-products.d.ts:169 ___ @@ -102,7 +102,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:180 +medusa/dist/api/routes/store/products/list-products.d.ts:181 ___ @@ -112,7 +112,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:174 +medusa/dist/api/routes/store/products/list-products.d.ts:175 ___ @@ -122,7 +122,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:181 +medusa/dist/api/routes/store/products/list-products.d.ts:182 ___ @@ -136,7 +136,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:171 +medusa/dist/api/routes/store/products/list-products.d.ts:172 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:170 +medusa/dist/api/routes/store/products/list-products.d.ts:171 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:175 +medusa/dist/api/routes/store/products/list-products.d.ts:176 ___ @@ -184,7 +184,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:183 +medusa/dist/api/routes/store/products/list-products.d.ts:184 ___ @@ -194,7 +194,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:177 +medusa/dist/api/routes/store/products/list-products.d.ts:178 ___ @@ -204,7 +204,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:178 +medusa/dist/api/routes/store/products/list-products.d.ts:179 ___ @@ -214,7 +214,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:182 +medusa/dist/api/routes/store/products/list-products.d.ts:183 ___ @@ -224,4 +224,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/list-products.d.ts:185 +medusa/dist/api/routes/store/products/list-products.d.ts:186 diff --git a/docs/content/references/js-client/classes/internal-46.StorePostSearchReq.md b/docs/content/references/js-client/classes/internal-46.StorePostSearchReq.md index a31b99d1dfe0c..92f5019117be1 100644 --- a/docs/content/references/js-client/classes/internal-46.StorePostSearchReq.md +++ b/docs/content/references/js-client/classes/internal-46.StorePostSearchReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/products/search.d.ts:56 +medusa/dist/api/routes/store/products/search.d.ts:57 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/search.d.ts:55 +medusa/dist/api/routes/store/products/search.d.ts:56 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/search.d.ts:54 +medusa/dist/api/routes/store/products/search.d.ts:55 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/search.d.ts:53 +medusa/dist/api/routes/store/products/search.d.ts:54 diff --git a/docs/content/references/js-client/classes/internal-49.Item.md b/docs/content/references/js-client/classes/internal-49.Item.md index 40b18d8cfa15a..16e0332cfa939 100644 --- a/docs/content/references/js-client/classes/internal-49.Item.md +++ b/docs/content/references/js-client/classes/internal-49.Item.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:106 +medusa/dist/api/routes/store/returns/create-return.d.ts:108 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:109 +medusa/dist/api/routes/store/returns/create-return.d.ts:111 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:107 +medusa/dist/api/routes/store/returns/create-return.d.ts:109 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:108 +medusa/dist/api/routes/store/returns/create-return.d.ts:110 diff --git a/docs/content/references/js-client/classes/internal-49.ReturnShipping.md b/docs/content/references/js-client/classes/internal-49.ReturnShipping.md index 01154c9ef3488..1a82801225d5c 100644 --- a/docs/content/references/js-client/classes/internal-49.ReturnShipping.md +++ b/docs/content/references/js-client/classes/internal-49.ReturnShipping.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:103 +medusa/dist/api/routes/store/returns/create-return.d.ts:105 diff --git a/docs/content/references/js-client/classes/internal-49.StorePostReturnsReq.md b/docs/content/references/js-client/classes/internal-49.StorePostReturnsReq.md index c4bd4557d1f4e..13ac802fd5679 100644 --- a/docs/content/references/js-client/classes/internal-49.StorePostReturnsReq.md +++ b/docs/content/references/js-client/classes/internal-49.StorePostReturnsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:113 +medusa/dist/api/routes/store/returns/create-return.d.ts:115 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:112 +medusa/dist/api/routes/store/returns/create-return.d.ts:114 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/returns/create-return.d.ts:114 +medusa/dist/api/routes/store/returns/create-return.d.ts:116 diff --git a/docs/content/references/js-client/classes/internal-5.AdminDeleteCustomerGroupsGroupCustomerBatchReq.md b/docs/content/references/js-client/classes/internal-5.AdminDeleteCustomerGroupsGroupCustomerBatchReq.md index 3ec86e4bf030c..9573034c8b72f 100644 --- a/docs/content/references/js-client/classes/internal-5.AdminDeleteCustomerGroupsGroupCustomerBatchReq.md +++ b/docs/content/references/js-client/classes/internal-5.AdminDeleteCustomerGroupsGroupCustomerBatchReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts:88 +medusa/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts:90 diff --git a/docs/content/references/js-client/classes/internal-5.AdminGetCustomerGroupsParams.md b/docs/content/references/js-client/classes/internal-5.AdminGetCustomerGroupsParams.md index 0e937c703e68f..3c1be1ef2b797 100644 --- a/docs/content/references/js-client/classes/internal-5.AdminGetCustomerGroupsParams.md +++ b/docs/content/references/js-client/classes/internal-5.AdminGetCustomerGroupsParams.md @@ -44,7 +44,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:158 +medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:159 ___ @@ -68,7 +68,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:157 +medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:158 ___ @@ -92,7 +92,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:156 +medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:157 ___ @@ -102,7 +102,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:155 +medusa/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts:156 ___ diff --git a/docs/content/references/js-client/classes/internal-5.AdminGetCustomersParams.md b/docs/content/references/js-client/classes/internal-5.AdminGetCustomersParams.md index 21504624a4b21..bc73f915c8fe1 100644 --- a/docs/content/references/js-client/classes/internal-5.AdminGetCustomersParams.md +++ b/docs/content/references/js-client/classes/internal-5.AdminGetCustomersParams.md @@ -16,7 +16,7 @@ #### Defined in -medusa/dist/api/routes/admin/customers/list-customers.d.ts:73 +medusa/dist/api/routes/admin/customers/list-customers.d.ts:74 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/list-customers.d.ts:71 +medusa/dist/api/routes/admin/customers/list-customers.d.ts:72 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/list-customers.d.ts:72 +medusa/dist/api/routes/admin/customers/list-customers.d.ts:73 ___ diff --git a/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupCustomersBatchReq.md b/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupCustomersBatchReq.md index 02917f4673afe..7aec2f0c6e90c 100644 --- a/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupCustomersBatchReq.md +++ b/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupCustomersBatchReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts:88 +medusa/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts:90 diff --git a/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupReq.md b/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupReq.md index 58324a5ac4bf7..b4c3c482b6c79 100644 --- a/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupReq.md +++ b/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsGroupReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/customer-groups/update-customer-group.d.ts:74 +medusa/dist/api/routes/admin/customer-groups/update-customer-group.d.ts:76 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customer-groups/update-customer-group.d.ts:73 +medusa/dist/api/routes/admin/customer-groups/update-customer-group.d.ts:75 diff --git a/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsReq.md b/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsReq.md index 3ba947f21b0ae..60580723365a9 100644 --- a/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsReq.md +++ b/docs/content/references/js-client/classes/internal-5.AdminPostCustomerGroupsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/customer-groups/create-customer-group.d.ts:64 +medusa/dist/api/routes/admin/customer-groups/create-customer-group.d.ts:65 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customer-groups/create-customer-group.d.ts:63 +medusa/dist/api/routes/admin/customer-groups/create-customer-group.d.ts:64 diff --git a/docs/content/references/js-client/classes/internal-50.StoreGetShippingOptionsParams.md b/docs/content/references/js-client/classes/internal-50.StoreGetShippingOptionsParams.md index 43fa3b4227c2b..fcb9cd6733884 100644 --- a/docs/content/references/js-client/classes/internal-50.StoreGetShippingOptionsParams.md +++ b/docs/content/references/js-client/classes/internal-50.StoreGetShippingOptionsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/shipping-options/list-options.d.ts:53 +medusa/dist/api/routes/store/shipping-options/list-options.d.ts:54 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/shipping-options/list-options.d.ts:51 +medusa/dist/api/routes/store/shipping-options/list-options.d.ts:52 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/shipping-options/list-options.d.ts:52 +medusa/dist/api/routes/store/shipping-options/list-options.d.ts:53 diff --git a/docs/content/references/js-client/classes/internal-51.AdditionalItem.md b/docs/content/references/js-client/classes/internal-51.AdditionalItem.md index 0095524ba4508..89aac74accc26 100644 --- a/docs/content/references/js-client/classes/internal-51.AdditionalItem.md +++ b/docs/content/references/js-client/classes/internal-51.AdditionalItem.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:131 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:133 ___ @@ -20,4 +20,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:130 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:132 diff --git a/docs/content/references/js-client/classes/internal-51.Item.md b/docs/content/references/js-client/classes/internal-51.Item.md index 5e7bf71e43120..300b2566cff69 100644 --- a/docs/content/references/js-client/classes/internal-51.Item.md +++ b/docs/content/references/js-client/classes/internal-51.Item.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:124 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:126 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:127 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:129 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:125 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:127 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:126 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:128 diff --git a/docs/content/references/js-client/classes/internal-51.StorePostSwapsReq.md b/docs/content/references/js-client/classes/internal-51.StorePostSwapsReq.md index f65c581f369a1..0a42548cfdf1f 100644 --- a/docs/content/references/js-client/classes/internal-51.StorePostSwapsReq.md +++ b/docs/content/references/js-client/classes/internal-51.StorePostSwapsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:136 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:138 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:134 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:136 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:135 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:137 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/swaps/create-swap.d.ts:137 +medusa/dist/api/routes/store/swaps/create-swap.d.ts:139 diff --git a/docs/content/references/js-client/classes/internal-6.AdminPostCustomersCustomerReq.md b/docs/content/references/js-client/classes/internal-6.AdminPostCustomersCustomerReq.md index 8b304fe5f6001..b6aafa8b9adef 100644 --- a/docs/content/references/js-client/classes/internal-6.AdminPostCustomersCustomerReq.md +++ b/docs/content/references/js-client/classes/internal-6.AdminPostCustomersCustomerReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:101 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:103 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:102 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:104 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:107 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:109 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:103 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:105 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:106 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:108 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:104 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:106 ___ @@ -70,4 +70,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:105 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:107 diff --git a/docs/content/references/js-client/classes/internal-6.AdminPostCustomersReq.md b/docs/content/references/js-client/classes/internal-6.AdminPostCustomersReq.md index ceeca954cc6f2..c39db02ee741a 100644 --- a/docs/content/references/js-client/classes/internal-6.AdminPostCustomersReq.md +++ b/docs/content/references/js-client/classes/internal-6.AdminPostCustomersReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/customers/create-customer.d.ts:95 +medusa/dist/api/routes/admin/customers/create-customer.d.ts:97 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/create-customer.d.ts:96 +medusa/dist/api/routes/admin/customers/create-customer.d.ts:98 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/create-customer.d.ts:97 +medusa/dist/api/routes/admin/customers/create-customer.d.ts:99 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/create-customer.d.ts:100 +medusa/dist/api/routes/admin/customers/create-customer.d.ts:102 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/create-customer.d.ts:98 +medusa/dist/api/routes/admin/customers/create-customer.d.ts:100 ___ @@ -60,4 +60,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/customers/create-customer.d.ts:99 +medusa/dist/api/routes/admin/customers/create-customer.d.ts:101 diff --git a/docs/content/references/js-client/classes/internal-6.Group.md b/docs/content/references/js-client/classes/internal-6.Group.md index 9111ddb4f967d..b9bbd4050b862 100644 --- a/docs/content/references/js-client/classes/internal-6.Group.md +++ b/docs/content/references/js-client/classes/internal-6.Group.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/customers/update-customer.d.ts:98 +medusa/dist/api/routes/admin/customers/update-customer.d.ts:100 diff --git a/docs/content/references/js-client/classes/internal-7.AdminCreateCondition.md b/docs/content/references/js-client/classes/internal-7.AdminCreateCondition.md index 32751a03353f0..7a5c2125ef862 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminCreateCondition.md +++ b/docs/content/references/js-client/classes/internal-7.AdminCreateCondition.md @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:199 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:204 ___ diff --git a/docs/content/references/js-client/classes/internal-7.AdminDeleteDiscountsDiscountConditionsConditionBatchReq.md b/docs/content/references/js-client/classes/internal-7.AdminDeleteDiscountsDiscountConditionsConditionBatchReq.md index fc6eb89cd8857..1de61ec3327f9 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminDeleteDiscountsDiscountConditionsConditionBatchReq.md +++ b/docs/content/references/js-client/classes/internal-7.AdminDeleteDiscountsDiscountConditionsConditionBatchReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/delete-resources-from-condition-batch.d.ts:85 +medusa/dist/api/routes/admin/discounts/delete-resources-from-condition-batch.d.ts:87 diff --git a/docs/content/references/js-client/classes/internal-7.AdminGetDiscountsParams.md b/docs/content/references/js-client/classes/internal-7.AdminGetDiscountsParams.md index 104db31aca310..79579ffacafb4 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminGetDiscountsParams.md +++ b/docs/content/references/js-client/classes/internal-7.AdminGetDiscountsParams.md @@ -44,7 +44,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:91 +medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:92 ___ @@ -54,7 +54,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:90 +medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:91 ___ @@ -92,7 +92,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:89 +medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:90 ___ @@ -102,4 +102,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:88 +medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:89 diff --git a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditions.md b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditions.md index 39b1621295320..c8757572d68a9 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditions.md +++ b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditions.md @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-condition.d.ts:104 +medusa/dist/api/routes/admin/discounts/create-condition.d.ts:106 ___ diff --git a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditionsConditionBatchReq.md b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditionsConditionBatchReq.md index 35100e6ea2aab..938c2f51ff73c 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditionsConditionBatchReq.md +++ b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountConditionsConditionBatchReq.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/add-resources-to-condition-batch.d.ts:83 +medusa/dist/api/routes/admin/discounts/add-resources-to-condition-batch.d.ts:85 diff --git a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountDynamicCodesReq.md b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountDynamicCodesReq.md index fdefb09855db8..c315ed0458f5e 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountDynamicCodesReq.md +++ b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountDynamicCodesReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/create-dynamic-code.d.ts:66 +medusa/dist/api/routes/admin/discounts/create-dynamic-code.d.ts:67 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-dynamic-code.d.ts:68 +medusa/dist/api/routes/admin/discounts/create-dynamic-code.d.ts:69 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-dynamic-code.d.ts:67 +medusa/dist/api/routes/admin/discounts/create-dynamic-code.d.ts:68 diff --git a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountReq.md b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountReq.md index 94e7850c1c0e8..ff280b06a579b 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountReq.md +++ b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:160 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:162 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:164 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:166 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:162 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:164 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:168 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:170 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:167 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:169 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:161 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:163 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:163 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:165 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:166 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:168 ___ @@ -90,4 +90,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:165 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:167 diff --git a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountRule.md b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountRule.md index 778efba8206fe..722c87eba5466 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountRule.md +++ b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsDiscountRule.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:195 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:200 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:196 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:201 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:192 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:197 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:193 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:198 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:194 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:199 diff --git a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsReq.md b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsReq.md index cba5361020371..014982154fab3 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsReq.md +++ b/docs/content/references/js-client/classes/internal-7.AdminPostDiscountsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:180 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:185 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:185 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:190 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:183 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:188 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:182 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:187 ___ @@ -50,17 +50,17 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:189 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:194 ___ ### regions -• `Optional` **regions**: `string`[] +• **regions**: `string`[] #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:188 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:193 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:181 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:186 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:184 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:189 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:187 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:192 ___ @@ -100,4 +100,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/create-discount.d.ts:186 +medusa/dist/api/routes/admin/discounts/create-discount.d.ts:191 diff --git a/docs/content/references/js-client/classes/internal-7.AdminUpdateDiscountRule.md b/docs/content/references/js-client/classes/internal-7.AdminUpdateDiscountRule.md index 3769beb56b8f4..2919ecffe1e88 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminUpdateDiscountRule.md +++ b/docs/content/references/js-client/classes/internal-7.AdminUpdateDiscountRule.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:174 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:176 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:175 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:177 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:172 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:174 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:171 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:173 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:173 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:175 diff --git a/docs/content/references/js-client/classes/internal-7.AdminUpsertCondition.md b/docs/content/references/js-client/classes/internal-7.AdminUpsertCondition.md index 2148e5c8f9844..1e1f946dae8d6 100644 --- a/docs/content/references/js-client/classes/internal-7.AdminUpsertCondition.md +++ b/docs/content/references/js-client/classes/internal-7.AdminUpsertCondition.md @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:178 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:180 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/discounts/update-discount.d.ts:179 +medusa/dist/api/routes/admin/discounts/update-discount.d.ts:181 ___ diff --git a/docs/content/references/js-client/classes/internal-8.AdminGetDraftOrdersParams.md b/docs/content/references/js-client/classes/internal-8.AdminGetDraftOrdersParams.md index a52b515ff310f..3120fa7ebcaca 100644 --- a/docs/content/references/js-client/classes/internal-8.AdminGetDraftOrdersParams.md +++ b/docs/content/references/js-client/classes/internal-8.AdminGetDraftOrdersParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts:69 +medusa/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts:70 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts:70 +medusa/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts:71 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts:68 +medusa/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts:69 diff --git a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsItemReq.md b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsItemReq.md index bd0067ee68543..fcc99aa5b6284 100644 --- a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsItemReq.md +++ b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsItemReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:82 +medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:84 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:81 +medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:83 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:79 +medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:81 ___ @@ -40,4 +40,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:80 +medusa/dist/api/routes/admin/draft-orders/update-line-item.d.ts:82 diff --git a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsReq.md b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsReq.md index f2b55b248ae77..8897447c7c976 100644 --- a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsReq.md +++ b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderLineItemsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:88 +medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:90 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:87 +medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:89 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:84 +medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:86 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:85 +medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:87 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:86 +medusa/dist/api/routes/admin/draft-orders/create-line-item.d.ts:88 diff --git a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderReq.md b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderReq.md index c911b76f3d23f..d0cce142efb10 100644 --- a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderReq.md +++ b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersDraftOrderReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:110 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:112 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:108 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:110 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:113 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:115 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:112 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:114 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:109 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:111 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:114 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:116 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:107 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:109 ___ @@ -80,4 +80,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:111 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:113 diff --git a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersReq.md b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersReq.md index 26e2b98dfe9b9..160131c0b503b 100644 --- a/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersReq.md +++ b/docs/content/references/js-client/classes/internal-8.AdminPostDraftOrdersReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:175 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:177 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:180 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:182 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:179 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:181 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:174 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:176 ___ @@ -50,7 +50,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:177 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:179 ___ @@ -60,7 +60,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:183 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:185 ___ @@ -70,7 +70,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:181 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:183 ___ @@ -80,7 +80,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:178 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:180 ___ @@ -90,7 +90,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:176 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:178 ___ @@ -100,7 +100,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:182 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:184 ___ @@ -110,4 +110,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:173 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:175 diff --git a/docs/content/references/js-client/classes/internal-8.Discount-1.md b/docs/content/references/js-client/classes/internal-8.Discount-1.md index de83d95745d3a..e9b993a57f982 100644 --- a/docs/content/references/js-client/classes/internal-8.Discount-1.md +++ b/docs/content/references/js-client/classes/internal-8.Discount-1.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:117 +medusa/dist/api/routes/admin/draft-orders/update-draft-order.d.ts:119 diff --git a/docs/content/references/js-client/classes/internal-8.Discount.md b/docs/content/references/js-client/classes/internal-8.Discount.md index 5648d11d8d1fd..56ea800435998 100644 --- a/docs/content/references/js-client/classes/internal-8.Discount.md +++ b/docs/content/references/js-client/classes/internal-8.Discount.md @@ -10,4 +10,4 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:191 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:193 diff --git a/docs/content/references/js-client/classes/internal-8.Item.md b/docs/content/references/js-client/classes/internal-8.Item.md index cc5a489a6295a..c5b760c27abe7 100644 --- a/docs/content/references/js-client/classes/internal-8.Item.md +++ b/docs/content/references/js-client/classes/internal-8.Item.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:198 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:200 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:197 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:199 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:194 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:196 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:195 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:197 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:196 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:198 diff --git a/docs/content/references/js-client/classes/internal-8.ShippingMethod.md b/docs/content/references/js-client/classes/internal-8.ShippingMethod.md index dd5e4f4775c34..ea3a68a695407 100644 --- a/docs/content/references/js-client/classes/internal-8.ShippingMethod.md +++ b/docs/content/references/js-client/classes/internal-8.ShippingMethod.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:187 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:189 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:186 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:188 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:188 +medusa/dist/api/routes/admin/draft-orders/create-draft-order.d.ts:190 diff --git a/docs/content/references/js-client/classes/internal-9.AdminGetGiftCardsParams.md b/docs/content/references/js-client/classes/internal-9.AdminGetGiftCardsParams.md index f50378eb645d2..dbfa863a82b59 100644 --- a/docs/content/references/js-client/classes/internal-9.AdminGetGiftCardsParams.md +++ b/docs/content/references/js-client/classes/internal-9.AdminGetGiftCardsParams.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts:68 +medusa/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts:69 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts:69 +medusa/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts:70 ___ @@ -30,4 +30,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts:70 +medusa/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts:71 diff --git a/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsGiftCardReq.md b/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsGiftCardReq.md index 4b1d1564c37ab..727b55eb8baca 100644 --- a/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsGiftCardReq.md +++ b/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsGiftCardReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:82 +medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:84 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:84 +medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:86 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:83 +medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:85 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:86 +medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:88 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:85 +medusa/dist/api/routes/admin/gift-cards/update-gift-card.d.ts:87 diff --git a/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsReq.md b/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsReq.md index a2a9c62568fac..b775ad0be108f 100644 --- a/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsReq.md +++ b/docs/content/references/js-client/classes/internal-9.AdminPostGiftCardsReq.md @@ -10,7 +10,7 @@ #### Defined in -medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:83 +medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:85 ___ @@ -20,7 +20,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:84 +medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:86 ___ @@ -30,7 +30,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:86 +medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:88 ___ @@ -40,7 +40,7 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:85 +medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:87 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:82 +medusa/dist/api/routes/admin/gift-cards/create-gift-card.d.ts:84 diff --git a/docs/content/references/js-client/classes/internal.Cart.md b/docs/content/references/js-client/classes/internal.Cart.md index 7414b234a395c..8dbe0714c171d 100644 --- a/docs/content/references/js-client/classes/internal.Cart.md +++ b/docs/content/references/js-client/classes/internal.Cart.md @@ -22,7 +22,7 @@ Base abstract entity for all entities #### Defined in -medusa/dist/models/cart.d.ts:226 +medusa/dist/models/cart.d.ts:227 ___ @@ -32,7 +32,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:227 +medusa/dist/models/cart.d.ts:228 ___ @@ -42,7 +42,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:192 +medusa/dist/models/cart.d.ts:193 ___ @@ -52,7 +52,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:191 +medusa/dist/models/cart.d.ts:192 ___ @@ -62,7 +62,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:208 +medusa/dist/models/cart.d.ts:209 ___ @@ -72,7 +72,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:211 +medusa/dist/models/cart.d.ts:212 ___ @@ -96,7 +96,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:201 +medusa/dist/models/cart.d.ts:202 ___ @@ -106,7 +106,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:200 +medusa/dist/models/cart.d.ts:201 ___ @@ -130,7 +130,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:216 +medusa/dist/models/cart.d.ts:217 ___ @@ -140,7 +140,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:198 +medusa/dist/models/cart.d.ts:199 ___ @@ -150,7 +150,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:190 +medusa/dist/models/cart.d.ts:191 ___ @@ -160,7 +160,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:225 +medusa/dist/models/cart.d.ts:226 ___ @@ -170,7 +170,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:224 +medusa/dist/models/cart.d.ts:225 ___ @@ -180,7 +180,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:199 +medusa/dist/models/cart.d.ts:200 ___ @@ -204,7 +204,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:210 +medusa/dist/models/cart.d.ts:211 ___ @@ -214,7 +214,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:217 +medusa/dist/models/cart.d.ts:218 ___ @@ -224,7 +224,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:195 +medusa/dist/models/cart.d.ts:196 ___ @@ -234,7 +234,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:212 +medusa/dist/models/cart.d.ts:213 ___ @@ -244,7 +244,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:189 +medusa/dist/models/cart.d.ts:190 ___ @@ -254,7 +254,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:205 +medusa/dist/models/cart.d.ts:206 ___ @@ -264,7 +264,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:209 +medusa/dist/models/cart.d.ts:210 ___ @@ -274,7 +274,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:204 +medusa/dist/models/cart.d.ts:205 ___ @@ -284,7 +284,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:202 +medusa/dist/models/cart.d.ts:203 ___ @@ -294,7 +294,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:203 +medusa/dist/models/cart.d.ts:204 ___ @@ -304,7 +304,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:223 +medusa/dist/models/cart.d.ts:224 ___ @@ -314,7 +314,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:220 +medusa/dist/models/cart.d.ts:221 ___ @@ -324,7 +324,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:197 +medusa/dist/models/cart.d.ts:198 ___ @@ -334,7 +334,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:196 +medusa/dist/models/cart.d.ts:197 ___ @@ -344,7 +344,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:214 +medusa/dist/models/cart.d.ts:215 ___ @@ -354,7 +354,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:213 +medusa/dist/models/cart.d.ts:214 ___ @@ -364,7 +364,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:194 +medusa/dist/models/cart.d.ts:195 ___ @@ -374,7 +374,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:193 +medusa/dist/models/cart.d.ts:194 ___ @@ -384,7 +384,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:206 +medusa/dist/models/cart.d.ts:207 ___ @@ -394,7 +394,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:218 +medusa/dist/models/cart.d.ts:219 ___ @@ -404,7 +404,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:215 +medusa/dist/models/cart.d.ts:216 ___ @@ -414,7 +414,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:222 +medusa/dist/models/cart.d.ts:223 ___ @@ -424,7 +424,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:219 +medusa/dist/models/cart.d.ts:220 ___ @@ -434,7 +434,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:221 +medusa/dist/models/cart.d.ts:222 ___ @@ -444,7 +444,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:207 +medusa/dist/models/cart.d.ts:208 ___ diff --git a/docs/content/references/js-client/classes/internal.Client.md b/docs/content/references/js-client/classes/internal.Client.md index 317e5135bffee..7d0a179e6aa97 100644 --- a/docs/content/references/js-client/classes/internal.Client.md +++ b/docs/content/references/js-client/classes/internal.Client.md @@ -14,7 +14,7 @@ displayed_sidebar: jsClientSidebar #### Defined in -[medusa-js/src/request.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L34) +[medusa-js/src/request.ts:34](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L34) ___ @@ -24,7 +24,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L35) +[medusa-js/src/request.ts:35](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L35) ## Methods @@ -48,7 +48,7 @@ and the exponential backoff approach. #### Defined in -[medusa-js/src/request.ts:158](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L158) +[medusa-js/src/request.ts:158](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L158) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:88](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L88) +[medusa-js/src/request.ts:88](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L88) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:76](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L76) +[medusa-js/src/request.ts:76](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L76) ___ @@ -114,7 +114,7 @@ Axios request #### Defined in -[medusa-js/src/request.ts:195](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L195) +[medusa-js/src/request.ts:195](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L195) ___ @@ -135,7 +135,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:97](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L97) +[medusa-js/src/request.ts:97](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L97) ___ @@ -161,7 +161,7 @@ We add the idempotency key, if the request is configured to retry. #### Defined in -[medusa-js/src/request.ts:113](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L113) +[medusa-js/src/request.ts:113](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L113) ___ @@ -183,4 +183,4 @@ ___ #### Defined in -[medusa-js/src/request.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L45) +[medusa-js/src/request.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L45) diff --git a/docs/content/references/js-client/classes/internal.StorePostCustomersCustomerAddressesReq.md b/docs/content/references/js-client/classes/internal.StorePostCustomersCustomerAddressesReq.md index 55034bae21482..dba3f2b12d6ac 100644 --- a/docs/content/references/js-client/classes/internal.StorePostCustomersCustomerAddressesReq.md +++ b/docs/content/references/js-client/classes/internal.StorePostCustomersCustomerAddressesReq.md @@ -14,4 +14,4 @@ displayed_sidebar: jsClientSidebar #### Defined in -medusa/dist/api/routes/store/customers/create-address.d.ts:97 +medusa/dist/api/routes/store/customers/create-address.d.ts:99 diff --git a/docs/content/references/js-client/enums/internal.CartType.md b/docs/content/references/js-client/enums/internal.CartType.md index a7139634a8515..8ecf2803d36f7 100644 --- a/docs/content/references/js-client/enums/internal.CartType.md +++ b/docs/content/references/js-client/enums/internal.CartType.md @@ -14,7 +14,7 @@ displayed_sidebar: jsClientSidebar #### Defined in -medusa/dist/models/cart.d.ts:186 +medusa/dist/models/cart.d.ts:187 ___ @@ -24,7 +24,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:182 +medusa/dist/models/cart.d.ts:183 ___ @@ -34,7 +34,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:184 +medusa/dist/models/cart.d.ts:185 ___ @@ -44,7 +44,7 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:185 +medusa/dist/models/cart.d.ts:186 ___ @@ -54,4 +54,4 @@ ___ #### Defined in -medusa/dist/models/cart.d.ts:183 +medusa/dist/models/cart.d.ts:184 diff --git a/docs/content/references/js-client/interfaces/internal.Config.md b/docs/content/references/js-client/interfaces/internal.Config.md index 6bb158ba289ad..cac13872a0c60 100644 --- a/docs/content/references/js-client/interfaces/internal.Config.md +++ b/docs/content/references/js-client/interfaces/internal.Config.md @@ -14,7 +14,7 @@ displayed_sidebar: jsClientSidebar #### Defined in -[medusa-js/src/request.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L17) +[medusa-js/src/request.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L17) ___ @@ -24,7 +24,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L15) +[medusa-js/src/request.ts:15](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L15) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L16) +[medusa-js/src/request.ts:16](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L16) ___ @@ -44,4 +44,4 @@ ___ #### Defined in -[medusa-js/src/request.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L18) +[medusa-js/src/request.ts:18](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L18) diff --git a/docs/content/references/js-client/interfaces/internal.HTTPResponse.md b/docs/content/references/js-client/interfaces/internal.HTTPResponse.md index 4c820a43bcc68..1ed689e47e0da 100644 --- a/docs/content/references/js-client/interfaces/internal.HTTPResponse.md +++ b/docs/content/references/js-client/interfaces/internal.HTTPResponse.md @@ -14,7 +14,7 @@ displayed_sidebar: jsClientSidebar #### Defined in -[medusa-js/src/typings.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L13) +[medusa-js/src/typings.ts:13](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L13) ___ @@ -24,7 +24,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L10) +[medusa-js/src/typings.ts:10](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L10) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L14) +[medusa-js/src/typings.ts:14](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L14) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:8](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L8) +[medusa-js/src/typings.ts:8](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L8) ___ @@ -54,4 +54,4 @@ ___ #### Defined in -[medusa-js/src/typings.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L9) +[medusa-js/src/typings.ts:9](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L9) diff --git a/docs/content/references/js-client/interfaces/internal.RequestOptions.md b/docs/content/references/js-client/interfaces/internal.RequestOptions.md index 5dcefa3d06e69..e21606bf452c5 100644 --- a/docs/content/references/js-client/interfaces/internal.RequestOptions.md +++ b/docs/content/references/js-client/interfaces/internal.RequestOptions.md @@ -14,7 +14,7 @@ displayed_sidebar: jsClientSidebar #### Defined in -[medusa-js/src/request.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L23) +[medusa-js/src/request.ts:23](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L23) ___ @@ -24,4 +24,4 @@ ___ #### Defined in -[medusa-js/src/request.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L22) +[medusa-js/src/request.ts:22](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L22) diff --git a/docs/content/references/js-client/modules/internal-10.md b/docs/content/references/js-client/modules/internal-10.md index 085f903121368..fcf99d2addb6f 100644 --- a/docs/content/references/js-client/modules/internal-10.md +++ b/docs/content/references/js-client/modules/internal-10.md @@ -31,7 +31,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L47) +[medusa-js/src/typings.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L47) ___ @@ -41,4 +41,4 @@ ___ #### Defined in -[medusa-js/src/typings.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L45) +[medusa-js/src/typings.ts:45](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L45) diff --git a/docs/content/references/js-client/modules/internal-13.md b/docs/content/references/js-client/modules/internal-13.md index 235e6854baa5b..d02fbbbff5655 100644 --- a/docs/content/references/js-client/modules/internal-13.md +++ b/docs/content/references/js-client/modules/internal-13.md @@ -61,4 +61,4 @@ medusa/dist/api/routes/admin/order-edits/index.d.ts:5 #### Defined in -medusa/dist/api/routes/admin/order-edits/list-order-edit.d.ts:70 +medusa/dist/api/routes/admin/order-edits/list-order-edit.d.ts:71 diff --git a/docs/content/references/js-client/modules/internal-15.md b/docs/content/references/js-client/modules/internal-15.md index d73372d4ce341..f2e9c64f8462a 100644 --- a/docs/content/references/js-client/modules/internal-15.md +++ b/docs/content/references/js-client/modules/internal-15.md @@ -2,7 +2,7 @@ ## Classes -- [AdminUpdatePaymentCollectionRequest](../classes/internal-15.AdminUpdatePaymentCollectionRequest.md) +- [AdminUpdatePaymentCollectionsReq](../classes/internal-15.AdminUpdatePaymentCollectionsReq.md) - [GetPaymentCollectionsParams](../classes/internal-15.GetPaymentCollectionsParams.md) ## Type Aliases @@ -25,9 +25,9 @@ medusa/dist/api/routes/admin/payment-collections/index.d.ts:10 ___ -### AdminPaymentCollectionRes +### AdminPaymentCollectionsRes -Ƭ **AdminPaymentCollectionRes**: `Object` +Ƭ **AdminPaymentCollectionsRes**: `Object` #### Type declaration diff --git a/docs/content/references/js-client/modules/internal-17.md b/docs/content/references/js-client/modules/internal-17.md index 877d07685737b..50a75a5c31393 100644 --- a/docs/content/references/js-client/modules/internal-17.md +++ b/docs/content/references/js-client/modules/internal-17.md @@ -66,4 +66,4 @@ medusa/dist/api/routes/admin/price-lists/index.d.ts:21 #### Defined in -medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:174 +medusa/dist/api/routes/admin/price-lists/list-price-list-products.d.ts:175 diff --git a/docs/content/references/js-client/modules/internal-21.md b/docs/content/references/js-client/modules/internal-21.md index 09f828c4e17d7..a2ab812eae7d1 100644 --- a/docs/content/references/js-client/modules/internal-21.md +++ b/docs/content/references/js-client/modules/internal-21.md @@ -2,9 +2,13 @@ ## Classes +- [AdminDeletePublishableApiKeySalesChannelsBatchReq](../classes/internal-21.AdminDeletePublishableApiKeySalesChannelsBatchReq.md) +- [AdminPostPublishableApiKeySalesChannelsBatchReq](../classes/internal-21.AdminPostPublishableApiKeySalesChannelsBatchReq.md) - [AdminPostPublishableApiKeysPublishableApiKeyReq](../classes/internal-21.AdminPostPublishableApiKeysPublishableApiKeyReq.md) - [AdminPostPublishableApiKeysReq](../classes/internal-21.AdminPostPublishableApiKeysReq.md) +- [GetPublishableApiKeySalesChannelsParams](../classes/internal-21.GetPublishableApiKeySalesChannelsParams.md) - [GetPublishableApiKeysParams](../classes/internal-21.GetPublishableApiKeysParams.md) +- [ProductBatchSalesChannel](../classes/internal-21.ProductBatchSalesChannel.md) - [PublishableApiKey](../classes/internal-21.PublishableApiKey.md) ## Type Aliases @@ -33,6 +37,16 @@ ___ medusa/dist/api/routes/admin/publishable-api-keys/index.d.ts:5 +___ + +### AdminSalesChannelsListRes + +Ƭ **AdminSalesChannelsListRes**: [`PaginatedResponse`](internal-2.md#paginatedresponse) & { `sales_channels`: [`SalesChannel`](../classes/internal.SalesChannel.md)[] } + +#### Defined in + +medusa/dist/api/routes/admin/sales-channels/index.d.ts:10 + ## Variables ### GetPublishableApiKeysParams\_base @@ -41,4 +55,4 @@ medusa/dist/api/routes/admin/publishable-api-keys/index.d.ts:5 #### Defined in -medusa/dist/api/routes/admin/publishable-api-keys/list-publishable-api-keys.d.ts:60 +medusa/dist/api/routes/admin/publishable-api-keys/list-publishable-api-keys.d.ts:61 diff --git a/docs/content/references/js-client/modules/internal-25.md b/docs/content/references/js-client/modules/internal-25.md index a514da34a5f16..27f05f89e726b 100644 --- a/docs/content/references/js-client/modules/internal-25.md +++ b/docs/content/references/js-client/modules/internal-25.md @@ -7,20 +7,9 @@ - [AdminPostSalesChannelsChannelProductsBatchReq](../classes/internal-25.AdminPostSalesChannelsChannelProductsBatchReq.md) - [AdminPostSalesChannelsReq](../classes/internal-25.AdminPostSalesChannelsReq.md) - [AdminPostSalesChannelsSalesChannelReq](../classes/internal-25.AdminPostSalesChannelsSalesChannelReq.md) -- [ProductBatchSalesChannel](../classes/internal-25.ProductBatchSalesChannel.md) ## Type Aliases -### AdminSalesChannelsListRes - -Ƭ **AdminSalesChannelsListRes**: [`PaginatedResponse`](internal-2.md#paginatedresponse) & { `sales_channels`: [`SalesChannel`](../classes/internal.SalesChannel.md)[] } - -#### Defined in - -medusa/dist/api/routes/admin/sales-channels/index.d.ts:10 - -___ - ### AdminSalesChannelsRes Ƭ **AdminSalesChannelsRes**: `Object` @@ -43,4 +32,4 @@ medusa/dist/api/routes/admin/sales-channels/index.d.ts:6 #### Defined in -medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:141 +medusa/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts:142 diff --git a/docs/content/references/js-client/modules/internal-32.md b/docs/content/references/js-client/modules/internal-32.md index 739ce6daeb8ce..8ff5e8fa1bdac 100644 --- a/docs/content/references/js-client/modules/internal-32.md +++ b/docs/content/references/js-client/modules/internal-32.md @@ -15,7 +15,7 @@ #### Defined in -[medusa-js/src/typings.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L31) +[medusa-js/src/typings.ts:31](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L31) ___ @@ -25,7 +25,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L41) +[medusa-js/src/typings.ts:41](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L41) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L28) +[medusa-js/src/typings.ts:28](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L28) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L25) +[medusa-js/src/typings.ts:25](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L25) ___ @@ -93,7 +93,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L23) +[medusa-js/src/typings.ts:23](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L23) ___ @@ -103,7 +103,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L39) +[medusa-js/src/typings.ts:39](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L39) ___ @@ -113,4 +113,4 @@ ___ #### Defined in -[medusa-js/src/typings.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L37) +[medusa-js/src/typings.ts:37](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L37) diff --git a/docs/content/references/js-client/modules/internal-41.md b/docs/content/references/js-client/modules/internal-41.md index 256743637660a..639b9ac1bbf23 100644 --- a/docs/content/references/js-client/modules/internal-41.md +++ b/docs/content/references/js-client/modules/internal-41.md @@ -4,6 +4,8 @@ - [ShippingAddressPayload](../classes/internal-41.ShippingAddressPayload.md) - [StoreGetOrdersParams](../classes/internal-41.StoreGetOrdersParams.md) +- [StorePostCustomersCustomerAcceptClaimReq](../classes/internal-41.StorePostCustomersCustomerAcceptClaimReq.md) +- [StorePostCustomersCustomerOrderClaimReq](../classes/internal-41.StorePostCustomersCustomerOrderClaimReq.md) ## Type Aliases diff --git a/docs/content/references/js-client/modules/internal-42.md b/docs/content/references/js-client/modules/internal-42.md index 22693cfd5f270..dcdac48a4f9b0 100644 --- a/docs/content/references/js-client/modules/internal-42.md +++ b/docs/content/references/js-client/modules/internal-42.md @@ -2,15 +2,16 @@ ## Classes -- [PaymentCollectionSessionInputRequest](../classes/internal-42.PaymentCollectionSessionInputRequest.md) -- [StoreManagePaymentCollectionSessionRequest](../classes/internal-42.StoreManagePaymentCollectionSessionRequest.md) -- [StoreRefreshPaymentCollectionSessionRequest](../classes/internal-42.StoreRefreshPaymentCollectionSessionRequest.md) +- [StorePaymentCollectionSessionsReq](../classes/internal-42.StorePaymentCollectionSessionsReq.md) +- [StorePostPaymentCollectionsBatchSessionsAuthorizeReq](../classes/internal-42.StorePostPaymentCollectionsBatchSessionsAuthorizeReq.md) +- [StorePostPaymentCollectionsBatchSessionsReq](../classes/internal-42.StorePostPaymentCollectionsBatchSessionsReq.md) +- [StorePostPaymentCollectionsSessionsReq](../classes/internal-42.StorePostPaymentCollectionsSessionsReq.md) ## Type Aliases -### StorePaymentCollectionRes +### StorePaymentCollectionsRes -Ƭ **StorePaymentCollectionRes**: `Object` +Ƭ **StorePaymentCollectionsRes**: `Object` #### Type declaration @@ -24,9 +25,9 @@ medusa/dist/api/routes/store/payment-collections/index.d.ts:7 ___ -### StorePaymentCollectionSessionRes +### StorePaymentCollectionsSessionRes -Ƭ **StorePaymentCollectionSessionRes**: `Object` +Ƭ **StorePaymentCollectionsSessionRes**: `Object` #### Type declaration diff --git a/docs/content/references/js-client/modules/internal-46.md b/docs/content/references/js-client/modules/internal-46.md index 915c5ee4099b0..678e368f12f02 100644 --- a/docs/content/references/js-client/modules/internal-46.md +++ b/docs/content/references/js-client/modules/internal-46.md @@ -24,7 +24,7 @@ #### Defined in -medusa/dist/api/routes/store/products/index.d.ts:12 +medusa/dist/api/routes/store/products/index.d.ts:13 ___ @@ -34,7 +34,7 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/index.d.ts:16 +medusa/dist/api/routes/store/products/index.d.ts:17 ___ @@ -50,4 +50,4 @@ ___ #### Defined in -medusa/dist/api/routes/store/products/index.d.ts:9 +medusa/dist/api/routes/store/products/index.d.ts:10 diff --git a/docs/content/references/js-client/modules/internal-7.md b/docs/content/references/js-client/modules/internal-7.md index 7457efa85e2bb..a53e14644e2c8 100644 --- a/docs/content/references/js-client/modules/internal-7.md +++ b/docs/content/references/js-client/modules/internal-7.md @@ -75,4 +75,4 @@ medusa/dist/api/routes/admin/discounts/index.d.ts:11 #### Defined in -medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:86 +medusa/dist/api/routes/admin/discounts/list-discounts.d.ts:87 diff --git a/docs/content/references/js-client/modules/internal.md b/docs/content/references/js-client/modules/internal.md index b415ebea6a540..b7edd8f389fdf 100644 --- a/docs/content/references/js-client/modules/internal.md +++ b/docs/content/references/js-client/modules/internal.md @@ -169,7 +169,7 @@ ___ #### Defined in -[medusa-js/src/request.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/request.ts#L26) +[medusa-js/src/request.ts:26](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/request.ts#L26) ___ @@ -185,7 +185,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:17](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L17) +[medusa-js/src/typings.ts:17](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L17) ___ @@ -201,7 +201,7 @@ ___ #### Defined in -[medusa-js/src/typings.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa-js/src/typings.ts#L21) +[medusa-js/src/typings.ts:21](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/typings.ts#L21) ___ From a77b4a1b7e460146ae59706ae8943194839c7d31 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 12:47:21 +0200 Subject: [PATCH 07/18] docs: changed the steps to run tests in local dev (#2786) --- docs/content/usage/local-development.md | 42 +++---------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/docs/content/usage/local-development.md b/docs/content/usage/local-development.md index 071558e75b3a8..aade667607b83 100644 --- a/docs/content/usage/local-development.md +++ b/docs/content/usage/local-development.md @@ -76,54 +76,22 @@ yarn test ### Run API Integration Tests -API integration tests are used to test out Medusa’s core endpoints. To run the API integration tests: +API integration tests are used to test out Medusa’s core endpoints. -1. Change to the `integrations-tests/api` directory: +To run the API integration tests, run the following command in the root directory of the repository: ```bash -cd integration-tests/api +yarn test:integration:api ``` -2\. Install dependencies using Medusa’s dev CLI tool: - -```bash -medusa-dev --force-install --external-registry -``` - -3\. Run the test command: - -```bash -yarn test -``` - -:::info - -The `--force-install` option passed to `medusa-dev` ensures that the packages are installing from the local registry rather than copied as explained in [the next section](#test-in-a-local-server). - -::: - ### Run Plugin Integration Tests Plugin integration tests are used to test out Medusa’s official plugins, which are also stored in the `packages` directory in the repository. -To run the plugin integration tests: - -1. Change to the `integrations-tests/plugins` directory: - -```bash -cd integration-tests/plugins -``` - -2\. Install dependencies using Medusa’s dev CLI tool: - -```bash -medusa-dev --force-install --external-registry -``` - -3\. Run the test command: +To run the plugin integration tests, run the following command in the root directory of the repository: ```bash -yarn test +yarn test:integration:plugins ``` ## Test in a Local Server From 52a8e90aac95f7dedc1db6f51d148dd44420dccf Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 12:52:58 +0200 Subject: [PATCH 08/18] chore(docs): Generated API reference (#2788) --- docs/api/admin-spec3.json | 16973 +++++++++------- docs/api/admin-spec3.yaml | 6865 ++++--- .../JavaScript/discounts/postundefined | 1 + .../payment-collections_{id}/deleteundefined | 7 + .../payment-collections_{id}/getundefined | 7 + .../payment-collections_{id}/postundefined | 9 + .../postundefined | 7 + .../JavaScript/payments_{id}/getundefined | 7 + .../payments_{id}_capture/postundefined | 7 + .../payments_{id}_refund/postundefined | 11 + .../publishable-api-key_{id}/postundefined | 9 + .../publishable-api-keys/getundefined | 7 + .../publishable-api-keys/postundefined | 7 + .../getundefined | 7 + .../publishable-api-keys_{id}/deleteundefined | 7 + .../publishable-api-keys_{id}/getundefined | 7 + .../postundefined | 7 + .../deleteundefined | 13 + .../postundefined | 13 + .../Shell/discounts/postundefined | 3 +- .../payment-collections_{id}/deleteundefined | 2 + .../payment-collections_{id}/getundefined | 2 + .../payment-collections_{id}/postundefined | 6 + .../postundefined | 2 + .../Shell/payments_{id}/getundefined | 2 + .../Shell/payments_{id}_capture/postundefined | 2 + .../Shell/payments_{id}_refund/postundefined | 8 + .../publishable-api-key_{id}/postundefined | 6 + .../Shell/publishable-api-keys/getundefined | 2 + .../Shell/publishable-api-keys/postundefined | 3 + .../getundefined | 2 + .../publishable-api-keys_{id}/deleteundefined | 2 + .../publishable-api-keys_{id}/getundefined | 3 + .../postundefined | 3 + .../deleteundefined | 10 + .../postundefined | 10 + docs/api/admin/components/schemas/OAuth.yaml | 1 + .../api/admin/components/schemas/address.yaml | 1 + .../components/schemas/address_fields.yaml | 1 + .../admin/components/schemas/batch_job.yaml | 1 + docs/api/admin/components/schemas/cart.yaml | 1 + .../admin/components/schemas/claim_image.yaml | 1 + .../admin/components/schemas/claim_item.yaml | 1 + .../admin/components/schemas/claim_order.yaml | 1 + .../admin/components/schemas/claim_tag.yaml | 1 + .../api/admin/components/schemas/country.yaml | 1 + .../admin/components/schemas/currency.yaml | 1 + .../schemas/custom_shipping_option.yaml | 1 + .../admin/components/schemas/customer.yaml | 3 +- .../components/schemas/customer_group.yaml | 1 + .../admin/components/schemas/discount.yaml | 1 + .../schemas/discount_condition.yaml | 1 + .../discount_condition_customer_group.yaml | 1 + .../schemas/discount_condition_product.yaml | 1 + ...discount_condition_product_collection.yaml | 1 + .../discount_condition_product_tag.yaml | 1 + .../discount_condition_product_type.yaml | 1 + .../components/schemas/discount_rule.yaml | 1 + .../admin/components/schemas/draft-order.yaml | 1 + docs/api/admin/components/schemas/error.yaml | 1 + .../admin/components/schemas/fulfillment.yaml | 1 + .../components/schemas/fulfillment_item.yaml | 1 + .../schemas/fulfillment_provider.yaml | 1 + .../admin/components/schemas/gift_card.yaml | 1 + .../schemas/gift_card_transaction.yaml | 1 + .../components/schemas/idempotency_key.yaml | 1 + docs/api/admin/components/schemas/image.yaml | 1 + docs/api/admin/components/schemas/invite.yaml | 1 + .../admin/components/schemas/line_item.yaml | 1 + .../schemas/line_item_adjustment.yaml | 1 + .../schemas/line_item_tax_line.yaml | 1 + .../components/schemas/money_amount.yaml | 1 + .../components/schemas/multiple_errors.yaml | 1 + docs/api/admin/components/schemas/note.yaml | 1 + .../components/schemas/notification.yaml | 1 + .../schemas/notification_provider.yaml | 1 + .../schemas/notification_resend.yaml | 1 + docs/api/admin/components/schemas/order.yaml | 1 + .../admin/components/schemas/order_edit.yaml | 1 + .../components/schemas/order_item_change.yaml | 1 + .../api/admin/components/schemas/payment.yaml | 1 + .../schemas/payment_collection.yaml | 12 +- .../components/schemas/payment_provider.yaml | 1 + .../components/schemas/payment_session.yaml | 1 + .../admin/components/schemas/price_list.yaml | 1 + .../api/admin/components/schemas/product.yaml | 1 + .../schemas/product_collection.yaml | 1 + .../components/schemas/product_option.yaml | 1 + .../schemas/product_option_value.yaml | 1 + .../admin/components/schemas/product_tag.yaml | 1 + .../components/schemas/product_tax_rate.yaml | 1 + .../components/schemas/product_type.yaml | 1 + .../schemas/product_type_tax_rate.yaml | 1 + .../components/schemas/product_variant.yaml | 1 + .../product_variant_prices_fields.yaml | 1 + .../schemas/publishable_api_key.yaml | 37 + .../publishable_api_key_sales_channel.yaml | 13 + docs/api/admin/components/schemas/refund.yaml | 1 + docs/api/admin/components/schemas/region.yaml | 1 + docs/api/admin/components/schemas/return.yaml | 1 + .../admin/components/schemas/return_item.yaml | 1 + .../components/schemas/return_reason.yaml | 1 + .../components/schemas/sales_channel.yaml | 1 + .../components/schemas/shipping_method.yaml | 1 + .../schemas/shipping_method_tax_line.yaml | 1 + .../components/schemas/shipping_option.yaml | 1 + .../schemas/shipping_option_requirement.yaml | 1 + .../components/schemas/shipping_profile.yaml | 1 + .../components/schemas/shipping_tax_rate.yaml | 1 + .../admin/components/schemas/staged_job.yaml | 1 + docs/api/admin/components/schemas/store.yaml | 1 + docs/api/admin/components/schemas/swap.yaml | 1 + .../admin/components/schemas/tax_line.yaml | 1 + .../components/schemas/tax_provider.yaml | 1 + .../admin/components/schemas/tax_rate.yaml | 1 + .../components/schemas/tracking_link.yaml | 1 + docs/api/admin/components/schemas/user.yaml | 1 + docs/api/admin/openapi.yaml | 50 +- .../admin/paths/admin_draft-orders_{id}.yaml | 2 + docs/api/admin/paths/apps.yaml | 1 + docs/api/admin/paths/apps_authorizations.yaml | 2 + docs/api/admin/paths/auth.yaml | 2 + docs/api/admin/paths/batch-jobs.yaml | 3 + docs/api/admin/paths/batch-jobs_{id}.yaml | 1 + .../admin/paths/batch-jobs_{id}_cancel.yaml | 1 + .../admin/paths/batch-jobs_{id}_confirm.yaml | 1 + docs/api/admin/paths/collections.yaml | 3 + docs/api/admin/paths/collections_{id}.yaml | 4 + .../collections_{id}_products_batch.yaml | 4 + docs/api/admin/paths/currencies.yaml | 1 + docs/api/admin/paths/currencies_{code}.yaml | 2 + docs/api/admin/paths/customer-groups.yaml | 2 + .../api/admin/paths/customer-groups_{id}.yaml | 4 + .../paths/customer-groups_{id}_customers.yaml | 1 + .../customer-groups_{id}_customers_batch.yaml | 4 + docs/api/admin/paths/customers.yaml | 3 + docs/api/admin/paths/customers_{id}.yaml | 3 + docs/api/admin/paths/discounts.yaml | 4 + .../admin/paths/discounts_code_{code}.yaml | 1 + .../discounts_{discount_id}_conditions.yaml | 2 + ...iscount_id}_conditions_{condition_id}.yaml | 4 + ...t_id}_conditions_{condition_id}_batch.yaml | 4 + docs/api/admin/paths/discounts_{id}.yaml | 4 + .../paths/discounts_{id}_dynamic-codes.yaml | 1 + .../discounts_{id}_dynamic-codes_{code}.yaml | 1 + .../discounts_{id}_regions_{region_id}.yaml | 2 + docs/api/admin/paths/draft-orders.yaml | 3 + docs/api/admin/paths/draft-orders_{id}.yaml | 2 + .../paths/draft-orders_{id}_line-items.yaml | 2 + ...raft-orders_{id}_line-items_{line_id}.yaml | 3 + .../admin/paths/draft-orders_{id}_pay.yaml | 1 + docs/api/admin/paths/gift-cards.yaml | 3 + docs/api/admin/paths/gift-cards_{id}.yaml | 4 + docs/api/admin/paths/invites.yaml | 2 + docs/api/admin/paths/invites_accept.yaml | 1 + docs/api/admin/paths/invites_{invite_id}.yaml | 1 + docs/api/admin/paths/notes.yaml | 3 + docs/api/admin/paths/notes_{id}.yaml | 4 + docs/api/admin/paths/notifications.yaml | 1 + .../paths/notifications_{id}_resend.yaml | 2 + docs/api/admin/paths/order-edits.yaml | 7 +- docs/api/admin/paths/order-edits_{id}.yaml | 4 + .../admin/paths/order-edits_{id}_cancel.yaml | 1 + .../order-edits_{id}_changes_{change_id}.yaml | 1 + .../admin/paths/order-edits_{id}_confirm.yaml | 1 + .../admin/paths/order-edits_{id}_items.yaml | 2 + .../order-edits_{id}_items_{item_id}.yaml | 3 + .../admin/paths/order-edits_{id}_request.yaml | 1 + docs/api/admin/paths/order_{id}_claims.yaml | 2 + .../paths/order_{id}_claims_{claim_id}.yaml | 2 + docs/api/admin/paths/order_{id}_swaps.yaml | 2 + docs/api/admin/paths/orders.yaml | 1 + docs/api/admin/paths/orders_{id}.yaml | 3 + docs/api/admin/paths/orders_{id}_archive.yaml | 1 + docs/api/admin/paths/orders_{id}_cancel.yaml | 1 + docs/api/admin/paths/orders_{id}_capture.yaml | 1 + .../orders_{id}_claims_{claim_id}_cancel.yaml | 1 + ...s_{id}_claims_{claim_id}_fulfillments.yaml | 2 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 1 + ...ders_{id}_claims_{claim_id}_shipments.yaml | 2 + .../api/admin/paths/orders_{id}_complete.yaml | 1 + .../admin/paths/orders_{id}_fulfillment.yaml | 2 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 1 + docs/api/admin/paths/orders_{id}_refund.yaml | 2 + docs/api/admin/paths/orders_{id}_return.yaml | 2 + .../api/admin/paths/orders_{id}_shipment.yaml | 2 + .../paths/orders_{id}_shipping-methods.yaml | 1 + .../orders_{id}_swaps_{swap_id}_cancel.yaml | 1 + ...ers_{id}_swaps_{swap_id}_fulfillments.yaml | 2 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 1 + ..._{id}_swaps_{swap_id}_process-payment.yaml | 1 + ...orders_{id}_swaps_{swap_id}_shipments.yaml | 2 + .../admin/paths/payment-collections_{id}.yaml | 171 + .../payment-collections_{id}_authorize.yaml | 49 + docs/api/admin/paths/payments_{id}.yaml | 48 + .../admin/paths/payments_{id}_capture.yaml | 48 + .../api/admin/paths/payments_{id}_refund.yaml | 66 + docs/api/admin/paths/price-lists.yaml | 3 + docs/api/admin/paths/price-lists_{id}.yaml | 4 + .../paths/price-lists_{id}_prices_batch.yaml | 4 + .../paths/price-lists_{id}_products.yaml | 1 + ...sts_{id}_products_{product_id}_prices.yaml | 1 + ...sts_{id}_variants_{variant_id}_prices.yaml | 1 + docs/api/admin/paths/product-tags.yaml | 1 + docs/api/admin/paths/product-types.yaml | 1 + docs/api/admin/paths/products.yaml | 3 + docs/api/admin/paths/products_tag-usage.yaml | 1 + docs/api/admin/paths/products_types.yaml | 1 + docs/api/admin/paths/products_{id}.yaml | 4 + .../admin/paths/products_{id}_metadata.yaml | 2 + .../admin/paths/products_{id}_options.yaml | 2 + .../products_{id}_options_{option_id}.yaml | 3 + .../admin/paths/products_{id}_variants.yaml | 3 + .../products_{id}_variants_{variant_id}.yaml | 3 + .../admin/paths/publishable-api-key_{id}.yaml | 57 + .../api/admin/paths/publishable-api-keys.yaml | 122 + ...blishable-api-keys_:id_sales-channels.yaml | 44 + .../paths/publishable-api-keys_{id}.yaml | 95 + .../publishable-api-keys_{id}_revoke.yaml | 49 + ...le-api-keys_{id}_sales-channels_batch.yaml | 136 + docs/api/admin/paths/regions.yaml | 3 + docs/api/admin/paths/regions_{id}.yaml | 4 + .../admin/paths/regions_{id}_countries.yaml | 2 + ...regions_{id}_countries_{country_code}.yaml | 1 + .../regions_{id}_fulfillment-options.yaml | 1 + .../regions_{id}_fulfillment-providers.yaml | 2 + ...}_fulfillment-providers_{provider_id}.yaml | 1 + .../paths/regions_{id}_payment-providers.yaml | 2 + ..._{id}_payment-providers_{provider_id}.yaml | 1 + docs/api/admin/paths/return-reasons.yaml | 3 + docs/api/admin/paths/return-reasons_{id}.yaml | 4 + docs/api/admin/paths/returns.yaml | 1 + docs/api/admin/paths/returns_{id}_cancel.yaml | 1 + .../api/admin/paths/returns_{id}_receive.yaml | 2 + docs/api/admin/paths/sales-channels.yaml | 3 + docs/api/admin/paths/sales-channels_{id}.yaml | 4 + .../sales-channels_{id}_products_batch.yaml | 4 + docs/api/admin/paths/shipping-options.yaml | 3 + .../admin/paths/shipping-options_{id}.yaml | 4 + docs/api/admin/paths/shipping-profiles.yaml | 3 + .../admin/paths/shipping-profiles_{id}.yaml | 4 + docs/api/admin/paths/store.yaml | 3 + .../admin/paths/store_currencies_{code}.yaml | 2 + .../admin/paths/store_payment-providers.yaml | 1 + docs/api/admin/paths/store_tax-providers.yaml | 1 + docs/api/admin/paths/swaps.yaml | 1 + docs/api/admin/paths/swaps_{id}.yaml | 1 + docs/api/admin/paths/tax-rates.yaml | 3 + docs/api/admin/paths/tax-rates_{id}.yaml | 4 + .../tax-rates_{id}_product-types_batch.yaml | 4 + .../paths/tax-rates_{id}_products_batch.yaml | 4 + ...tax-rates_{id}_shipping-options_batch.yaml | 4 + docs/api/admin/paths/uploads.yaml | 1 + docs/api/admin/paths/uploads_protected.yaml | 1 + docs/api/admin/paths/users.yaml | 3 + .../api/admin/paths/users_password-token.yaml | 1 + .../api/admin/paths/users_reset-password.yaml | 2 + docs/api/admin/paths/users_{id}.yaml | 4 + docs/api/admin/paths/variants.yaml | 1 + docs/api/store-spec3.json | 1490 +- docs/api/store-spec3.yaml | 1690 +- .../orders_batch_customer_token/postundefined | 12 + .../orders_customer_confirm/postundefined | 12 + .../payment-collections_{id}/getundefined | 7 + .../postundefined | 9 + .../postundefined | 29 + .../postundefined | 7 + .../postundefined | 6 + .../postundefined | 7 + .../orders_batch_customer_token/postundefined | 5 + .../orders_customer_confirm/postundefined | 5 + .../payment-collections_{id}/getundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + docs/api/store/components/schemas/OAuth.yaml | 1 + .../api/store/components/schemas/address.yaml | 1 + .../components/schemas/address_fields.yaml | 1 + .../store/components/schemas/batch_job.yaml | 1 + docs/api/store/components/schemas/cart.yaml | 1 + .../store/components/schemas/claim_image.yaml | 1 + .../store/components/schemas/claim_item.yaml | 1 + .../store/components/schemas/claim_order.yaml | 1 + .../store/components/schemas/claim_tag.yaml | 1 + .../api/store/components/schemas/country.yaml | 1 + .../store/components/schemas/currency.yaml | 1 + .../schemas/custom_shipping_option.yaml | 1 + .../store/components/schemas/customer.yaml | 3 +- .../components/schemas/customer_group.yaml | 1 + .../store/components/schemas/discount.yaml | 1 + .../schemas/discount_condition.yaml | 1 + .../discount_condition_customer_group.yaml | 1 + .../schemas/discount_condition_product.yaml | 1 + ...discount_condition_product_collection.yaml | 1 + .../discount_condition_product_tag.yaml | 1 + .../discount_condition_product_type.yaml | 1 + .../components/schemas/discount_rule.yaml | 1 + .../store/components/schemas/draft-order.yaml | 1 + docs/api/store/components/schemas/error.yaml | 1 + .../store/components/schemas/fulfillment.yaml | 1 + .../components/schemas/fulfillment_item.yaml | 1 + .../schemas/fulfillment_provider.yaml | 1 + .../store/components/schemas/gift_card.yaml | 1 + .../schemas/gift_card_transaction.yaml | 1 + .../components/schemas/idempotency_key.yaml | 1 + docs/api/store/components/schemas/image.yaml | 1 + docs/api/store/components/schemas/invite.yaml | 1 + .../store/components/schemas/line_item.yaml | 1 + .../schemas/line_item_adjustment.yaml | 1 + .../schemas/line_item_tax_line.yaml | 1 + .../components/schemas/money_amount.yaml | 1 + .../components/schemas/multiple_errors.yaml | 1 + docs/api/store/components/schemas/note.yaml | 1 + .../components/schemas/notification.yaml | 1 + .../schemas/notification_provider.yaml | 1 + .../schemas/notification_resend.yaml | 1 + docs/api/store/components/schemas/order.yaml | 1 + .../store/components/schemas/order_edit.yaml | 1 + .../components/schemas/order_item_change.yaml | 1 + .../api/store/components/schemas/payment.yaml | 1 + .../schemas/payment_collection.yaml | 12 +- .../components/schemas/payment_provider.yaml | 1 + .../components/schemas/payment_session.yaml | 1 + .../store/components/schemas/price_list.yaml | 1 + .../api/store/components/schemas/product.yaml | 1 + .../schemas/product_collection.yaml | 1 + .../components/schemas/product_option.yaml | 1 + .../schemas/product_option_value.yaml | 1 + .../store/components/schemas/product_tag.yaml | 1 + .../components/schemas/product_tax_rate.yaml | 1 + .../components/schemas/product_type.yaml | 1 + .../schemas/product_type_tax_rate.yaml | 1 + .../components/schemas/product_variant.yaml | 1 + .../product_variant_prices_fields.yaml | 1 + .../schemas/publishable_api_key.yaml | 37 + .../publishable_api_key_sales_channel.yaml | 13 + docs/api/store/components/schemas/refund.yaml | 1 + docs/api/store/components/schemas/region.yaml | 1 + docs/api/store/components/schemas/return.yaml | 1 + .../store/components/schemas/return_item.yaml | 1 + .../components/schemas/return_reason.yaml | 1 + .../components/schemas/sales_channel.yaml | 1 + .../components/schemas/shipping_method.yaml | 1 + .../schemas/shipping_method_tax_line.yaml | 1 + .../components/schemas/shipping_option.yaml | 1 + .../schemas/shipping_option_requirement.yaml | 1 + .../components/schemas/shipping_profile.yaml | 1 + .../components/schemas/shipping_tax_rate.yaml | 1 + .../store/components/schemas/staged_job.yaml | 1 + docs/api/store/components/schemas/store.yaml | 1 + docs/api/store/components/schemas/swap.yaml | 1 + .../store/components/schemas/tax_line.yaml | 1 + .../components/schemas/tax_provider.yaml | 1 + .../store/components/schemas/tax_rate.yaml | 1 + .../components/schemas/tracking_link.yaml | 1 + docs/api/store/components/schemas/user.yaml | 1 + docs/api/store/openapi.yaml | 32 +- docs/api/store/paths/auth.yaml | 2 + docs/api/store/paths/auth_{email}.yaml | 1 + docs/api/store/paths/carts.yaml | 2 + docs/api/store/paths/carts_{id}.yaml | 3 + docs/api/store/paths/carts_{id}_complete.yaml | 1 + .../paths/carts_{id}_discounts_{code}.yaml | 1 + .../store/paths/carts_{id}_line-items.yaml | 1 + .../carts_{id}_line-items_{line_id}.yaml | 2 + .../paths/carts_{id}_payment-session.yaml | 1 + .../paths/carts_{id}_payment-sessions.yaml | 1 + ...s_{id}_payment-sessions_{provider_id}.yaml | 2 + ...ayment-sessions_{provider_id}_refresh.yaml | 1 + .../paths/carts_{id}_shipping-methods.yaml | 1 + docs/api/store/paths/carts_{id}_taxes.yaml | 1 + docs/api/store/paths/collections.yaml | 1 + docs/api/store/paths/collections_{id}.yaml | 1 + docs/api/store/paths/customers.yaml | 3 + docs/api/store/paths/customers_me.yaml | 3 + .../store/paths/customers_me_addresses.yaml | 2 + .../customers_me_addresses_{address_id}.yaml | 2 + docs/api/store/paths/customers_me_orders.yaml | 1 + .../paths/customers_me_payment-methods.yaml | 1 + .../store/paths/customers_password-reset.yaml | 2 + .../store/paths/customers_password-token.yaml | 1 + docs/api/store/paths/gift-cards_{code}.yaml | 1 + docs/api/store/paths/order-edits_{id}.yaml | 1 + .../paths/order-edits_{id}_complete.yaml | 1 + .../store/paths/order-edits_{id}_decline.yaml | 2 + docs/api/store/paths/orders.yaml | 1 + .../paths/orders_batch_customer_token.yaml | 47 + .../store/paths/orders_cart_{cart_id}.yaml | 1 + .../store/paths/orders_customer_confirm.yaml | 45 + docs/api/store/paths/orders_{id}.yaml | 1 + .../store/paths/payment-collections_{id}.yaml | 58 + .../payment-collections_{id}_sessions.yaml | 58 + ...yment-collections_{id}_sessions_batch.yaml | 74 + ...ections_{id}_sessions_batch_authorize.yaml | 59 + ...ollections_{id}_sessions_{session_id}.yaml | 68 + ..._{id}_sessions_{session_id}_authorize.yaml | 55 + docs/api/store/paths/product-types.yaml | 1 + docs/api/store/paths/products.yaml | 1 + docs/api/store/paths/products_search.yaml | 1 + docs/api/store/paths/products_{id}.yaml | 1 + docs/api/store/paths/regions.yaml | 1 + docs/api/store/paths/regions_{id}.yaml | 1 + docs/api/store/paths/return-reasons.yaml | 1 + docs/api/store/paths/return-reasons_{id}.yaml | 1 + docs/api/store/paths/returns.yaml | 2 + docs/api/store/paths/shipping-options.yaml | 1 + .../paths/shipping-options_{cart_id}.yaml | 1 + docs/api/store/paths/swaps.yaml | 2 + docs/api/store/paths/swaps_{cart_id}.yaml | 1 + docs/api/store/paths/variants.yaml | 1 + .../store/paths/variants_{variant_id}.yaml | 1 + 413 files changed, 18214 insertions(+), 11175 deletions(-) create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payments_{id}/getundefined create mode 100644 docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined create mode 100644 docs/api/admin/components/schemas/publishable_api_key.yaml create mode 100644 docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml create mode 100644 docs/api/admin/paths/payment-collections_{id}.yaml create mode 100644 docs/api/admin/paths/payment-collections_{id}_authorize.yaml create mode 100644 docs/api/admin/paths/payments_{id}.yaml create mode 100644 docs/api/admin/paths/payments_{id}_capture.yaml create mode 100644 docs/api/admin/paths/payments_{id}_refund.yaml create mode 100644 docs/api/admin/paths/publishable-api-key_{id}.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_{id}.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml create mode 100644 docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined create mode 100644 docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined create mode 100644 docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined create mode 100644 docs/api/store/components/schemas/publishable_api_key.yaml create mode 100644 docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml create mode 100644 docs/api/store/paths/orders_batch_customer_token.yaml create mode 100644 docs/api/store/paths/orders_customer_confirm.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 776f7aef994dd..cd29c8bbce48f 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -212,6 +212,7 @@ paths: content: application/json: schema: + type: object required: - application_name - state @@ -253,6 +254,7 @@ paths: content: application/json: schema: + type: object properties: apps: $ref: '#/components/schemas/OAuth' @@ -291,6 +293,7 @@ paths: content: application/json: schema: + type: object properties: apps: type: array @@ -362,6 +365,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -458,6 +462,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -473,56 +478,64 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}/cancel': + '/collections/{id}/products/batch': post: - operationId: PostBatchJobsBatchJobCancel - summary: Cancel a Batch Job - description: Marks a batch job as canceled + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the batch job. + description: The ID of the Collection. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.cancel(batch_job_id) - - .then(({ batch_job }) => { - console.log(batch_job.id); - }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - batch_job: - $ref: '#/components/schemas/batch_job' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -535,56 +548,76 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}/confirm': - post: - operationId: PostBatchJobsBatchJobConfirmProcessing - summary: Confirm a Batch Job - description: Confirms that a previously requested batch job should be executed. + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the batch job. + description: The ID of the Collection. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: >- + An array of Product IDs to remove from the Product + Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.confirm(batch_job_id) - - .then(({ batch_job }) => { - console.log(batch_job.id); - }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - batch_job: - $ref: '#/components/schemas/batch_job' + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string '400': $ref: '#/components/responses/400_error' '401': @@ -597,51 +630,33 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /batch-jobs: + /collections: post: - operationId: PostBatchJobs - summary: Create a Batch Job - description: Creates a Batch Job. + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. x-authenticated: true requestBody: content: application/json: schema: + type: object required: - - type - - context + - title properties: - type: + title: + type: string + description: The title to identify the Collection by. + handle: type: string - description: The type of batch job to start. - example: product-export - context: - type: object description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: description: >- - Set a batch job in dry_run mode to get some information on - what will be done without applying any modifications. - default: false + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -653,41 +668,41 @@ paths: // must be previously logged in or use api token - medusa.admin.batchJobs.create({ - type: 'product-export', - context: {}, - dry_run: false - }).then((({ batch_job }) => { - console.log(batch_job.id); + medusa.admin.collections.create({ + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ - "type": "product-export", - "context": { } + "title": "New Collection" }' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Collection responses: - '201': + '200': description: OK content: application/json: schema: + type: object properties: - batch_job: - $ref: '#/components/schemas/batch_job' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -701,156 +716,48 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetBatchJobs - summary: List Batch Jobs - description: Retrieve a list of Batch Jobs. + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. x-authenticated: true parameters: - in: query name: limit - description: The number of batch jobs to return. + description: The number of collections to return. schema: type: integer default: 10 - in: query name: offset - description: The number of batch jobs to skip before results. + description: The number of collections to skip before the results. schema: type: integer default: 0 - in: query - name: id - style: form - explode: false - description: Filter by the batch ID + name: title + description: The title of collections to return. schema: - oneOf: - - type: string - description: batch job ID - - type: array - description: multiple batch job IDs - items: - type: string + type: string - in: query - name: type - style: form - explode: false - description: Filter by the batch type + name: handle + description: The handle of collections to return. schema: - type: array - items: - type: string + type: string - in: query - name: confirmed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was confirmed, i.e. - less than, greater than etc. + name: q + description: a search term to search titles and handles. 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: pre_processed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was pre processed, - i.e. less than, greater than etc. - 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: completed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was completed, i.e. - less than, greater than etc. - 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 + type: string - in: query - name: failed_at - style: form - explode: false + name: discount_condition_id description: >- - Date comparison for when resulting collections was failed, i.e. less - than, greater than etc. + The discount condition id on which to filter the product + collections. 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 + type: string - in: query - name: canceled_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was canceled, i.e. - less than, greater than etc. + name: created_at + description: Date comparison for when resulting collections were created. schema: type: object properties: @@ -871,31 +778,8 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: order - description: Field used to order retrieved batch jobs - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each order of - the result. - schema: - type: string - - in: query - name: created_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was created, i.e. - less than, greater than etc. + name: updated_at + description: Date comparison for when resulting collections were updated. schema: type: object properties: @@ -916,12 +800,8 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: updated_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was updated, i.e. - less than, greater than etc. + name: deleted_at + description: Date comparison for when resulting collections were deleted. schema: type: object properties: @@ -952,34 +832,35 @@ paths: // must be previously logged in or use api token - medusa.admin.batchJobs.list() + medusa.admin.collections.list() - .then(({ batch_jobs, limit, offset, count }) => { - console.log(batch_jobs.length); + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/batch-jobs' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - batch_jobs: + collections: type: array items: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/product_collection' count: type: integer description: The total number of items available @@ -1001,17 +882,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}': - get: - operationId: GetBatchJobsBatchJob - summary: Get a Batch Job - description: Retrieves a Batch Job. + '/collections/{id}': + delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Batch Job + description: The ID of the Collection. schema: type: string x-codeSamples: @@ -1025,32 +906,42 @@ paths: // must be previously logged in or use api token - medusa.admin.batchJobs.retrieve(batch_job_id) + medusa.admin.collections.delete(collection_id) - .then(({ batch_job }) => { - console.log(batch_job.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/batch-jobs/{id}' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - batch_job: - $ref: '#/components/schemas/batch_job' + id: + type: string + description: The ID of the deleted Collection + object: + type: string + description: The type of the object that was deleted. + default: product-collection + deleted: + type: boolean + description: Whether the collection was deleted successfully or not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -1063,48 +954,41 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': - post: - operationId: PostProductsToCollection - summary: Update Products - description: Updates products associated with a Product Collection + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the Product Collection schema: type: string - requestBody: - content: - application/json: - schema: - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string x-codeSamples: - - lang: Shell - label: cURL + - lang: JavaScript + label: JS Client source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + import Medusa from "@medusajs/medusa-js" - --header 'Authorization: Bearer {api_token}' \ + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) - --header 'Content-Type: application/json' \ + // must be previously logged in or use api token - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' + medusa.admin.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -1116,6 +1000,7 @@ paths: content: application/json: schema: + type: object properties: collection: $ref: '#/components/schemas/product_collection' @@ -1131,10 +1016,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteProductsFromCollection - summary: Remove Product - description: Removes products associated with a Product Collection + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. x-authenticated: true parameters: - in: path @@ -1147,82 +1032,7 @@ paths: content: application/json: schema: - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /collections: - post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - title + type: object properties: title: type: string @@ -1248,7 +1058,7 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.create({ + medusa.admin.collections.update(collection_id, { title: 'New Collection' }) @@ -1259,7 +1069,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ @@ -1279,6 +1089,7 @@ paths: content: application/json: schema: + type: object properties: collection: $ref: '#/components/schemas/product_collection' @@ -1294,112 +1105,40 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /currencies: get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency x-authenticated: true parameters: - in: query - name: limit - description: The number of collections to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of collections to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: title - description: The title of collections to return. - schema: - type: string - - in: query - name: handle - description: The handle of collections to return. + name: code + description: Code of the currency to search for. schema: type: string - in: query - name: q - description: a search term to search titles and handles. + name: includes_tax + description: Search for tax inclusive currencies. schema: - type: string + type: boolean - in: query - name: discount_condition_id - description: >- - The discount condition id on which to filter the product - collections. + name: order + description: order to retrieve products in. schema: type: string - in: query - name: created_at - description: Date comparison for when resulting collections were created. - 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: Date comparison for when resulting collections were updated. + name: offset + description: How many products to skip in the result. 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 + type: number + default: '0' - in: query - name: deleted_at - description: Date comparison for when resulting collections were deleted. + name: limit + description: Limit the number of products returned. 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 + type: number + default: '20' x-codeSamples: - lang: JavaScript label: JS Client @@ -1411,34 +1150,32 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.list() + medusa.admin.currencies.list() - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections' \ + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] tags: - - Collection + - Currency responses: '200': description: OK content: application/json: schema: + type: object properties: - collections: + currencies: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/currency' count: type: integer description: The total number of items available @@ -1448,31 +1185,28 @@ paths: limit: type: integer description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/collections/{id}': - delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency x-authenticated: true parameters: - in: path - name: id + name: code required: true - description: The ID of the Collection. + description: The code of the Currency. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' x-codeSamples: - lang: JavaScript label: JS Client @@ -1484,65 +1218,69 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.delete(collection_id) + medusa.admin.currencies.update(code, { + includes_tax: true + }) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ currency }) => { + console.log(currency.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Collection - object: - type: string - description: The type of the object that was deleted. - default: product-collection - deleted: - type: boolean - description: Whether the collection was deleted successfully or not. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + currency: + $ref: '#/components/schemas/currency' + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: 'Adds a list of customers, represented by id''s, to a customer group.' x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product Collection + description: The ID of the customer group. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1554,32 +1292,50 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.retrieve(collection_id) + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1592,36 +1348,36 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostCollectionsCollection - summary: Update a Collection - description: Updates a Product Collection. + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: 'Removes a list of customers, represented by id''s, from a customer group.' x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the customer group. schema: type: string requestBody: content: application/json: schema: + type: object + required: + - customer_ids properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1633,40 +1389,50 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.update(collection_id, { - title: 'New Collection' + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] }) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "New Collection" + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1679,40 +1445,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /currencies: - get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. x-authenticated: true - parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' + parameters: [] x-codeSamples: - lang: JavaScript label: JS Client @@ -1724,61 +1463,189 @@ paths: // must be previously logged in or use api token - medusa.admin.currencies.list() + medusa.admin.customerGroups.create({ + name: 'VIP' + }) - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ + 'https://medusa-url.com/admin/customer-groups' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] tags: - - Currency + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - currencies: - type: array - items: - $ref: '#/components/schemas/currency' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The code of the Currency. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' + customer_group: + $ref: '#/components/schemas/customer_group' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. + get: + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching customer group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: order + description: the field used to order the customer groups. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by the customer group ID + schema: + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID + - in: query + name: name + style: form + explode: false + description: Filter by the customer group name + schema: + type: array + description: multiple customer group names + items: + type: string + description: customer group name + - in: query + name: created_at + description: Date comparison for when resulting customer groups were created. + 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: Date comparison for when resulting customer groups were updated. + 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 customer groups returned. + schema: + type: integer + default: 10 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1790,67 +1657,69 @@ paths: // must be previously logged in or use api token - medusa.admin.currencies.update(code, { - includes_tax: true - }) + medusa.admin.customerGroups.list() - .then(({ currency }) => { - console.log(currency.id); + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups' \ - --data-raw '{ - "includes_tax": true - }' + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] tags: - - Currency + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - currency: - $ref: '#/components/schemas/currency' - '/customer-groups/{id}/customers/batch': - post: - operationId: PostCustomerGroupsGroupCustomersBatch - summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' + customer_groups: + type: array + items: + $ref: '#/components/schemas/customer_group' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customer-groups/{id}': + delete: + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Customer Group schema: type: string - requestBody: - content: - application/json: - schema: - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1862,35 +1731,18 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.addCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) + medusa.admin.customerGroups.delete(customer_group_id) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}' \ - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -1902,9 +1754,21 @@ paths: content: application/json: schema: + type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + id: + type: string + description: The ID of the deleted customer group. + object: + type: string + description: The type of the object that was deleted. + default: customer_group + deleted: + type: boolean + description: >- + Whether the customer group was deleted successfully or + not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -1917,35 +1781,32 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteCustomerGroupsGroupCustomerBatch - summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' + get: + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the customer + group. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the customer + group. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1957,13 +1818,7 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.removeCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) + medusa.admin.customerGroups.retrieve(customer_group_id) .then(({ customer_group }) => { console.log(customer_group.id); @@ -1971,21 +1826,10 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}' \ - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -1997,6 +1841,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -2012,13 +1857,30 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customer-groups: post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. x-authenticated: true - parameters: [] + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -2030,7 +1892,7 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.create({ + medusa.admin.customerGroups.update(customer_group_id, { name: 'VIP' }) @@ -2041,7 +1903,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' \ @@ -2061,6 +1923,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -2076,140 +1939,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. + '/customer-groups/{id}/customers': get: - operationId: GetCustomerGroups - summary: List Customer Groups - description: Retrieve a list of customer groups. + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group x-authenticated: true parameters: - - in: query - name: q - description: Query used for searching customer group names. - schema: - type: string - - in: query - name: offset - description: How many groups to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: order - description: the field used to order the customer groups. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the customer groups. - schema: - type: string - - in: query + - in: path name: id - style: form - explode: false - description: Filter by the customer group ID - schema: - oneOf: - - type: string - description: customer group ID - - type: array - description: multiple customer group IDs - items: - type: string - - type: object - properties: - lt: - type: string - description: filter by IDs less than this ID - gt: - type: string - description: filter by IDs greater than this ID - lte: - type: string - description: filter by IDs less than or equal to this ID - gte: - type: string - description: filter by IDs greater than or equal to this ID - - in: query - name: name - style: form - explode: false - description: Filter by the customer group name - schema: - type: array - description: multiple customer group names - items: - type: string - description: customer group name - - in: query - name: created_at - description: Date comparison for when resulting customer groups were created. - 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: Date comparison for when resulting customer groups were updated. - 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 customer groups returned. - schema: - type: integer - default: 10 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each customer - groups of the result. + required: true + description: The ID of the customer group. schema: type: string x-codeSamples: @@ -2223,16 +1963,16 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.list() + medusa.admin.customerGroups.listCustomers(customer_group_id) - .then(({ customer_groups, limit, offset, count }) => { - console.log(customer_groups.length); + .then(({ customers }) => { + console.log(customers.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ --header 'Authorization: Bearer {api_token}' security: @@ -2246,11 +1986,12 @@ paths: content: application/json: schema: + type: object properties: - customer_groups: + customers: type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/customer' count: type: integer description: The total number of items available @@ -2272,17 +2013,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}': - delete: - operationId: DeleteCustomerGroupsCustomerGroup - summary: Delete a Customer Group - description: Deletes a CustomerGroup. + '/batch-jobs/{id}/cancel': + post: + operationId: PostBatchJobsBatchJobCancel + summary: Cancel a Batch Job + description: Marks a batch job as canceled x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer Group + description: The ID of the batch job. schema: type: string x-codeSamples: @@ -2296,43 +2037,33 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.delete(customer_group_id) + medusa.admin.batchJobs.cancel(batch_job_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ batch_job }) => { + console.log(batch_job.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Batch Job responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted customer group. - object: - type: string - description: The type of the object that was deleted. - default: customer_group - deleted: - type: boolean - description: >- - Whether the customer group was deleted successfully or - not. - default: true + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -2345,30 +2076,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetCustomerGroupsGroup - summary: Get a Customer Group - description: Retrieves a Customer Group. + '/batch-jobs/{id}/confirm': + post: + operationId: PostBatchJobsBatchJobConfirmProcessing + summary: Confirm a Batch Job + description: Confirms that a previously requested batch job should be executed. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer Group. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in the customer - group. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in the customer - group. + description: The ID of the batch job. schema: type: string x-codeSamples: @@ -2382,32 +2100,33 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.retrieve(customer_group_id) + medusa.admin.batchJobs.confirm(batch_job_id) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ batch_job }) => { + console.log(batch_job.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Batch Job responses: '200': description: OK content: application/json: schema: + type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -2420,29 +2139,52 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /batch-jobs: post: - operationId: PostCustomerGroupsGroup - summary: Update a Customer Group - description: Update a CustomerGroup. + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string requestBody: content: application/json: schema: + type: object + required: + - type + - context properties: - name: - description: Name of the customer group + type: type: string - metadata: - description: Metadata for the customer. + description: The type of batch job to start. + example: product-export + context: type: object + description: >- + Additional infomration regarding the batch to be used for + processing. + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + type: boolean + description: >- + Set a batch job in dry_run mode to get some information on + what will be done without applying any modifications. + default: false x-codeSamples: - lang: JavaScript label: JS Client @@ -2454,40 +2196,42 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.update(customer_group_id, { - name: 'VIP' - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); + medusa.admin.batchJobs.create({ + type: 'product-export', + context: {}, + dry_run: false + }).then((({ batch_job }) => { + console.log(batch_job.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ + 'https://medusa-url.com/admin/batch-jobs' \ --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' \ + --data-raw '{ - "name": "VIP" + "type": "product-export", + "context": { } }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Batch Job responses: - '200': + '201': description: OK content: application/json: schema: + type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -2500,119 +2244,1952 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}/customers': get: - operationId: GetCustomerGroupsGroupCustomers - summary: List Customers - description: Retrieves a list of customers in a customer group + operationId: GetBatchJobs + summary: List Batch Jobs + description: Retrieve a list of Batch Jobs. x-authenticated: true parameters: - - in: path + - in: query + name: limit + description: The number of batch jobs to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of batch jobs to skip before results. + schema: + type: integer + default: 0 + - in: query name: id - required: true - description: The ID of the customer group. + style: form + explode: false + description: Filter by the batch ID schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.listCustomers(customer_group_id) - - .then(({ customers }) => { - console.log(customers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customers: - type: array - items: - $ref: '#/components/schemas/customer' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': + oneOf: + - type: string + description: batch job ID + - type: array + description: multiple batch job IDs + items: + type: string + - in: query + name: type + style: form + explode: false + description: Filter by the batch type + schema: + type: array + items: + type: string + - in: query + name: confirmed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was confirmed, i.e. + less than, greater than etc. + 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: pre_processed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was pre processed, + i.e. less than, greater than etc. + 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: completed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was completed, i.e. + less than, greater than etc. + 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: failed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was failed, i.e. less + than, greater than etc. + 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 + style: form + explode: false + description: >- + Date comparison for when resulting collections was canceled, i.e. + less than, greater than etc. + 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: order + description: Field used to order retrieved batch jobs + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each order of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each order of + the result. + schema: + type: string + - in: query + name: created_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was created, i.e. + less than, greater than etc. + 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 + style: form + explode: false + description: >- + Date comparison for when resulting collections was updated, i.e. + less than, greater than etc. + 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: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.list() + + .then(({ batch_jobs, limit, offset, count }) => { + console.log(batch_jobs.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/batch-jobs' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + batch_jobs: + type: array + items: + $ref: '#/components/schemas/batch_job' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/batch-jobs/{id}': + get: + operationId: GetBatchJobsBatchJob + summary: Get a Batch Job + description: Retrieves a Batch Job. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Batch Job + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.retrieve(batch_job_id) + + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/batch-jobs/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Customer + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.create({ + email: 'user@example.com', + first_name: 'Caterina', + last_name: 'Yost', + password: 'supersecret' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customers' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "first_name": "Caterina", + "last_name": "Yost", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + responses: + '201': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomers + summary: List Customers + description: Retrieves a list of Customers. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: 'a search term to search email, first_name, and last_name.' + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.list() + + .then(({ customers, limit, offset, count }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customers: + type: array + items: + $ref: '#/components/schemas/customer' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customers/{id}': + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: Retrieves a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the customer. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.retrieve(customer_id) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customers/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update a Customer + description: Updates a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each customer. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.update(customer_id, { + first_name: 'Dolly' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customers/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Dolly" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{id}/regions/{region_id}': + post: + operationId: PostDiscountsDiscountRegionsRegion + summary: Add Region + description: Adds a Region to the list of Regions that a Discount can be used in. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.addRegion(discount_id, region_id) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountRegionsRegion + summary: Remove Region + x-authenticated: true + description: >- + Removes a Region from the list of Regions that a Discount can be used + in. + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.removeRegion(discount_id, region_id) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions/{condition_id}/batch': + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add a batch of resources to a discount condition + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.addConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete a batch of resources from a discount condition + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions': + post: + operationId: PostDiscountsDiscountConditions + summary: Create a Condition + description: >- + Creates a DiscountCondition. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - operator + properties: + operator: + description: Operator of the condition + type: string + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + import { DiscountConditionOperator } from "@medusajs/medusa" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.createCondition(discount_id, { + operator: DiscountConditionOperator.IN + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "operator": "in" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts: + post: + operationId: PostDiscounts + summary: Creates a Discount + x-authenticated: true + description: >- + Creates a Discount with a given set of rules that define how the + Discount behaves. + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each customer. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - code + - rule + - regions + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: boolean + description: >- + Whether the Discount should have multiple instances of + itself, each with a different code. This can be useful for + automatically generated codes that all have to follow a + common set of rules. + default: false + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - type + - value + - allocation + properties: + description: + type: string + description: A short description of the discount + type: + type: string + description: >- + The type of the Discount, can be `fixed` for discounts + that reduce the price by a fixed amount, `percentage` + for percentage reductions or `free_shipping` for + shipping vouchers. + enum: + - fixed + - percentage + - free_shipping + value: + type: number + description: >- + The value that the discount represents; this will depend + on the type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the + discount can be used. Only one of `products`, + `product_types`, `product_collections`, `product_tags`, + and `customer_groups` should be provided. + items: + type: object + required: + - operator + properties: + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is + applied on product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is + applied on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is + applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is + applied on customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will + have to enable it later to make it available to Customers. + default: false + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: >- + The time at which the Discount should no longer be + available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + regions: + description: >- + A list of Region ids representing the Regions in which the + Discount can be used. + type: array + items: + type: string + usage_limit: + type: number + description: Maximum times the discount can be used + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + import { AllocationType, DiscountRuleType } from "@medusajs/medusa" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.create({ + code: 'TEST', + rule: { + type: DiscountRuleType.FIXED, + value: 10, + allocation: AllocationType.ITEM + }, + regions: ['reg_XXXXXXXX'], + is_dynamic: false, + is_disabled: false + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "code": "TEST", + "rule": { + "type": "fixed", + "value": 10, + "allocation": "item" + }, + "regions": ['reg_XXXXXXXX'] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscounts + summary: List Discounts + x-authenticated: true + description: Retrieves a list of Discounts + parameters: + - in: query + name: q + description: Search query applied on the code field. + schema: + type: string + - in: query + name: rule + description: Discount Rules filters to apply on the search + schema: + type: object + properties: + type: + type: string + enum: + - fixed + - percentage + - free_shipping + description: >- + The type of the Discount, can be `fixed` for discounts that + reduce the price by a fixed amount, `percentage` for + percentage reductions or `free_shipping` for shipping + vouchers. + allocation: + type: string + enum: + - total + - item + description: >- + The value that the discount represents; this will depend on + the type of the discount + - in: query + name: is_dynamic + description: Return only dynamic discounts. + schema: + type: boolean + - in: query + name: is_disabled + description: Return only disabled discounts. + schema: + type: boolean + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.list() + + .then(({ discounts, limit, offset, count }) => { + console.log(discounts.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discounts: + type: array + items: + $ref: '#/components/schemas/discount' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{id}/dynamic-codes': + post: + operationId: PostDiscountsDiscountDynamicCodes + summary: Create a Dynamic Code + description: >- + Creates a dynamic unique code that can map to a parent Discount. This is + useful if you want to automatically generate codes with the same + behaviour. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount to create the dynamic code from." + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.createDynamicCode(discount_id, { + code: 'TEST', + usage_limit: 1 + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - code + properties: + code: + type: string + description: The unique code that will be used to redeem the Discount. + usage_limit: + type: number + default: '1' + description: amount of times the discount can be applied. + metadata: + type: object + description: >- + An optional set of key-value paris to hold additional + information. + '/discounts/{discount_id}/conditions/{condition_id}': + delete: + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a Condition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteCondition(discount_id, condition_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted DiscountCondition + object: + type: string + description: The type of the object that was deleted. + default: discount-condition + deleted: + type: boolean + description: >- + Whether the discount condition was deleted successfully or + not. + default: true + discount: + description: The Discount to which the condition used to belong + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscountsDiscountConditionsCondition + summary: Get a Condition + description: Gets a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.getCondition(discount_id, condition_id) + + .then(({ discount_condition }) => { + console.log(discount_condition.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount_condition: + $ref: '#/components/schemas/discount_condition' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers: post: - operationId: PostCustomers - summary: Create a Customer - description: Creates a Customer. + operationId: PostDiscountsDiscountConditionsCondition + summary: Update a Condition + description: >- + Updates a DiscountCondition. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each item of + the result. + schema: + type: string requestBody: content: application/json: schema: - required: - - email - - first_name - - last_name - - password + type: object properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array description: >- - An optional set of key-value pairs to hold additional - information. - type: object - tags: - - Customer + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -2624,44 +4201,46 @@ paths: // must be previously logged in or use api token - medusa.admin.customers.create({ - email: 'user@example.com', - first_name: 'Caterina', - last_name: 'Yost', - password: 'supersecret' + medusa.admin.discounts.updateCondition(discount_id, condition_id, { + products: [ + product_id + ] }) - .then(({ customer }) => { - console.log(customer.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customers' \ + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com", - "first_name": "Caterina", - "last_name": "Yost", - "password": "supersecret" + "products": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] }' security: - api_token: [] - cookie_auth: [] + tags: + - Discount responses: - '201': + '200': description: OK content: application/json: schema: + type: object properties: - customer: - $ref: '#/components/schemas/customer' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -2674,32 +4253,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetCustomers - summary: List Customers - description: Retrieves a list of Customers. + '/discounts/{id}': + delete: + operationId: DeleteDiscountsDiscount + summary: Delete a Discount + description: Deletes a Discount. x-authenticated: true parameters: - - in: query - name: limit - description: The number of items to return. - schema: - type: integer - default: 50 - - in: query - name: offset - description: The items to skip before result. - schema: - type: integer - default: 0 - - in: query - name: expand - description: (Comma separated) Which fields should be expanded in each customer. - schema: - type: string - - in: query - name: q - description: 'a search term to search email, first_name, and last_name.' + - in: path + name: id + required: true + description: The ID of the Discount schema: type: string x-codeSamples: @@ -2713,43 +4277,42 @@ paths: // must be previously logged in or use api token - medusa.admin.customers.list() + medusa.admin.discounts.delete(discount_id) - .then(({ customers, limit, offset, count }) => { - console.log(customers.length); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/customers' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer + - Discount responses: '200': description: OK content: application/json: schema: + type: object properties: - customers: - type: array - items: - $ref: '#/components/schemas/customer' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + id: + type: string + description: The ID of the deleted Discount + object: + type: string + description: The type of the object that was deleted. + default: discount + deleted: + type: boolean + description: Whether the discount was deleted successfully or not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -2762,27 +4325,26 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customers/{id}': get: - operationId: GetCustomersCustomer - summary: Get a Customer - description: Retrieves a Customer. + operationId: GetDiscountsDiscount + summary: Get a Discount + description: Retrieves a Discount x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer. + description: The ID of the Discount schema: type: string - in: query name: expand - description: (Comma separated) Which fields should be expanded in the customer. + description: Comma separated list of relations to include in the results. schema: type: string - in: query name: fields - description: (Comma separated) Which fields should be included in the customer. + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -2796,32 +4358,33 @@ paths: // must be previously logged in or use api token - medusa.admin.customers.retrieve(customer_id) + medusa.admin.discounts.retrieve(discount_id) - .then(({ customer }) => { - console.log(customer.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/customers/{id}' \ + 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer + - Discount responses: '200': description: OK content: application/json: schema: + type: object properties: - customer: - $ref: '#/components/schemas/customer' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -2835,63 +4398,152 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostCustomersCustomer - summary: Update a Customer - description: Updates a Customer. + operationId: PostDiscountsDiscount + summary: Update a Discount + description: >- + Updates a Discount with a given set of rules that define how the + Discount behaves. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer. + description: The ID of the Discount. schema: type: string - in: query name: expand - description: (Comma separated) Which fields should be expanded in each customer. + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. schema: type: string - in: query name: fields - description: (Comma separated) Which fields should be retrieved in each customer. + description: >- + (Comma separated) Which fields should be included in each item of + the result. schema: type: string requestBody: content: application/json: schema: + type: object properties: - email: - type: string - description: The Customer's email. - format: email - first_name: + code: type: string - description: The Customer's first name. - last_name: + description: A unique code that will be used to redeem the Discount + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - id + properties: + id: + type: string + description: The ID of the Rule + description: + type: string + description: A short description of the discount + value: + type: number + description: >- + The value that the discount represents; this will depend + on the type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the + discount can be used. Only one of `products`, + `product_types`, `product_collections`, `product_tags`, + and `customer_groups` should be provided. + items: + type: object + required: + - operator + properties: + id: + type: string + description: The ID of the Rule + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is + applied on product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is + applied on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is + applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is + applied on customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will + have to enable it later to make it available to Customers. + starts_at: type: string - description: The Customer's last name. - phone: + format: date-time + description: The time at which the Discount should be available. + ends_at: type: string - description: The Customer's phone number. - password: + format: date-time + description: >- + The time at which the Discount should no longer be + available. + valid_duration: type: string - description: The Customer's password. - format: password - groups: + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + usage_limit: + type: number + description: Maximum times the discount can be used + regions: + description: >- + A list of Region ids representing the Regions in which the + Discount can be used. type: array items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. + type: string metadata: - description: >- - An optional set of key-value pairs to hold additional - information. + description: An object containing metadata of the discount type: object x-codeSamples: - lang: JavaScript @@ -2904,40 +4556,41 @@ paths: // must be previously logged in or use api token - medusa.admin.customers.update(customer_id, { - first_name: 'Dolly' + medusa.admin.discounts.update(discount_id, { + code: 'TEST' }) - .then(({ customer }) => { - console.log(customer.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customers/{id}' \ + 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "first_name": "Dolly" + "code": "TEST" }' security: - api_token: [] - cookie_auth: [] tags: - - Customer + - Discount responses: '200': description: OK content: application/json: schema: + type: object properties: - customer: - $ref: '#/components/schemas/customer' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -2950,23 +4603,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/regions/{region_id}': - post: - operationId: PostDiscountsDiscountRegionsRegion - summary: Add Region - description: Adds a Region to the list of Regions that a Discount can be used in. + '/discounts/{id}/dynamic-codes/{code}': + delete: + operationId: DeleteDiscountsDiscountDynamicCodesCode + summary: Delete a Dynamic Code + description: Deletes a dynamic code from a Discount. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Discount. + description: The ID of the Discount schema: type: string - in: path - name: region_id + name: code required: true - description: The ID of the Region. + description: The ID of the Discount schema: type: string x-codeSamples: @@ -2980,7 +4633,7 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.addRegion(discount_id, region_id) + medusa.admin.discounts.deleteDynamicCode(discount_id, code) .then(({ discount }) => { console.log(discount.id); @@ -2988,8 +4641,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ --header 'Authorization: Bearer {api_token}' security: @@ -3003,6 +4656,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3018,24 +4672,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteDiscountsDiscountRegionsRegion - summary: Remove Region + '/discounts/code/{code}': + get: + operationId: GetDiscountsDiscountCode + summary: Get Discount by Code + description: Retrieves a Discount by its discount code x-authenticated: true - description: >- - Removes a Region from the list of Regions that a Discount can be used - in. parameters: - in: path - name: id + name: code required: true - description: The ID of the Discount. + description: The code of the Discount schema: type: string - - in: path - name: region_id - required: true - description: The ID of the Region. + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -3049,7 +4706,7 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.removeRegion(discount_id, region_id) + medusa.admin.discounts.retrieveByCode(code) .then(({ discount }) => { console.log(discount.id); @@ -3057,8 +4714,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + curl --location --request GET + 'https://medusa-url.com/admin/discounts/code/{code}' \ --header 'Authorization: Bearer {api_token}' security: @@ -3072,6 +4729,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3087,56 +4745,116 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{discount_id}/conditions/{condition_id}/batch': + /draft-orders: post: - operationId: PostDiscountsDiscountConditionsConditionBatch - summary: Add a batch of resources to a discount condition - description: Add a batch of resources to a discount condition. + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order x-authenticated: true - parameters: - - in: path - name: discount_id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: condition_id - required: true - description: The ID of the condition on which to add the item. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which relations should be expanded in each - discount of the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each discount - of the result. - schema: - type: string requestBody: content: application/json: schema: + type: object required: - - resources + - email + - items + - region_id + - shipping_methods properties: - resources: - description: The resources to be added to the discount condition + status: + description: The status of the draft order + type: string + enum: + - open + - completed + email: + description: The email of the customer of the draft order + type: string + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - quantity + properties: + variant_id: + description: >- + The ID of the Product Variant to generate the Line + Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details + about the Line Item. + type: object + region_id: + description: The ID of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order type: array items: + type: object required: - - id + - code properties: - id: - description: The id of the item + code: + description: The code of the discount to apply + type: string + customer_id: + description: The ID of the customer to add on the draft order + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine + use of notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + type: object + required: + - option_id + properties: + option_id: + description: The ID of the shipping option in use type: string + data: + description: >- + The optional additional data needed for the shipping + method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Draft Order. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -3148,42 +4866,63 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.addConditionResourceBatch(discount_id, - condition_id, { - resources: [{ id: item_id }] + medusa.admin.draftOrders.create({ + email: 'user@example.com', + region_id, + items: [ + { + quantity: 1 + } + ], + shipping_methods: [ + { + option_id + } + ], }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' - \ + 'https://medusa-url.com/admin/draft-orders' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "resources": [{ "id": "item_id" }] + "email": "user@example.com", + "region_id": "{region_id}" + "items": [ + { + "quantity": 1 + } + ], + "shipping_methods": [ + { + "option_id": "{option_id}" + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3196,55 +4935,31 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteDiscountsDiscountConditionsConditionBatch - summary: Delete a batch of resources from a discount condition - description: Delete a batch of resources from a discount condition. + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders x-authenticated: true parameters: - - in: path - name: discount_id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: condition_id - required: true - description: The ID of the condition on which to add the item. + - in: query + name: offset + description: The number of items to skip before the results. schema: - type: string + type: number + default: '0' - in: query - name: expand - description: >- - (Comma separated) Which relations should be expanded in each - discount of the result. + name: limit + description: Limit the number of items returned. schema: - type: string + type: number + default: '50' - in: query - name: fields + name: q description: >- - (Comma separated) Which fields should be included in each discount - of the result. + a search term to search emails in carts associated with draft orders + and display IDs of draft orders schema: type: string - requestBody: - content: - application/json: - schema: - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3256,42 +4971,44 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.deleteConditionResourceBatch(discount_id, - condition_id, { - resources: [{ id: item_id }] - }) + medusa.admin.draftOrders.list() - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_orders, limit, offset, count }) => { + console.log(draft_orders.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders' \ - --data-raw '{ - "resources": [{ "id": "item_id" }] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_orders: + type: array + items: + $ref: '#/components/schemas/draft-order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -3304,129 +5021,93 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{discount_id}/conditions': + '/draft-orders/{id}/line-items': post: - operationId: PostDiscountsDiscountConditions - summary: Create a Condition - description: >- - Creates a DiscountCondition. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` should be - provided. + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item + description: Creates a Line Item for the Draft Order x-authenticated: true parameters: - in: path - name: discount_id + name: id required: true - description: The ID of the Product. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + description: The ID of the Draft Order. schema: type: string requestBody: content: application/json: schema: + type: object required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array + - quantity + properties: + variant_id: description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + The ID of the Product Variant to generate the Line Item + from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + default: Custom item + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" - import { DiscountConditionOperator } from "@medusajs/medusa" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.createCondition(discount_id, { - operator: DiscountConditionOperator.IN + medusa.admin.draftOrders.addLineItem(draft_order_id, { + quantity: 1 }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions' \ + 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "operator": "in" + "quantity": 1 }' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3439,224 +5120,66 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /discounts: - post: - operationId: PostDiscounts - summary: Creates a Discount + '/draft-orders/{id}': + delete: + operationId: DeleteDraftOrdersDraftOrder + summary: Delete a Draft Order + description: Deletes a Draft Order x-authenticated: true - description: >- - Creates a Discount with a given set of rules that define how the - Discount behaves. parameters: - - in: query - name: expand - description: (Comma separated) Which fields should be expanded in each customer. - schema: - type: string - - in: query - name: fields - description: (Comma separated) Which fields should be retrieved in each customer. + - in: path + name: id + required: true + description: The ID of the Draft Order. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - code - - rule - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts - that reduce the price by a fixed amount, `percentage` - for percentage reductions or `free_shipping` for - shipping vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" - import { AllocationType, DiscountRuleType } from "@medusajs/medusa" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.create({ - code: 'TEST', - rule: { - type: DiscountRuleType.FIXED, - value: 10, - allocation: AllocationType.ITEM - }, - is_dynamic: false, - is_disabled: false - }) + medusa.admin.draftOrders.delete(draft_order_id) - .then(({ discount }) => { - console.log(discount.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}' \ - --data-raw '{ - "code": "TEST", - "rule": { - "type": "fixed", - "value": 10, - "allocation": "item" - } - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + id: + type: string + description: The ID of the deleted Draft Order. + object: + type: string + description: The type of the object that was deleted. + default: draft-order + deleted: + type: boolean + description: Whether the draft order was deleted successfully or not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -3670,66 +5193,15 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetDiscounts - summary: List Discounts + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. x-authenticated: true - description: Retrieves a list of Discounts parameters: - - in: query - name: q - description: Search query applied on the code field. - schema: - type: string - - in: query - name: rule - description: Discount Rules filters to apply on the search - schema: - type: object - properties: - type: - type: string - enum: - - fixed - - percentage - - free_shipping - description: >- - The type of the Discount, can be `fixed` for discounts that - reduce the price by a fixed amount, `percentage` for - percentage reductions or `free_shipping` for shipping - vouchers. - allocation: - type: string - enum: - - total - - item - description: >- - The value that the discount represents; this will depend on - the type of the discount - - in: query - name: is_dynamic - description: Return only dynamic discounts. - schema: - type: boolean - - in: query - name: is_disabled - description: Return only disabled discounts. - schema: - type: boolean - - in: query - name: limit - description: The number of items in the response - schema: - type: number - default: '20' - - in: query - name: offset - description: The offset of items in response - schema: - type: number - default: '0' - - in: query - name: expand - description: Comma separated list of relations to include in the results. + - in: path + name: id + required: true + description: The ID of the Draft Order. schema: type: string x-codeSamples: @@ -3743,43 +5215,33 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.list() + medusa.admin.draftOrders.retrieve(draft_order_id) - .then(({ discounts, limit, offset, count }) => { - console.log(discounts.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/discounts' \ + 'https://medusa-url.com/admin/draft-orders/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discounts: - type: array - items: - $ref: '#/components/schemas/discount' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3792,20 +5254,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/dynamic-codes': - post: - operationId: PostDiscountsDiscountDynamicCodes - summary: Create a Dynamic Code - description: >- - Creates a dynamic unique code that can map to a parent Discount. This is - useful if you want to automatically generate codes with the same - behaviour. + '/draft-orders/{id}/line-items/{line_id}': + delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Discount to create the dynamic code from." + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Draft Order. schema: type: string x-codeSamples: @@ -3819,41 +5284,34 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.createDynamicCode(discount_id, { - code: 'TEST', - usage_limit: 1 - }) + medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ - --data-raw '{ - "code": "TEST" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3866,55 +5324,44 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - code - properties: - code: - type: string - description: The unique code that will be used to redeem the Discount. - usage_limit: - type: number - default: '1' - description: amount of times the discount can be applied. - metadata: - type: object - description: >- - An optional set of key-value paris to hold additional - information. - '/discounts/{discount_id}/conditions/{condition_id}': - delete: - operationId: DeleteDiscountsDiscountConditionsCondition - summary: Delete a Condition - description: Deletes a DiscountCondition + post: + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item + description: Updates a Line Item for a Draft Order x-authenticated: true parameters: - in: path - name: discount_id + name: id required: true - description: The ID of the Discount + description: The ID of the Draft Order. schema: type: string - in: path - name: condition_id + name: line_id required: true - description: The ID of the DiscountCondition - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The ID of the Line Item. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -3926,47 +5373,42 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.deleteCondition(discount_id, condition_id) + medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + quantity: 1 + }) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted DiscountCondition - object: - type: string - description: The type of the object that was deleted. - default: discount-condition - deleted: - type: boolean - description: >- - Whether the discount condition was deleted successfully or - not. - default: true - discount: - description: The Discount to which the condition used to belong - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3979,32 +5421,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetDiscountsDiscountConditionsCondition - summary: Get a Condition - description: Gets a DiscountCondition + '/draft-orders/{id}/pay': + post: + summary: Registers a Payment + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. x-authenticated: true parameters: - in: path - name: discount_id - required: true - description: The ID of the Discount. - schema: - type: string - - in: path - name: condition_id + name: id required: true - description: The ID of the DiscountCondition. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The Draft Order id. schema: type: string x-codeSamples: @@ -4018,33 +5445,33 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.getCondition(discount_id, condition_id) + medusa.admin.draftOrders.markPaid(draft_order_id) - .then(({ discount_condition }) => { - console.log(discount_condition.id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' - \ + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount_condition: - $ref: '#/components/schemas/discount_condition' + order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -4057,79 +5484,68 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/admin/draft-orders/{id}': post: - operationId: PostDiscountsDiscountConditionsCondition - summary: Update a Condition - description: >- - Updates a DiscountCondition. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` should be - provided. + operationId: PostDraftOrdersDraftOrder + summary: Update a Draft Order + description: Updates a Draft Order. x-authenticated: true parameters: - in: path - name: discount_id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: condition_id + name: id required: true - description: The ID of the DiscountCondition. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each item of - the result. + description: The ID of the Draft Order. schema: type: string requestBody: content: application/json: schema: + type: object properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: + region_id: + type: string + description: The ID of the Region to create the Draft Order in. + country_code: + type: string + description: The 2 character ISO code for the Country. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Draft Order. + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + discounts: + description: An array of Discount codes to add to the Draft Order. type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. items: - type: string - customer_groups: - type: array + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + An optional flag passed to the resulting order to determine + use of notifications. + type: boolean + customer_id: + description: The ID of the Customer to associate the Draft Order with. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -4141,45 +5557,41 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.updateCondition(discount_id, condition_id, { - products: [ - product_id - ] + medusa.admin.draftOrders.update(draft_order_id, { + email: "user@example.com" }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' - \ + 'https://medusa-url.com/admin/draft-orders/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "products": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] + "email": "user@example.com" }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -4192,19 +5604,46 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}': - delete: - operationId: DeleteDiscountsDiscount - summary: Delete a Discount - description: Deletes a Discount. + /gift-cards: + post: + operationId: PostGiftCards + summary: Create a Gift Card + description: >- + Creates a Gift Card that can redeemed by its unique code. The Gift Card + is only valid within 1 region. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Discount - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - region_id + properties: + value: + type: integer + description: >- + The value (excluding VAT) that the Gift Card should + represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have + to enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: >- + The time at which the Gift Card should no longer be + available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -4216,41 +5655,41 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.delete(discount_id) + medusa.admin.giftCards.create({ + region_id + }) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/gift-cards' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "region_id": "{region_id}" + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Discount - object: - type: string - description: The type of the object that was deleted. - default: discount - deleted: - type: boolean - description: Whether the discount was deleted successfully or not. - default: true + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' '401': @@ -4264,25 +5703,26 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetDiscountsDiscount - summary: Get a Discount - description: Retrieves a Discount + operationId: GetGiftCards + summary: List Gift Cards + description: Retrieves a list of Gift Cards. x-authenticated: true parameters: - - in: path - name: id - required: true - description: The ID of the Discount + - in: query + name: offset + description: The number of items to skip before the results. schema: - type: string + type: number + default: '0' - in: query - name: expand - description: Comma separated list of relations to include in the results. + name: limit + description: Limit the number of items returned. schema: - type: string + type: number + default: '50' - in: query - name: fields - description: Comma separated list of fields to include in the results. + name: q + description: a search term to search by code or display ID schema: type: string x-codeSamples: @@ -4296,32 +5736,44 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.retrieve(discount_id) + medusa.admin.giftCards.list() - .then(({ discount }) => { - console.log(discount.id); + .then(({ gift_cards, limit, offset, count }) => { + console.log(gift_cards.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/discounts/{id}' \ + 'https://medusa-url.com/admin/gift-cards' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + gift_cards: + type: array + items: + $ref: '#/components/schemas/gift_card' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -4334,153 +5786,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostDiscountsDiscount - summary: Update a Discount - description: >- - Updates a Discount with a given set of rules that define how the - Discount behaves. + '/gift-cards/{id}': + delete: + operationId: DeleteGiftCardsGiftCard + summary: Delete a Gift Card + description: Deletes a Gift Card x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Discount. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each item of - the result. + description: The ID of the Gift Card to delete. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - id - properties: - id: - type: string - description: The ID of the Rule - description: - type: string - description: A short description of the discount - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - id: - type: string - description: The ID of the Rule - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - usage_limit: - type: number - description: Maximum times the discount can be used - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - metadata: - description: An object containing metadata of the discount - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -4492,40 +5810,42 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.update(discount_id, { - code: 'TEST' - }) + medusa.admin.giftCards.delete(gift_card_id) - .then(({ discount }) => { - console.log(discount.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/gift-cards/{id}' \ - --data-raw '{ - "code": "TEST" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + id: + type: string + description: The ID of the deleted Gift Card + object: + type: string + description: The type of the object that was deleted. + default: gift-card + deleted: + type: boolean + description: Whether the gift card was deleted successfully or not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -4538,23 +5858,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/dynamic-codes/{code}': - delete: - operationId: DeleteDiscountsDiscountDynamicCodesCode - summary: Delete a Dynamic Code - description: Deletes a dynamic code from a Discount. + get: + operationId: GetGiftCardsGiftCard + summary: Get a Gift Card + description: Retrieves a Gift Card. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Discount - schema: - type: string - - in: path - name: code - required: true - description: The ID of the Discount + description: The ID of the Gift Card. schema: type: string x-codeSamples: @@ -4568,32 +5881,33 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.deleteDynamicCode(discount_id, code) + medusa.admin.giftCards.retrieve(gift_card_id) - .then(({ discount }) => { - console.log(discount.id); + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ + curl --location --request GET + 'https://medusa-url.com/admin/gift-cards/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' '401': @@ -4606,29 +5920,50 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/code/{code}': - get: - operationId: GetDiscountsDiscountCode - summary: Get Discount by Code - description: Retrieves a Discount by its discount code + post: + operationId: PostGiftCardsGiftCard + summary: Update a Gift Card + description: >- + Update a Gift Card that can redeemed by its unique code. The Gift Card + is only valid within 1 region. x-authenticated: true parameters: - in: path - name: code + name: id required: true - description: The code of the Discount - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The ID of the Gift Card. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + balance: + type: integer + description: >- + The value (excluding VAT) that the Gift Card should + represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have + to enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: >- + The time at which the Gift Card should no longer be + available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -4640,32 +5975,41 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.retrieveByCode(code) + medusa.admin.giftCards.update(gift_card_id, { + region_id + }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/code/{code}' \ + curl --location --request POST + 'https://medusa-url.com/admin/gift-cards/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "region_id": "{region_id}" + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - discount: - $ref: '#/components/schemas/discount' + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' '401': @@ -4678,115 +6022,41 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /draft-orders: + /invites/accept: post: - operationId: PostDraftOrders - summary: Create a Draft Order - description: Creates a Draft Order - x-authenticated: true + operationId: PostInvitesInviteAccept + summary: Accept an Invite + description: Accepts an Invite and creates a corresponding user requestBody: content: application/json: schema: + type: object required: - - email - - items - - region_id - - shipping_methods + - token + - user properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. - type: object - region_id: - description: The ID of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order + token: + description: The invite token provided by the admin. type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. + user: + description: The User to create. type: object + required: + - first_name + - last_name + - password + properties: + first_name: + type: string + description: the first name of the User + last_name: + type: string + description: the last name of the User + password: + description: The desired password for the User + type: string + format: password x-codeSamples: - lang: JavaScript label: JS Client @@ -4798,62 +6068,48 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.create({ - email: 'user@example.com', - region_id, - items: [ - { - quantity: 1 - } - ], - shipping_methods: [ - { - option_id - } - ], + medusa.admin.invites.accept({ + token, + user: { + first_name: 'Brigitte', + last_name: 'Collier', + password: 'supersecret' + } }) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/draft-orders' \ + 'https://medusa-url.com/admin/invites/accept' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com", - "region_id": "{region_id}" - "items": [ - { - "quantity": 1 - } - ], - "shipping_methods": [ - { - "option_id": "{option_id}" - } - ] + "token": "{token}", + "user": { + "first_name": "Brigitte", + "last_name": "Collier", + "password": "supersecret" + } }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Invite responses: '200': description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -4866,31 +6122,32 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetDraftOrders - summary: List Draft Orders - description: Retrieves an list of Draft Orders + /invites: + post: + operationId: PostInvites + summary: Create an Invite + description: Creates an Invite and triggers an 'invite' created event x-authenticated: true - parameters: - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of items returned. - schema: - type: number - default: '50' - - in: query - name: q - description: >- - a search term to search emails in carts associated with draft orders - and display IDs of draft orders - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - user + - role + properties: + user: + description: The email for the user to be created. + type: string + format: email + role: + description: The role of the user to be created. + type: string + enum: + - admin + - member + - developer x-codeSamples: - lang: JavaScript label: JS Client @@ -4902,43 +6159,40 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.list() + medusa.admin.invites.create({ + user: "user@example.com", + role: "admin" + }) - .then(({ draft_orders, limit, offset, count }) => { - console.log(draft_orders.length); + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/draft-orders' \ + curl --location --request POST + 'https://medusa-url.com/admin/invites' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "user": "user@example.com", + "role": "admin" + }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Invite responses: '200': description: OK - content: - application/json: - schema: - properties: - draft_orders: - type: array - items: - $ref: '#/components/schemas/draft-order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -4951,46 +6205,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items': - post: - operationId: PostDraftOrdersDraftOrderLineItems - summary: Create a Line Item - description: Creates a Line Item for the Draft Order + get: + operationId: GetInvites + summary: Lists Invites + description: Lists all Invites x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -5002,40 +6221,35 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.addLineItem(draft_order_id, { - quantity: 1 - }) + medusa.admin.invites.list() - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ invites }) => { + console.log(invites.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET 'https://medusa-url.com/admin/invites' + \ - --data-raw '{ - "quantity": 1 - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Invite responses: '200': description: OK content: application/json: schema: + type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + invites: + type: array + items: + $ref: '#/components/schemas/invite' '400': $ref: '#/components/responses/400_error' '401': @@ -5048,17 +6262,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}': + '/invites/{invite_id}': delete: - operationId: DeleteDraftOrdersDraftOrder - summary: Delete a Draft Order - description: Deletes a Draft Order + operationId: DeleteInvitesInvite + summary: Create an Invite + description: Creates an Invite and triggers an 'invite' created event x-authenticated: true parameters: - in: path - name: id + name: invite_id required: true - description: The ID of the Draft Order. + description: The ID of the Invite schema: type: string x-codeSamples: @@ -5072,7 +6286,7 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.delete(draft_order_id) + medusa.admin.invites.delete(invite_id) .then(({ id, object, deleted }) => { console.log(id); @@ -5081,31 +6295,32 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}' \ + 'https://medusa-url.com/admin/invites/{invite_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Invite responses: '200': description: OK content: application/json: schema: + type: object properties: id: type: string - description: The ID of the deleted Draft Order. + description: The ID of the deleted Invite. object: type: string description: The type of the object that was deleted. - default: draft-order + format: invite deleted: type: boolean - description: Whether the draft order was deleted successfully or not. + description: Whether or not the Invite was deleted. default: true '400': $ref: '#/components/responses/400_error' @@ -5119,16 +6334,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetDraftOrdersDraftOrder - summary: Get a Draft Order - description: Retrieves a Draft Order. + '/invites/{invite_id}/resend': + post: + operationId: PostInvitesInviteResend + summary: Resend an Invite + description: Resends an Invite by triggering the 'invite' created event again x-authenticated: true parameters: - in: path - name: id + name: invite_id required: true - description: The ID of the Draft Order. + description: The ID of the Invite schema: type: string x-codeSamples: @@ -5142,32 +6358,30 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.retrieve(draft_order_id) + medusa.admin.invites.resend(invite_id) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/draft-orders/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Invite responses: '200': description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -5180,25 +6394,31 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items/{line_id}': - delete: - operationId: DeleteDraftOrdersDraftOrderLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Draft Order. - schema: - type: string + /notes: + post: + operationId: PostNotes + summary: Creates a Note + description: Creates a Note which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - resource_id + - resource_type + - value + properties: + resource_id: + type: string + description: The ID of the resource which the Note relates to. + resource_type: + type: string + description: The type of resource which the Note relates to. + value: + type: string + description: The content of the Note to create. x-codeSamples: - lang: JavaScript label: JS Client @@ -5210,33 +6430,45 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + medusa.admin.notes.create({ + resource_id, + resource_type: 'order', + value: 'We delivered this order' + }) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ note }) => { + console.log(note.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + curl --location --request POST 'https://medusa-url.com/admin/notes' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Note responses: '200': description: OK content: application/json: schema: + type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + note: + $ref: '#/components/schemas/note' '400': $ref: '#/components/responses/400_error' '401': @@ -5249,43 +6481,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostDraftOrdersDraftOrderLineItemsItem - summary: Update a Line Item - description: Updates a Line Item for a Draft Order + get: + operationId: GetNotes + summary: List Notes x-authenticated: true + description: Retrieves a list of notes parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. + - in: query + name: limit + description: The number of notes to get schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Line Item. + type: number + default: '50' + - in: query + name: offset + description: The offset at which to get notes + schema: + type: number + default: '0' + - in: query + name: resource_id + description: The ID which the notes belongs to schema: type: string - requestBody: - content: - application/json: - schema: - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -5297,41 +6515,42 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { - quantity: 1 - }) + medusa.admin.notes.list() - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ notes, limit, offset, count }) => { + console.log(notes.length); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "quantity": 1 - }' + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes' \ + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Note responses: '200': description: OK content: application/json: schema: + type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + notes: + type: array + items: + $ref: '#/components/schemas/note' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -5344,17 +6563,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/pay': - post: - summary: Registers a Payment - operationId: PostDraftOrdersDraftOrderRegisterPayment - description: Registers a payment for a Draft Order. + '/notes/{id}': + delete: + operationId: DeleteNotesNote + summary: Delete a Note + description: Deletes a Note. x-authenticated: true parameters: - in: path name: id required: true - description: The Draft Order id. + description: The ID of the Note to delete. schema: type: string x-codeSamples: @@ -5368,32 +6587,42 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.markPaid(draft_order_id) + medusa.admin.notes.delete(note_id) - .then(({ order }) => { - console.log(order.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/notes/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Note responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/draft-order' + id: + type: string + description: The ID of the deleted Note. + object: + type: string + description: The type of the object that was deleted. + default: note + deleted: + type: boolean + description: Whether or not the Note was deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -5406,67 +6635,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/admin/draft-orders/{id}': - post: - operationId: PostDraftOrdersDraftOrder - summary: Update a Draft Order - description: Updates a Draft Order. + get: + operationId: GetNotesNote + summary: Get a Note + description: Retrieves a single note using its id x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Draft Order. + description: The ID of the note to retrieve. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -5478,40 +6658,33 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.update(draft_order_id, { - email: "user@example.com" - }) + medusa.admin.notes.retrieve(note_id) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ note }) => { + console.log(note.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/notes/{id}' \ - --data-raw '{ - "email": "user@example.com" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Note responses: '200': description: OK content: application/json: schema: + type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + note: + $ref: '#/components/schemas/note' '400': $ref: '#/components/responses/400_error' '401': @@ -5524,45 +6697,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /gift-cards: post: - operationId: PostGiftCards - summary: Create a Gift Card - description: >- - Creates a Gift Card that can redeemed by its unique code. The Gift Card - is only valid within 1 region. + operationId: PostNotesNote + summary: Update a Note x-authenticated: true + description: Updates a Note associated with some resource + parameters: + - in: path + name: id + required: true + description: The ID of the Note to update + schema: + type: string requestBody: content: application/json: schema: + type: object required: - - region_id + - value properties: value: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + description: The updated description of the Note. x-codeSamples: - lang: JavaScript label: JS Client @@ -5574,40 +6731,41 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.create({ - region_id + medusa.admin.notes.update(note_id, { + value: 'We delivered this order' }) - .then(({ gift_card }) => { - console.log(gift_card.id); + .then(({ note }) => { + console.log(note.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/gift-cards' \ + 'https://medusa-url.com/admin/notes/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "region_id": "{region_id}" + "value": "We delivered this order" }' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Note responses: '200': description: OK content: application/json: schema: + type: object properties: - gift_card: - $ref: '#/components/schemas/gift_card' + note: + $ref: '#/components/schemas/note' '400': $ref: '#/components/responses/400_error' '401': @@ -5620,27 +6778,65 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /notifications: get: - operationId: GetGiftCards - summary: List Gift Cards - description: Retrieves a list of Gift Cards. + operationId: GetNotifications + summary: List Notifications + description: Retrieves a list of Notifications. x-authenticated: true parameters: - in: query name: offset - description: The number of items to skip before the results. + description: >- + The number of notifications to skip before starting to collect the + notifications set schema: - type: number - default: '0' + type: integer + default: 0 - in: query name: limit - description: Limit the number of items returned. + description: The number of notifications to return schema: - type: number - default: '50' + type: integer + default: 50 - in: query - name: q - description: a search term to search by code or display ID + name: fields + description: Comma separated fields to include in the result set + schema: + type: string + - in: query + name: expand + description: Comma separated fields to populate + schema: + type: string + - in: query + name: event_name + description: The name of the event that the notification was sent for. + schema: + type: string + - in: query + name: resource_type + description: The type of resource that the Notification refers to. + schema: + type: string + - in: query + name: resource_id + description: The ID of the resource that the Notification refers to. + schema: + type: string + - in: query + name: to + description: >- + The address that the Notification was sent to. This will usually be + an email address, but represent other addresses such as a chat bot + user id + schema: + type: string + - in: query + name: include_resends + description: >- + A boolean indicating whether the result set should include resent + notifications or not schema: type: string x-codeSamples: @@ -5654,43 +6850,35 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.list() + medusa.admin.notifications.list() - .then(({ gift_cards, limit, offset, count }) => { - console.log(gift_cards.length); + .then(({ notifications }) => { + console.log(notifications.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/gift-cards' \ + 'https://medusa-url.com/admin/notifications' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Notification responses: '200': description: OK content: application/json: schema: + type: object properties: - gift_cards: + notifications: type: array items: - $ref: '#/components/schemas/gift_card' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + $ref: '#/components/schemas/notification' '400': $ref: '#/components/responses/400_error' '401': @@ -5703,19 +6891,32 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{id}': - delete: - operationId: DeleteGiftCardsGiftCard - summary: Delete a Gift Card - description: Deletes a Gift Card + '/notifications/{id}/resend': + post: + operationId: PostNotificationsNotificationResend + summary: Resend Notification + description: >- + Resends a previously sent notifications, with the same data but + optionally to a different address x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Gift Card to delete. + description: The ID of the Notification schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + to: + description: >- + A new address or user identifier that the Notification + should be sent to + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -5727,41 +6928,33 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.delete(gift_card_id) + medusa.admin.notifications.resend(notification_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ notification }) => { + console.log(notification.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/gift-cards/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/notifications/{id}/resend' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Notification responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Gift Card - object: - type: string - description: The type of the object that was deleted. - default: gift-card - deleted: - type: boolean - description: Whether the gift card was deleted successfully or not. - default: true + notification: + $ref: '#/components/schemas/notification' '400': $ref: '#/components/responses/400_error' '401': @@ -5774,18 +6967,39 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetGiftCardsGiftCard - summary: Get a Gift Card - description: Retrieves a Gift Card. - x-authenticated: true + '/order-edits/{id}/items': + post: + operationId: PostOrderEditsEditLineItems + summary: Add an line item to an order (edit) + description: Create an OrderEdit LineItem. parameters: - in: path name: id required: true - description: The ID of the Gift Card. + description: The ID of the Order Edit. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -5797,32 +7011,41 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.retrieve(gift_card_id) + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) - .then(({ gift_card }) => { - console.log(gift_card.id); - }); + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/gift-cards/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/items' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", + "quantity": 3 }' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - gift_card: - $ref: '#/components/schemas/gift_card' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -5835,49 +7058,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/order-edits/{id}/cancel': post: - operationId: PostGiftCardsGiftCard - summary: Update a Gift Card - description: >- - Update a Gift Card that can redeemed by its unique code. The Gift Card - is only valid within 1 region. + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Gift Card. + description: The ID of the OrderEdit. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - balance: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -5889,86 +7082,53 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.update(gift_card_id, { - region_id - }) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); + medusa.admin.orderEdits.cancel(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/gift-cards/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ - --data-raw '{ - "region_id": "{region_id}" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - gift_card: - $ref: '#/components/schemas/gift_card' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /invites/accept: + '/order-edits/{id}/confirm': post: - operationId: PostInvitesInviteAccept - summary: Accept an Invite - description: Accepts an Invite and creates a corresponding user - requestBody: - content: - application/json: - schema: - required: - - token - - user - properties: - token: - description: The invite token provided by the admin. - type: string - user: - description: The User to create. - type: object - required: - - first_name - - last_name - - password - properties: - first_name: - type: string - description: the first name of the User - last_name: - type: string - description: the last name of the User - password: - description: The desired password for the User - type: string - format: password + operationId: PostOrderEditsOrderEditConfirm + summary: Confirms an OrderEdit + description: Confirms an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the order edit. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -5980,85 +7140,60 @@ paths: // must be previously logged in or use api token - medusa.admin.invites.accept({ - token, - user: { - first_name: 'Brigitte', - last_name: 'Collier', - password: 'supersecret' - } - }) - - .then(() => { - // successful - }) - - .catch(() => { - // an error occurred - }); + medusa.admin.orderEdits.confirm(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/invites/accept' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ - --data-raw '{ - "token": "{token}", - "user": { - "first_name": "Brigitte", - "last_name": "Collier", - "password": "supersecret" - } - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - OrderEdit responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /invites: + /order-edits: post: - operationId: PostInvites - summary: Create an Invite - description: Creates an Invite and triggers an 'invite' created event - x-authenticated: true + operationId: PostOrderEdits + summary: Create an OrderEdit + description: Creates an OrderEdit. requestBody: content: application/json: schema: + type: object required: - - user - - role + - order_id properties: - user: - description: The email for the user to be created. + order_id: + description: The ID of the order to create the edit for. type: string - format: email - role: - description: The role of the user to be created. + internal_note: + description: An optional note to create for the order edit. type: string - enum: - - admin - - member - - developer + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -6070,40 +7205,37 @@ paths: // must be previously logged in or use api token - medusa.admin.invites.create({ - user: "user@example.com", - role: "admin" - }) - - .then(() => { - // successful - }) - - .catch(() => { - // an error occurred - }); + medusa.admin.orderEdits.create({ order_id }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/invites' \ + 'https://medusa-url.com/admin/order-edits' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ - --data-raw '{ - "user": "user@example.com", - "role": "admin" - }' + --data-raw '{ "order_id": "my_order_id", "internal_note": + "my_optional_note" }' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - OrderEdit responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -6117,10 +7249,43 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetInvites - summary: Lists Invites - description: Lists all Invites + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -6132,34 +7297,42 @@ paths: // must be previously logged in or use api token - medusa.admin.invites.list() - - .then(({ invites }) => { - console.log(invites.length); - }); + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) - lang: Shell label: cURL source: > - curl --location --request GET 'https://medusa-url.com/admin/invites' - \ + curl --location --request GET + 'https://medusa-url.com/admin/order-edits' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - invites: + order_edits: type: array - items: - $ref: '#/components/schemas/invite' + $ref: '#/components/schemas/order_edit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -6172,17 +7345,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/invites/{invite_id}': + '/order-edits/{id}/items/{item_id}': delete: - operationId: DeleteInvitesInvite - summary: Create an Invite - description: Creates an Invite and triggers an 'invite' created event + operationId: DeleteOrderEditsOrderEditLineItemsLineItem + summary: Delete line items from an order edit and create change item + description: Delete line items from an order edit and create change item x-authenticated: true parameters: - in: path - name: invite_id + name: id required: true - description: The ID of the Invite + description: The ID of the Order Edit to delete from. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to delete from order. schema: type: string x-codeSamples: @@ -6196,41 +7375,32 @@ paths: // must be previously logged in or use api token - medusa.admin.invites.delete(invite_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); + medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/invites/{invite_id}' \ + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Invite. - object: - type: string - description: The type of the object that was deleted. - format: invite - deleted: - type: boolean - description: Whether or not the Invite was deleted. - default: true + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -6243,19 +7413,35 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/invites/{invite_id}/resend': post: - operationId: PostInvitesInviteResend - summary: Resend an Invite - description: Resends an Invite by triggering the 'invite' created event again + operationId: PostOrderEditsEditLineItemsLineItem + summary: Create or update the order edit change holding the line item changes + description: Create or update the order edit change holding the line item changes x-authenticated: true parameters: - in: path - name: invite_id + name: id required: true - description: The ID of the Invite + description: The ID of the Order Edit to update. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to update. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -6267,30 +7453,39 @@ paths: // must be previously logged in or use api token - medusa.admin.invites.resend(invite_id) - - .then(() => { - // successful - }) - - .catch(() => { - // an error occurred - }); + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, + { + quantity: 5 + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "quantity": 5 }' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - OrderEdit responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -6303,30 +7498,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /notes: - post: - operationId: PostNotes - summary: Creates a Note - description: Creates a Note which can be associated with any resource as required. + '/order-edits/{id}/changes/{change_id}': + delete: + operationId: DeleteOrderEditsOrderEditItemChange + summary: Delete an Order Edit Item Change + description: Deletes an Order Edit Item Change x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + - in: path + name: change_id + required: true + description: The ID of the Order Edit Item Change to delete. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -6338,77 +7528,126 @@ paths: // must be previously logged in or use api token - medusa.admin.notes.create({ - resource_id, - resource_type: 'order', - value: 'We delivered this order' - }) - - .then(({ note }) => { - console.log(note.id); - }); + medusa.admin.orderEdits.deleteItemChange(order_edit_id, + item_change_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: > - curl --location --request POST 'https://medusa-url.com/admin/notes' + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ - --header 'Authorization: Bearer {api_token}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Order Edit Item Change. + object: + type: string + description: The type of the object that was deleted. + format: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '/order-edits/{id}': + delete: + operationId: DeleteOrderEditsOrderEdit + summary: Delete an Order Edit + description: Deletes an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" - --header 'Content-Type: application/json' \ + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.delete(order_edit_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}' \ - --data-raw '{ - "resource_id": "{resource_id}", - "resource_type": "order", - "value": "We delivered this order" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Note + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - note: - $ref: '#/components/schemas/note' + id: + type: string + description: The ID of the deleted Order Edit. + object: + type: string + description: The type of the object that was deleted. + format: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' get: - operationId: GetNotes - summary: List Notes + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. x-authenticated: true - description: Retrieves a list of notes parameters: - - in: query - name: limit - description: The number of notes to get + - in: path + name: id + required: true + description: The ID of the OrderEdit. schema: - type: number - default: '50' + type: string - in: query - name: offset - description: The offset at which to get notes + name: expand + description: Comma separated list of relations to include in the results. schema: - type: number - default: '0' + type: string - in: query - name: resource_id - description: The ID which the notes belongs to + name: fields + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -6422,41 +7661,32 @@ paths: // must be previously logged in or use api token - medusa.admin.notes.list() - - .then(({ notes, limit, offset, count }) => { - console.log(notes.length); - }); + medusa.admin.orderEdits.retrieve(orderEditId) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/notes' \ + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Note + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - notes: - type: array - items: - $ref: '#/components/schemas/note' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -6469,19 +7699,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/notes/{id}': - delete: - operationId: DeleteNotesNote - summary: Delete a Note - description: Deletes a Note. + post: + operationId: PostOrderEditsOrderEdit + summary: Updates an OrderEdit + description: Updates a OrderEdit. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Note to delete. + description: The ID of the OrderEdit. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -6493,41 +7731,40 @@ paths: // must be previously logged in or use api token - medusa.admin.notes.delete(note_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/notes/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "internal_note": "internal reason XY" + }' security: - api_token: [] - cookie_auth: [] tags: - - Note + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Note. - object: - type: string - description: The type of the object that was deleted. - default: note - deleted: - type: boolean - description: Whether or not the Note was deleted. - default: true + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -6540,16 +7777,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetNotesNote - summary: Get a Note - description: Retrieves a single note using its id + '/order-edits/{id}/request': + post: + operationId: PostOrderEditsOrderEditRequest + summary: Request order edit confirmation + description: Request customer confirmation of an Order Edit x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the note to retrieve. + description: The ID of the Order Edit to request confirmation from. schema: type: string x-codeSamples: @@ -6563,66 +7801,56 @@ paths: // must be previously logged in or use api token - medusa.admin.notes.retrieve(note_id) - - .then(({ note }) => { - console.log(note.id); - }); + medusa.admin.orderEdits.requestConfirmation(order_edit_id) + .then({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/notes/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/request' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Note + - OrderEdit responses: '200': description: OK content: application/json: schema: + type: object properties: - note: - $ref: '#/components/schemas/note' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/orders/{id}/shipping-methods': post: - operationId: PostNotesNote - summary: Update a Note + operationId: PostOrdersOrderShippingMethods + summary: Add a Shipping Method + description: >- + Adds a Shipping Method to an Order. If another Shipping Method exists + with the same Shipping Profile, the previous Shipping Method will be + replaced. x-authenticated: true - description: Updates a Note associated with some resource parameters: - in: path name: id required: true - description: The ID of the Note to update + description: The ID of the Order. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - value - properties: - value: - type: string - description: The updated description of the Note. x-codeSamples: - lang: JavaScript label: JS Client @@ -6634,40 +7862,43 @@ paths: // must be previously logged in or use api token - medusa.admin.notes.update(note_id, { - value: 'We delivered this order' + medusa.admin.orders.addShippingMethod(order_id, { + price: 1000, + option_id }) - .then(({ note }) => { - console.log(note.id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/notes/{id}' \ + 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "value": "We delivered this order" + "price": 1000, + "option_id": "{option_id}" }' security: - api_token: [] - cookie_auth: [] tags: - - Note + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: - note: - $ref: '#/components/schemas/note' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -6680,65 +7911,42 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /notifications: - get: - operationId: GetNotifications - summary: List Notifications - description: Retrieves a list of Notifications. + requestBody: + content: + application/json: + schema: + type: object + required: + - price + - option_id + properties: + price: + type: integer + description: >- + The price (excluding VAT) that should be charged for the + Shipping Method + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + data: + type: object + description: >- + The data required for the Shipping Option to create a + Shipping Method. This will depend on the Fulfillment + Provider. + '/orders/{id}/archive': + post: + operationId: PostOrdersOrderArchive + summary: Archive Order + description: Archives the order with the given id. x-authenticated: true parameters: - - in: query - name: offset - description: >- - The number of notifications to skip before starting to collect the - notifications set - schema: - type: integer - default: 0 - - in: query - name: limit - description: The number of notifications to return - schema: - type: integer - default: 50 - - in: query - name: fields - description: Comma separated fields to include in the result set - schema: - type: string - - in: query - name: expand - description: Comma separated fields to populate - schema: - type: string - - in: query - name: event_name - description: The name of the event that the notification was sent for. - schema: - type: string - - in: query - name: resource_type - description: The type of resource that the Notification refers to. - schema: - type: string - - in: query - name: resource_id - description: The ID of the resource that the Notification refers to. - schema: - type: string - - in: query - name: to - description: >- - The address that the Notification was sent to. This will usually be - an email address, but represent other addresses such as a chat bot - user id - schema: - type: string - - in: query - name: include_resends - description: >- - A boolean indicating whether the result set should include resent - notifications or not + - in: path + name: id + required: true + description: The ID of the Order. schema: type: string x-codeSamples: @@ -6752,34 +7960,33 @@ paths: // must be previously logged in or use api token - medusa.admin.notifications.list() + medusa.admin.orders.archive(order_id) - .then(({ notifications }) => { - console.log(notifications.length); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/notifications' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/archive' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Notification + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: - notifications: - type: array - items: - $ref: '#/components/schemas/notification' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -6792,31 +7999,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/notifications/{id}/resend': + '/orders/{id}/claims/{claim_id}/cancel': post: - operationId: PostNotificationsNotificationResend - summary: Resend Notification - description: >- - Resends a previously sent notifications, with the same data but - optionally to a different address + operationId: PostOrdersClaimCancel + summary: Cancel a Claim + description: Cancels a Claim x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Notification + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - to: - description: >- - A new address or user identifier that the Notification - should be sent to - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -6828,32 +8029,34 @@ paths: // must be previously logged in or use api token - medusa.admin.notifications.resend(notification_id) + medusa.admin.orders.cancelClaim(order_id, claim_id) - .then(({ notification }) => { - console.log(notification.id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/notifications/{id}/resend' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Notification + - Claim responses: '200': description: OK content: application/json: schema: + type: object properties: - notification: - $ref: '#/components/schemas/notification' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -6866,38 +8069,31 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items': + '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': post: - operationId: PostOrderEditsEditLineItems - summary: Add an line item to an order (edit) - description: Create an OrderEdit LineItem. + operationId: PostOrdersClaimFulfillmentsCancel + summary: Cancel Claim Fulfillment + description: Registers a claim's fulfillment as canceled. + x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit. + description: The ID of the Order which the Claim relates to. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -6909,40 +8105,35 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.addLineItem(order_edit_id, { - variant_id, - quantity - }) + medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, + fulfillment_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' + \ - --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", - "quantity": 3 }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -6955,17 +8146,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/cancel': + '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': post: - operationId: PostOrderEditsOrderEditCancel - summary: Cancel an OrderEdit - description: Cancels an OrderEdit. + operationId: PostOrdersSwapFulfillmentsCancel + summary: Cancel Swap's Fulfilmment + description: Registers a Swap's Fulfillment as canceled. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the OrderEdit. + description: The ID of the Order which the Swap relates to. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. schema: type: string x-codeSamples: @@ -6979,50 +8182,64 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.cancel(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, + fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/confirm': + '/orders/{id}/fulfillments/{fulfillment_id}/cancel': post: - operationId: PostOrderEditsOrderEditConfirm - summary: Confirms an OrderEdit - description: Confirms an OrderEdit. + operationId: PostOrdersOrderFulfillmentsCancel + summary: Cancels a Fulfilmment + description: Registers a Fulfillment as canceled. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the order edit. + description: The ID of the Order which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment schema: type: string x-codeSamples: @@ -7036,58 +8253,62 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.confirm(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /order-edits: + '/orders/{id}/cancel': post: - operationId: PostOrderEdits - summary: Create an OrderEdit - description: Creates an OrderEdit. - requestBody: - content: - application/json: - schema: - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string + operationId: PostOrdersOrderCancel + summary: Cancel an Order + description: >- + Registers an Order as canceled. This triggers a flow that will cancel + any created Fulfillments and Payments, may fail if the Payment or + Fulfillment Provider is unable to cancel the Payment/Fulfillment. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7099,36 +8320,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.create({ order_id }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancel(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/orders/{id}/cancel' \ - --data-raw '{ "order_id": "my_order_id", "internal_note": - "my_optional_note" }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7141,42 +8359,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetOrderEdits - summary: List an OrderEdit - description: List a OrderEdit. + '/orders/{id}/swaps/{swap_id}/cancel': + post: + operationId: PostOrdersSwapCancel + summary: Cancels a Swap + description: Cancels a Swap x-authenticated: true parameters: - - in: query - name: q - description: Query used for searching order edit internal note. - schema: - type: string - - in: query - name: order_id - description: List order edits by order id. - schema: - type: string - - in: query - name: limit - description: The number of items in the response - schema: - type: number - default: '20' - - in: query - name: offset - description: The offset of items in response - schema: - type: number - default: '0' - - in: query - name: expand - description: Comma separated list of relations to include in the results. + - in: path + name: id + required: true + description: The ID of the Order. schema: type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + - in: path + name: swap_id + required: true + description: The ID of the Swap. schema: type: string x-codeSamples: @@ -7190,41 +8389,34 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.list() - .then(({ order_edits, count, limit, offset }) => { - console.log(order_edits.length) - }) + medusa.admin.orders.cancelSwap(order_id, swap_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Swap responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edits: - type: array - $ref: '#/components/schemas/order_edit' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7237,23 +8429,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items/{item_id}': - delete: - operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete line items from an order edit and create change item - description: Delete line items from an order edit and create change item + '/orders/{id}/capture': + post: + operationId: PostOrdersOrderCapture + summary: Capture Order's Payment + description: Captures all the Payments associated with an Order. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to delete from. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to delete from order. + description: The ID of the Order. schema: type: string x-codeSamples: @@ -7267,31 +8453,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.capturePayment(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/capture' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7304,34 +8492,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/orders/{id}/complete': post: - operationId: PostOrderEditsEditLineItemsLineItem - summary: Create or update the order edit change holding the line item changes - description: Create or update the order edit change holding the line item changes + operationId: PostOrdersOrderComplete + summary: Complete an Order + description: Completes an Order x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to update. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to update. + description: The ID of the Order. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -7343,38 +8516,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, - { - quantity: 5 - }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.complete(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/orders/{id}/complete' \ - --data-raw '{ "quantity": 5 }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7387,25 +8555,41 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/changes/{change_id}': - delete: - operationId: DeleteOrderEditsOrderEditItemChange - summary: Delete an Order Edit Item Change - description: Deletes an Order Edit Item Change + '/orders/{id}/claims/{claim_id}/shipments': + post: + operationId: PostOrdersOrderClaimsClaimShipments + summary: Create Claim Shipment + description: Registers a Claim Fulfillment as shipped. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to delete. + description: The ID of the Order. schema: type: string - in: path - name: change_id + name: claim_id required: true - description: The ID of the Order Edit Item Change to delete. + description: The ID of the Claim. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7417,57 +8601,191 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.deleteItemChange(order_edit_id, - item_change_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) + medusa.admin.orders.createClaimShipment(order_id, claim_id, { + fulfillment_id + }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Claim responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Order Edit Item Change. - object: - type: string - description: The type of the object that was deleted. - format: item_change - deleted: - type: boolean - description: Whether or not the Order Edit Item Change was deleted. - default: true + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' - '/order-edits/{id}': - delete: - operationId: DeleteOrderEditsOrderEdit - summary: Delete an Order Edit - description: Deletes an Order Edit + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order/{id}/claims': + post: + operationId: PostOrdersOrderClaims + summary: Create a Claim + description: Creates a Claim. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to delete. + description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - type + - claim_items + properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is + treated: `replace` Claims will result in a Fulfillment with + new items being created, while a `refund` Claim will refund + the amount paid for the claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: >- + Short text describing the Claim Item in further + detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: >- + A list of image URL's that will be associated with the + Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the + items are to be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: >- + The ID of the Shipping Option to create a Shipping + Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults + to the parent order's shipping address + $ref: '#/components/schemas/address' + refund_amount: + description: >- + The amount to refund the Customer when the Claim type is + `refund`. + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -7479,64 +8797,112 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.delete(order_edit_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) + medusa.admin.orders.createClaim(order_id, { + type: 'refund', + claim_items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "type": "refund", + "claim_items": [ + { + "item_id": "asdsd", + "quantity": 1 + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted Order Edit. - object: - type: string - description: The type of the object that was deleted. - format: order_edit - deleted: - type: boolean - description: Whether or not the Order Edit was deleted. - default: true + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' - get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/fulfillment': + post: + operationId: PostOrdersOrderFulfillments + summary: Create a Fulfillment + description: >- + Creates a Fulfillment of an Order - will notify Fulfillment Providers to + prepare a shipment. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the OrderEdit. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -7548,31 +8914,51 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.retrieve(orderEditId) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.createFulfillment(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7585,26 +8971,40 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/orders/{id}/shipment': post: - operationId: PostOrderEditsOrderEdit - summary: Updates an OrderEdit - description: Updates a OrderEdit. + operationId: PostOrdersOrderShipment + summary: Create a Shipment + description: Registers a Fulfillment as shipped. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the OrderEdit. + description: The ID of the Order. schema: type: string requestBody: content: application/json: schema: + type: object + required: + - fulfillment_id properties: - internal_note: - description: An optional note to create or update for the order edit. + fulfillment_id: + description: The ID of the Fulfillment. type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Shipment. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -7616,39 +9016,41 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.update(order_edit_id, { - internal_note: "internal reason XY" + medusa.admin.orders.createShipment(order_id, { + fulfillment_id }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}' \ + 'https://medusa-url.com/admin/orders/{id}/shipment' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "internal_note": "internal reason XY" + "fulfillment_id": "{fulfillment_id}" }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7661,19 +9063,46 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/request': + '/orders/{id}/swaps/{swap_id}/shipments': post: - operationId: PostOrderEditsOrderEditRequest - summary: Request order edit confirmation - description: Request customer confirmation of an Order Edit + operationId: PostOrdersOrderSwapsSwapShipments + summary: Create Swap Shipment + description: Registers a Swap Fulfillment as shipped. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to request confirmation from. + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: >- + If set to true no notification will be sent related to this + Claim. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -7685,47 +9114,61 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.requestConfirmation(order_edit_id) - .then({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.createSwapShipment(order_id, swap_id, { + fulfillment_id + }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/request' \ + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' + \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Swap responses: '200': description: OK content: application/json: schema: + type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/shipping-methods': + '/order/{id}/swaps': post: - operationId: PostOrdersOrderShippingMethods - summary: Add a Shipping Method + operationId: PostOrdersOrderSwaps + summary: Create a Swap description: >- - Adds a Shipping Method to an Order. If another Shipping Method exists - with the same Shipping Profile, the previous Shipping Method will be - replaced. + Creates a Swap. Swaps are used to handle Return of previously purchased + goods and Fulfillment of replacements simultaneously. x-authenticated: true parameters: - in: path @@ -7734,6 +9177,89 @@ paths: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - return_items + properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping + Method from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: >- + The ID of the Shipping Option to override with a + custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true x-codeSamples: - lang: JavaScript label: JS Client @@ -7745,9 +9271,13 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.addShippingMethod(order_id, { - price: 1000, - option_id + medusa.admin.orders.createSwap(order_id, { + return_items: [ + { + item_id, + quantity: 1 + } + ] }) .then(({ order }) => { @@ -7757,27 +9287,32 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ + 'https://medusa-url.com/admin/orders/{id}/swaps' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "price": 1000, - "option_id": "{option_id}" + "return_items": [ + { + "item_id": "asfasf", + "quantity": 1 + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Swap responses: '200': description: OK content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7793,36 +9328,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - price - - option_id - properties: - price: - type: integer - description: >- - The price (excluding VAT) that should be charged for the - Shipping Method - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - data: - type: object - description: >- - The data required for the Shipping Option to create a - Shipping Method. This will depend on the Fulfillment - Provider. - '/orders/{id}/archive': + '/orders/{id}/claims/{claim_id}/fulfillments': post: - operationId: PostOrdersOrderArchive - summary: Archive Order - description: Archives the order with the given id. + operationId: PostOrdersOrderClaimsClaimFulfillments + summary: Create Claim Fulfillment + description: Creates a Fulfillment for a Claim. x-authenticated: true parameters: - in: path @@ -7831,6 +9341,28 @@ paths: description: The ID of the Order. schema: type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -7842,7 +9374,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.archive(order_id) + medusa.admin.orders.fulfillClaim(order_id, claim_id) .then(({ order }) => { console.log(order.id); @@ -7851,20 +9383,22 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/archive' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Fulfillment responses: '200': description: OK content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7880,11 +9414,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/cancel': + '/orders/{id}/swaps/{swap_id}/fulfillments': post: - operationId: PostOrdersClaimCancel - summary: Cancel a Claim - description: Cancels a Claim + operationId: PostOrdersOrderSwapsSwapFulfillments + summary: Create Swap Fulfillment + description: Creates a Fulfillment for a Swap. x-authenticated: true parameters: - in: path @@ -7894,11 +9428,27 @@ paths: schema: type: string - in: path - name: claim_id + name: swap_id required: true - description: The ID of the Claim. + description: The ID of the Swap. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -7910,7 +9460,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelClaim(order_id, claim_id) + medusa.admin.orders.fulfillSwap(order_id, swap_id) .then(({ order }) => { console.log(order.id); @@ -7919,7 +9469,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ --header 'Authorization: Bearer {api_token}' @@ -7927,13 +9477,14 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Claim + - Fulfillment responses: '200': description: OK content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7949,29 +9500,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': - post: - operationId: PostOrdersClaimFulfillmentsCancel - summary: Cancel Claim Fulfillment - description: Registers a claim's fulfillment as canceled. + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order which the Claim relates to. - schema: - type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim which the Fulfillment relates to. - schema: - type: string - - in: path - name: fulfillment_id - required: true - description: The ID of the Fulfillment. + description: The ID of the Order. schema: type: string x-codeSamples: @@ -7985,8 +9524,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, - fulfillment_id) + medusa.admin.orders.retrieve(order_id) .then(({ order }) => { console.log(order.id); @@ -7994,22 +9532,22 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' - \ + curl --location --request GET + 'https://medusa-url.com/admin/orders/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8025,31 +9563,87 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': post: - operationId: PostOrdersSwapFulfillmentsCancel - summary: Cancel Swap's Fulfilmment - description: Registers a Swap's Fulfillment as canceled. + operationId: PostOrdersOrder + summary: Update an Order + description: Updates and order x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order which the Swap relates to. - schema: - type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap which the Fulfillment relates to. - schema: - type: string - - in: path - name: fulfillment_id - required: true - description: The ID of the Fulfillment. + description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: '#/components/schemas/address_fields' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/address_fields' + items: + description: The Line Items for the order + type: array + items: + $ref: '#/components/schemas/line_item' + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: '#/components/schemas/discount' + customer_id: + description: ID of the customer + type: string + payment_method: + description: payment method chosen for the order + type: object + properties: + provider_id: + type: string + description: ID of the payment provider + data: + description: Data relevant for the given payment method + type: object + shipping_method: + description: The Shipping Method used for shipping the order. + type: object + properties: + provider_id: + type: string + description: The ID of the shipping provider. + profile_id: + type: string + description: The ID of the shipping profile. + price: + type: integer + description: The price of the shipping. + data: + type: object + description: Data relevant to the specific shipping method. + items: + type: array + items: + $ref: '#/components/schemas/line_item' + description: Items to ship + no_notification: + description: >- + A flag to indicate if no notifications should be emitted + related to the updated order. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8061,8 +9655,9 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, - fulfillment_id) + medusa.admin.orders.update(order_id, { + email: 'user@example.com' + }) .then(({ order }) => { console.log(order.id); @@ -8071,21 +9666,27 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' - \ + 'https://medusa-url.com/admin/orders/adasda' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8101,89 +9702,224 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/fulfillments/{fulfillment_id}/cancel': - post: - operationId: PostOrdersOrderFulfillmentsCancel - summary: Cancels a Fulfilmment - description: Registers a Fulfillment as canceled. + /orders: + get: + operationId: GetOrders + summary: List Orders + description: Retrieves a list of Orders x-authenticated: true parameters: - - in: path + - in: query + name: q + description: >- + Query used for searching orders by shipping address first name, + orders' email, and orders' display ID + schema: + type: string + - in: query name: id - required: true - description: The ID of the Order which the Fulfillment relates to. + description: ID of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for + 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 + - fulfilled + - partially_fulfilled + - shipped + - partially_shipped + - canceled + - returned + - partially_returned + - requires_action + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + enum: + - captured + - awaiting + - not_paid + - refunded + - partially_refunded + - canceled + - requires_action + - in: query + name: display_id + description: Display ID to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: customer_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Regions to search orders by + schema: + oneOf: + - type: string + description: ID of a Region. + - type: array + items: + type: string + description: ID of a Region. + - in: query + name: currency_code + style: form + explode: false + description: Currency code to search for + 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: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting orders were created. + 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: Date comparison for when resulting orders were updated. + 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: Date comparison for when resulting orders were canceled. + 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: sales_channel_id + style: form + explode: false + description: Filter by Sales Channels schema: - type: string - - in: path - name: fulfillment_id - required: true - description: The ID of the Fulfillment + type: array + items: + type: string + description: The ID of a Sales Channel + - in: query + name: offset + description: How many orders to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of orders returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each order of + the result. schema: type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Fulfillment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/orders/{id}/cancel': - post: - operationId: PostOrdersOrderCancel - summary: Cancel an Order - description: >- - Registers an Order as canceled. This triggers a flow that will cancel - any created Fulfillments and Payments, may fail if the Payment or - Fulfillment Provider is unable to cancel the Payment/Fulfillment. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order. + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each order of + the result. schema: type: string x-codeSamples: @@ -8197,16 +9933,16 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancel(order_id) + medusa.admin.orders.list() - .then(({ order }) => { - console.log(order.id); + .then(({ orders, limit, offset, count }) => { + console.log(orders.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/cancel' \ + curl --location --request GET 'https://medusa-url.com/admin/orders' + \ --header 'Authorization: Bearer {api_token}' security: @@ -8220,9 +9956,21 @@ paths: content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + orders: + type: array + items: + $ref: '#/components/schemas/order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -8235,11 +9983,14 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/cancel': + '/orders/{id}/swaps/{swap_id}/process-payment': post: - operationId: PostOrdersSwapCancel - summary: Cancels a Swap - description: Cancels a Swap + operationId: PostOrdersOrderSwapsSwapProcessPayment + summary: Process Swap Payment + description: >- + When there are differences between the returned and shipped Products in + a Swap, the difference must be processed. Either a Refund will be issued + or a Payment will be captured. x-authenticated: true parameters: - in: path @@ -8265,7 +10016,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelSwap(order_id, swap_id) + medusa.admin.orders.processSwapPayment(order_id, swap_id) .then(({ order }) => { console.log(order.id); @@ -8274,7 +10025,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \ --header 'Authorization: Bearer {api_token}' @@ -8289,6 +10040,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8304,11 +10056,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/capture': + '/orders/{id}/refund': post: - operationId: PostOrdersOrderCapture - summary: Capture Order's Payment - description: Captures all the Payments associated with an Order. + operationId: PostOrdersOrderRefunds + summary: Create a Refund + description: Issues a Refund. x-authenticated: true parameters: - in: path @@ -8317,6 +10069,29 @@ paths: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Refund. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8328,7 +10103,10 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.capturePayment(order_id) + medusa.admin.orders.refundPayment(order_id, { + amount: 1000, + reason: 'Do not like it' + }) .then(({ order }) => { console.log(order.id); @@ -8337,71 +10115,16 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/capture' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/orders/{id}/complete': - post: - operationId: PostOrdersOrderComplete - summary: Complete an Order - description: Completes an Order - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token + 'https://medusa-url.com/admin/orders/adasda/refund' \ - medusa.admin.orders.complete(order_id) + --header 'Authorization: Bearer {api_token}' \ - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/complete' \ + --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {api_token}' + --data-raw '{ + "amount": 1000, + "reason": "Do not like it" + }' security: - api_token: [] - cookie_auth: [] @@ -8413,6 +10136,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8428,11 +10152,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/shipments': + '/orders/{id}/return': post: - operationId: PostOrdersOrderClaimsClaimShipments - summary: Create Claim Shipment - description: Registers a Claim Fulfillment as shipped. + operationId: PostOrdersOrderReturns + summary: Request a Return + description: >- + Requests a Return. If applicable a return label will be created and + other plugins notified. x-authenticated: true parameters: - in: path @@ -8441,27 +10167,65 @@ paths: description: The ID of the Order. schema: type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim. - schema: - type: string requestBody: content: application/json: schema: + type: object required: - - fulfillment_id + - items properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. + items: + description: The Line Items that will be returned. type: array items: - type: string + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: >- + The Shipping Method to be used to handle the return + shipment. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: >- + A flag to indicate if the Return should be registerd as + received immediately. + type: boolean + default: false + no_notification: + description: >- + A flag to indicate if no notifications should be emitted + related to the requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer x-codeSamples: - lang: JavaScript label: JS Client @@ -8473,8 +10237,13 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createClaimShipment(order_id, claim_id, { - fulfillment_id + medusa.admin.orders.requestReturn(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] }) .then(({ order }) => { @@ -8484,27 +10253,33 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' - \ + 'https://medusa-url.com/admin/orders/{id}/return' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "fulfillment_id": "{fulfillment_id}" + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Return + - Order responses: '200': description: OK content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8520,11 +10295,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/claims': + '/order/{id}/claims/{claim_id}': post: - operationId: PostOrdersOrderClaims - summary: Create a Claim - description: Creates a Claim. + operationId: PostOrdersOrderClaimsClaim + summary: Update a Claim + description: Updates a Claim. x-authenticated: true parameters: - in: path @@ -8533,32 +10308,30 @@ paths: description: The ID of the Order. schema: type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string requestBody: content: application/json: schema: - required: - - type - - claim_items + type: object properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. - type: string - enum: - - replace - - refund claim_items: description: The Claim Items that the Claim will consist of. type: array items: required: - - item_id - - quantity + - id + - images + - tags properties: + id: + description: The ID of the Claim Item. + type: string item_id: description: The ID of the Line Item that will be claimed. type: string @@ -8582,43 +10355,33 @@ paths: description: A list o tags to add to the Claim Item type: array items: - type: string + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value images: description: >- A list of image URL's that will be associated with the Claim + type: array items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object shipping_methods: description: The Shipping Methods to send the additional Line Items with. type: array @@ -8635,21 +10398,10 @@ paths: price: description: The price to charge for the Shipping Method type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - $ref: '#/components/schemas/address' - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer no_notification: description: >- If set to true no notification will be send related to this - Claim. + Swap. type: boolean metadata: description: >- @@ -8667,14 +10419,8 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createClaim(order_id, { - type: 'refund', - claim_items: [ - { - item_id, - quantity: 1 - } - ] + medusa.admin.orders.updateClaim(order_id, claim_id, { + no_notification: true }) .then(({ order }) => { @@ -8684,20 +10430,14 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "type": "refund", - "claim_items": [ - { - "item_id": "asdsd", - "quantity": 1 - } - ] + "no_notification": true }' security: - api_token: [] @@ -8710,6 +10450,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8725,52 +10466,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/fulfillment': - post: - operationId: PostOrdersOrderFulfillments - summary: Create a Fulfillment - description: >- - Creates a Fulfillment of an Order - will notify Fulfillment Providers to - prepare a shipment. + '/payment-collections/{id}': + delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Delete a Payment Collection + description: Deletes a Payment Collection x-authenticated: true parameters: - in: path - name: id - required: true - description: The ID of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -8782,95 +10490,67 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createFulfillment(order_id, { - items: [ - { - item_id, - quantity: 1 - } - ] - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/payment-collections/{id}' \ - --data-raw '{ - "items": [ - { - "item_id": "{item_id}", - "quantity": 1 - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/orders/{id}/shipment': - post: - operationId: PostOrdersOrderShipment - summary: Create a Shipment - description: Registers a Fulfillment as shipped. + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8882,40 +10562,32 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createShipment(order_id, { - fulfillment_id - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/shipment' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/payment-collections/{id}' \ - --data-raw '{ - "fulfillment_id": "{fulfillment_id}" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Order + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -8928,45 +10600,34 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/shipments': post: - operationId: PostOrdersOrderSwapsSwapShipments - summary: Create Swap Shipment - description: Registers a Swap Fulfillment as shipped. + operationId: PostPaymentCollectionsPaymentCollection + summary: Updates a PaymentCollection + description: Updates a PaymentCollection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap. + description: The ID of the PaymentCollection. schema: type: string requestBody: content: application/json: schema: - required: - - fulfillment_id + type: object properties: - fulfillment_id: - description: The ID of the Fulfillment. + description: + description: >- + An optional description to create or update the payment + collection. type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: + metadata: description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -8978,41 +10639,40 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createSwapShipment(order_id, swap_id, { - fulfillment_id + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" }) - - .then(({ order }) => { - console.log(order.id); - }); + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' - \ + 'https://medusa-url.com/admin/payment-collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "fulfillment_id": "{fulfillment_id}" + "description": "Description of payCol" }' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -9025,103 +10685,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/swaps': + '/payment-collections/{id}/authorize': post: - operationId: PostOrdersOrderSwaps - summary: Create a Swap - description: >- - Creates a Swap. Swaps are used to handle Return of previously purchased - goods and Fulfillment of replacements simultaneously. + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Set the status of PaymentCollection as Authorized + description: Sets the status of PaymentCollection as Authorized. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the PaymentCollection. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - return_items - properties: - return_items: - description: The Line Items to return as part of the Swap. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: The new items to send to the Customer. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a - custom price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: 'If true, swaps can be completed with items out of stock' - type: boolean - default: true x-codeSamples: - lang: JavaScript label: JS Client @@ -9131,52 +10707,34 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - - medusa.admin.orders.createSwap(order_id, { - return_items: [ - { - item_id, - quantity: 1 - } - ] - }) + // must be previously logged in or use api token - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps' \ - - --header 'Authorization: Bearer {api_token}' \ + 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ - --header 'Content-Type: application/json' \ - - --data-raw '{ - "return_items": [ - { - "item_id": "asfasf", - "quantity": 1 - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -9189,40 +10747,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/fulfillments': + '/payments/{id}/capture': post: - operationId: PostOrdersOrderClaimsClaimFulfillments - summary: Create Claim Fulfillment - description: Creates a Fulfillment for a Claim. + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim. + description: The ID of the Payment. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -9234,33 +10771,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.fulfillClaim(order_id, claim_id) + medusa.admin.payments.capturePayment(payment_id) - .then(({ order }) => { - console.log(order.id); + .then(({ payment }) => { + console.log(payment.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' - \ + 'https://medusa-url.com/admin/payments/{id}/capture' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Payment responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + payment: + $ref: '#/components/schemas/payment' '400': $ref: '#/components/responses/400_error' '401': @@ -9273,40 +10810,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/fulfillments': - post: - operationId: PostOrdersOrderSwapsSwapFulfillments - summary: Create Swap Fulfillment - description: Creates a Fulfillment for a Swap. + '/payments/{id}': + get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap. + description: The ID of the Payment. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -9318,33 +10834,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.fulfillSwap(order_id, swap_id) + medusa.admin.payments.retrieve(payment_id) - .then(({ order }) => { - console.log(order.id); + .then(({ payment }) => { + console.log(payment.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' - \ + curl --location --request GET + 'https://medusa-url.com/admin/payments/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Payment responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + payment: + $ref: '#/components/schemas/payment' '400': $ref: '#/components/responses/400_error' '401': @@ -9357,19 +10873,37 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}': - get: - operationId: GetOrdersOrder - summary: Get an Order - description: Retrieves an Order + '/payments/{id}/refund': + post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Payment. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -9381,32 +10915,45 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.retrieve(order_id) + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', + }) - .then(({ order }) => { - console.log(order.id); + .then(({ payment }) => { + console.log(payment.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/orders/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/payments/pay_123/refund' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" + }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Payment responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + refund: + $ref: '#/components/schemas/refund' '400': $ref: '#/components/responses/400_error' '401': @@ -9419,85 +10966,66 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/price-lists/{id}/prices/batch': post: - operationId: PostOrdersOrder - summary: Update an Order - description: Updates and order + operationId: PostPriceListsPriceListPricesBatch + summary: Update Prices + description: Batch update prices for a Price List x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Price List to update prices for. schema: type: string requestBody: content: application/json: schema: + type: object properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: '#/components/schemas/address_fields' - shipping_address: - description: Shipping address - anyOf: - - $ref: '#/components/schemas/address_fields' - items: - description: The Line Items for the order - type: array - items: - $ref: '#/components/schemas/line_item' - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order + prices: + description: The prices to update or add. type: array items: - $ref: '#/components/schemas/discount' - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - type: object - properties: - provider_id: - type: string - description: ID of the payment provider - data: - description: Data relevant for the given payment method - type: object - shipping_method: - description: The Shipping Method used for shipping the order. - type: object - properties: - provider_id: - type: string - description: The ID of the shipping provider. - profile_id: - type: string - description: The ID of the shipping profile. - price: - type: integer - description: The price of the shipping. - data: - type: object - description: Data relevant to the specific shipping method. - items: - type: array - items: - $ref: '#/components/schemas/line_item' - description: Items to ship - no_notification: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: description: >- - A flag to indicate if no notifications should be emitted - related to the updated order. + If true the prices will replace all existing prices + associated with the Price List. type: boolean x-codeSamples: - lang: JavaScript @@ -9510,40 +11038,53 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.update(order_id, { - email: 'user@example.com' + medusa.admin.priceLists.addPrices(price_list_id, { + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] }) - .then(({ order }) => { - console.log(order.id); + .then(({ price_list }) => { + console.log(price_list.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/adasda' \ + 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com" + "prices": [ + { + "amount": 100, + "variant_id": "afasfa", + "currency_code": "eur" + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Price List responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + price_list: + $ref: '#/components/schemas/price_list' '400': $ref: '#/components/responses/400_error' '401': @@ -9556,226 +11097,31 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /orders: - get: - operationId: GetOrders - summary: List Orders - description: Retrieves a list of Orders + delete: + operationId: DeletePriceListsPriceListPricesBatch + summary: Delete Prices + description: Batch delete prices that belong to a Price List x-authenticated: true parameters: - - in: query - name: q - description: >- - Query used for searching orders by shipping address first name, - orders' email, and orders' display ID - schema: - type: string - - in: query + - in: path name: id - description: ID of the order to search for. - schema: - type: string - - in: query - name: status - style: form - explode: false - description: Status to search for - 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 - - fulfilled - - partially_fulfilled - - shipped - - partially_shipped - - canceled - - returned - - partially_returned - - requires_action - - in: query - name: payment_status - style: form - explode: false - description: Payment status to search for. - schema: - type: array - items: - type: string - enum: - - captured - - awaiting - - not_paid - - refunded - - partially_refunded - - canceled - - requires_action - - in: query - name: display_id - description: Display ID to search for. - schema: - type: string - - in: query - name: cart_id - description: to search for. - schema: - type: string - - in: query - name: customer_id - description: to search for. - schema: - type: string - - in: query - name: email - description: to search for. - schema: - type: string - - in: query - name: region_id - style: form - explode: false - description: Regions to search orders by - schema: - oneOf: - - type: string - description: ID of a Region. - - type: array - items: - type: string - description: ID of a Region. - - in: query - name: currency_code - style: form - explode: false - description: Currency code to search for - 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: to search for. - schema: - type: string - - in: query - name: created_at - description: Date comparison for when resulting orders were created. - 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: Date comparison for when resulting orders were updated. - 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: Date comparison for when resulting orders were canceled. - 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: sales_channel_id - style: form - explode: false - description: Filter by Sales Channels - schema: - type: array - items: - type: string - description: The ID of a Sales Channel - - in: query - name: offset - description: How many orders to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of orders returned. - schema: - type: integer - default: 50 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. - schema: - type: string - - in: query - name: fields + required: true description: >- - (Comma separated) Which fields should be included in each order of - the result. + The ID of the Price List that the Money Amounts (Prices) that will + be deleted belongs to. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -9787,43 +11133,56 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.list() + medusa.admin.priceLists.deletePrices(price_list_id, { + price_ids: [ + price_id + ] + }) - .then(({ orders, limit, offset, count }) => { - console.log(orders.length); + .then(({ ids, object, deleted }) => { + console.log(ids.length); }); - lang: Shell label: cURL source: > - curl --location --request GET 'https://medusa-url.com/admin/orders' - \ + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "price_ids": [ + "adasfa" + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Price List responses: '200': description: OK content: application/json: schema: + type: object properties: - orders: + ids: type: array items: - $ref: '#/components/schemas/order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + type: string + description: The IDs of the deleted Money Amounts (Prices). + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -9836,66 +11195,164 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/process-payment': + /price-lists: post: - operationId: PostOrdersOrderSwapsSwapProcessPayment - summary: Process Swap Payment - description: >- - When there are differences between the returned and shipped Products in - a Swap, the difference must be processed. Either a Refund will be issued - or a Payment will be captured. + operationId: PostPriceListsPriceList + summary: Create a Price List + description: Creates a Price List x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap. - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: >- + The date with timezone that the Price List starts being + valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" + import { PriceListType } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.processSwapPayment(order_id, swap_id) + medusa.admin.priceLists.create({ + name: 'New Price List', + description: 'A new price list', + type: PriceListType.SALE, + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) - .then(({ order }) => { - console.log(order.id); + .then(({ price_list }) => { + console.log(price_list.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' - \ + 'https://medusa-url.com/admin/price-lists' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Price List", + "description": "A new price list", + "type": "sale", + "prices": [ + { + "amount": 1000, + "variant_id": "afafa", + "currency_code": "eur" + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Price List responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + price_list: + $ref: '#/components/schemas/price_list' '400': $ref: '#/components/responses/400_error' '401': @@ -9908,41 +11365,152 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/refund': - post: - operationId: PostOrdersOrderRefunds - summary: Create a Refund - description: Issues a Refund. + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. x-authenticated: true parameters: - - in: path + - in: query + name: limit + description: The number of items to get + schema: + type: number + default: '10' + - in: query + name: offset + description: The offset at which to get items + schema: + type: number + default: '0' + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: order + description: field to order results by. + schema: + type: string + - in: query name: id - required: true - description: The ID of the Order. + description: ID to search for. + schema: + type: string + - in: query + name: q + description: >- + query to search in price list description, price list name, and + customer group name fields. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + enum: + - active + - draft + - in: query + name: name + description: price list name to search for. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + - in: query + name: customer_groups + style: form + explode: false + description: Customer Group IDs to search for. + schema: + type: array + items: + type: string + - in: query + name: type + style: form + explode: false + description: Type to search for. + schema: + type: array + items: + type: string + enum: + - sale + - override + - in: query + name: created_at + description: Date comparison for when resulting price lists were created. + 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: Date comparison for when resulting price lists were updated. + 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: deleted_at + description: Date comparison for when resulting price lists were deleted. + 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 @@ -9954,42 +11522,44 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.refundPayment(order_id, { - amount: 1000, - reason: 'Do not like it' - }) + medusa.admin.priceLists.list() - .then(({ order }) => { - console.log(order.id); + .then(({ price_lists, limit, offset, count }) => { + console.log(price_lists.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/adasda/refund' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/price-lists' \ - --data-raw '{ - "amount": 1000, - "reason": "Do not like it" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Price List responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + price_lists: + type: array + items: + $ref: '#/components/schemas/price_list' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -10002,79 +11572,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/return': - post: - operationId: PostOrdersOrderReturns - summary: Request a Return - description: >- - Requests a Return. If applicable a return label will be created and - other plugins notified. + '/price-lists/{id}': + delete: + operationId: DeletePriceListsPriceList + summary: Delete a Price List + description: Deletes a Price List x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Price List to delete. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - type: string - receive_now: - description: >- - A flag to indicate if the Return should be registerd as - received immediately. - type: boolean - default: false - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the requested Return. - type: boolean - refund: - description: The amount to refund. - type: integer x-codeSamples: - lang: JavaScript label: JS Client @@ -10086,51 +11596,42 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.requestReturn(order_id, { - items: [ - { - item_id, - quantity: 1 - } - ] - }) + medusa.admin.priceLists.delete(price_list_id) - .then(({ order }) => { - console.log(order.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/return' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "items": [ - { - "item_id": "{item_id}", - "quantity": 1 - } - ] - }' + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return - - Order + - Price List responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + id: + type: string + description: The ID of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + default: price-list + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -10143,118 +11644,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/claims/{claim_id}': - post: - operationId: PostOrdersOrderClaimsClaim - summary: Update a Claim - description: Updates a Claim. + get: + operationId: GetPriceListsPriceList + summary: Get a Price List + description: Retrieves a Price List. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim. + description: The ID of the Price List. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -10266,40 +11667,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.updateClaim(order_id, claim_id, { - no_notification: true - }) + medusa.admin.priceLists.retrieve(price_list_id) - .then(({ order }) => { - console.log(order.id); + .then(({ price_list }) => { + console.log(price_list.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/price-lists/{id}' \ - --data-raw '{ - "no_notification": true - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Price List responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + price_list: + $ref: '#/components/schemas/price_list' '400': $ref: '#/components/responses/400_error' '401': @@ -10312,26 +11706,54 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/prices/batch': post: - operationId: PostPriceListsPriceListPricesBatch - summary: Update Prices - description: Batch update prices for a Price List + operationId: PostPriceListsPriceListPriceList + summary: Update a Price List + description: Updates a Price List x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Price List to update prices for. + description: The ID of the Price List. schema: type: string requestBody: content: application/json: schema: + type: object properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: >- + The date with timezone that the Price List starts being + valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft prices: - description: The prices to update or add. + description: The prices of the Price List. type: array items: required: @@ -10367,10 +11789,18 @@ paths: max_quantity: description: The maximum quantity for which the price will be used. type: integer - override: - description: >- - If true the prices will replace all existing prices - associated with the Price List. + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' type: boolean x-codeSamples: - lang: JavaScript @@ -10383,38 +11813,99 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.addPrices(price_list_id, { - prices: [ - { - amount: 1000, - variant_id, - currency_code: 'eur' - } - ] - }) + medusa.admin.priceLists.update(price_list_id, { + name: 'New Price List' + }) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Price List" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + price_list: + $ref: '#/components/schemas/price_list' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/products/{product_id}/prices': + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete Product's Prices + description: Delete all the prices related to a specific product in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The ID of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: product_id + required: true + description: The ID of the product from which the money amount will be deleted. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.deleteProductPrices(price_list_id, + product_id) - .then(({ price_list }) => { - console.log(price_list.id); + .then(({ ids, object, deleted }) => { + console.log(ids.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' + \ - --data-raw '{ - "prices": [ - { - "amount": 100, - "variant_id": "afasfa", - "currency_code": "eur" - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -10426,9 +11917,21 @@ paths: content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -10441,30 +11944,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/price-lists/{id}/variants/{variant_id}/prices': delete: - operationId: DeletePriceListsPriceListPricesBatch - summary: Delete Prices - description: Batch delete prices that belong to a Price List + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete Variant's Prices + description: Delete all the prices related to a specific variant in a price list x-authenticated: true parameters: - in: path name: id required: true description: >- - The ID of the Price List that the Money Amounts (Prices) that will - be deleted belongs to. + The ID of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the variant from which the money amount will be deleted. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -10476,30 +11976,20 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.deletePrices(price_list_id, { - price_ids: [ - price_id - ] - }) + medusa.admin.priceLists.deleteVariantPrices(price_list_id, + variant_id) .then(({ ids, object, deleted }) => { - console.log(ids.length); + console.log(ids); }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' + \ - --data-raw '{ - "price_ids": [ - "adasfa" - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -10511,12 +12001,13 @@ paths: content: application/json: schema: + type: object properties: ids: type: array + description: The price ids that have been deleted. items: type: string - description: The IDs of the deleted Money Amounts (Prices). object: type: string description: The type of the object that was deleted. @@ -10537,162 +12028,234 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /price-lists: - post: - operationId: PostPriceListsPriceList - summary: Create a Price List - description: Creates a Price List + '/price-lists/{id}/products': + get: + operationId: GetPriceListsPriceListProducts + summary: List Products + description: Retrieves a list of Product that are part of a Price List x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + parameters: + - in: path + name: id + required: true + description: ID of the price list. + schema: + type: string + - in: query + name: q + description: >- + Query used for searching product title and description, variant + title and sku, and collection title. + schema: + type: string + - in: query + name: id + description: ID of the product to search for. + schema: + type: string + - in: query + name: status + description: Product status to search for + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + description: Collection IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: tags + description: Tag IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: title + description: product title to search for. + schema: + type: string + - in: query + name: description + description: product description to search for. + schema: + type: string + - in: query + name: handle + description: product handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: string + - in: query + name: type + description: to search for. + schema: + type: string + - in: query + name: order + description: field to sort results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting products were created. + 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: Date comparison for when resulting products were updated. + 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: deleted_at + description: Date comparison for when resulting products were deleted. + 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: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" - import { PriceListType } from "@medusajs/medusa" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.create({ - name: 'New Price List', - description: 'A new price list', - type: PriceListType.SALE, - prices: [ - { - amount: 1000, - variant_id, - currency_code: 'eur' - } - ] - }) + medusa.admin.priceLists.listProducts(price_list_id) - .then(({ price_list }) => { - console.log(price_list.id); + .then(({ products, limit, offset, count }) => { + console.log(products.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/price-lists' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/price-lists/{id}/products' \ - --data-raw '{ - "name": "New Price List", - "description": "A new price list", - "type": "sale", - "prices": [ - { - "amount": 1000, - "variant_id": "afafa", - "currency_code": "eur" - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + products: + type: array + items: + $ref: '#/components/schemas/product' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -10705,89 +12268,61 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /product-tags: get: - operationId: GetPriceLists - summary: List Price Lists - description: Retrieves a list of Price Lists. + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. x-authenticated: true parameters: - in: query name: limit - description: The number of items to get + description: The number of tags to return. schema: - type: number - default: '10' + type: integer + default: 10 - in: query name: offset - description: The offset at which to get items - schema: - type: number - default: '0' - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. - schema: - type: string - - in: query - name: order - description: field to order results by. - schema: - type: string - - in: query - name: id - description: ID to search for. - schema: - type: string - - in: query - name: q - description: >- - query to search in price list description, price list name, and - customer group name fields. - schema: - type: string - - in: query - name: status - style: form - explode: false - description: Status to search for. + description: The number of items to skip before the results. schema: - type: array - items: - type: string - enum: - - active - - draft + type: integer + default: 0 - in: query - name: name - description: price list name to search for. + name: order + description: The field to sort items by. schema: type: string - in: query - name: customer_groups + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string + - in: query + name: value style: form explode: false - description: Customer Group IDs to search for. + description: The tag values to search for schema: type: array items: type: string - in: query - name: type + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: id style: form explode: false - description: Type to search for. + description: The tag IDs to search for schema: type: array items: type: string - enum: - - sale - - override - in: query name: created_at - description: Date comparison for when resulting price lists were created. + description: Date comparison for when resulting product tags were created. schema: type: object properties: @@ -10809,29 +12344,7 @@ paths: format: date - in: query name: updated_at - description: Date comparison for when resulting price lists were updated. - 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: deleted_at - description: Date comparison for when resulting price lists were deleted. + description: Date comparison for when resulting product tags were updated. schema: type: object properties: @@ -10862,34 +12375,33 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.list() + medusa.admin.productTags.list() - .then(({ price_lists, limit, offset, count }) => { - console.log(price_lists.length); + .then(({ product_tags }) => { + console.log(product_tags.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/price-lists' \ + 'https://medusa-url.com/admin/product-tags' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Product Tag responses: '200': description: OK content: application/json: schema: + type: object properties: - price_lists: - type: array - items: - $ref: '#/components/schemas/price_list' + product_tags: + $ref: '#/components/schemas/product_tag' count: type: integer description: The total number of items available @@ -10911,19 +12423,102 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}': - delete: - operationId: DeletePriceListsPriceList - summary: Delete a Price List - description: Deletes a Price List + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. x-authenticated: true parameters: - - in: path + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query name: id - required: true - description: The ID of the Price List to delete. + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for schema: type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + 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: Date comparison for when resulting product types were updated. + 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 @@ -10935,41 +12530,42 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.delete(price_list_id) + medusa.admin.productTypes.list() - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ product_types }) => { + console.log(product_types.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}' \ + curl --location --request GET + 'https://medusa-url.com/admin/product-types' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Product Type responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Price List. - object: - type: string - description: The type of the object that was deleted. - default: price-list - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + product_types: + $ref: '#/components/schemas/product_type' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -10982,18 +12578,32 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetPriceListsPriceList - summary: Get a Price List - description: Retrieves a Price List. + '/products/{id}/options': + post: + operationId: PostProductsProductOptions + summary: Add an Option x-authenticated: true + description: Adds a Product Option to a Product parameters: - in: path name: id required: true - description: The ID of the Price List. + description: The ID of the Product. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: >- + The title the Product Option will be identified by i.e. + "Size" + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -11005,32 +12615,41 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.retrieve(price_list_id) + medusa.admin.products.addOption(product_id, { + title: 'Size' + }) - .then(({ price_list }) => { - console.log(price_list.id); + .then(({ product }) => { + console.log(product.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/price-lists/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/options' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Size" + }' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -11043,101 +12662,254 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /products: post: - operationId: PostPriceListsPriceListPriceList - summary: Update a Price List - description: Updates a Price List + operationId: PostProducts + summary: Create a Product x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Price List. - schema: - type: string + description: Creates a Product requestBody: content: application/json: schema: + type: object + required: + - title properties: - name: - description: The name of the Price List + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product type: string description: - description: A description of the Price List. + description: A description of the Product. type: string - starts_at: + is_giftcard: description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. + A flag to indicate if the Product represents a Gift Card. + Purchasing Products with this flag set to `true` will result + in a Gift Card being created. + type: boolean + default: false + discountable: + description: >- + A flag to indicate if discounts can be applied to the + LineItems generated from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. type: string - format: date - type: - description: The type of the Price List. + handle: + description: A unique handle to identify the Product by. type: string - enum: - - sale - - override status: - description: The status of the Price List. + description: The status of the product. type: string enum: - - active - draft - prices: - description: The prices of the Price List. + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. type: array items: required: - - amount - - variant_id + - value properties: id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. + description: The ID of an existing Tag. type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. + value: + description: 'The value of the Tag, these will be upserted.' type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array - description: A list of customer groups that the Price List applies to. items: required: - id properties: id: - description: The ID of a customer group + description: The ID of an existing Sales channel. type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + options: + description: >- + The Options that the Product should have. These define on + which properties the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out + of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for + this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: >- + The Manufacturer Identification code for the Product + Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is + used. Only required if currency_code is not + provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the + price will be used. Only required if region_id + is not provided. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: >- + The minimum quantity for which the price will be + used. + type: integer + max_quantity: + description: >- + The maximum quantity for which the price will be + used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the + same index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -11149,40 +12921,43 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.update(price_list_id, { - name: 'New Price List' + medusa.admin.products.create({ + title: 'Shirt', + is_giftcard: false, + discountable: true }) - .then(({ price_list }) => { - console.log(price_list.id); + .then(({ product }) => { + console.log(product.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/price-lists/{id}' \ + 'https://medusa-url.com/admin/products' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "New Price List" + "title": "Shirt" }' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -11195,259 +12970,116 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/products/{product_id}/prices': - delete: - operationId: DeletePriceListsPriceListProductsProductPrices - summary: Delete Product's Prices - description: Delete all the prices related to a specific product in a price list + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Product x-authenticated: true parameters: - - in: path - name: id - required: true + - in: query + name: q description: >- - The ID of the Price List that the Money Amounts that will be deleted - belongs to. + Query used for searching product title and description, variant + title and sku, and collection title. schema: type: string - - in: path - name: product_id - required: true - description: The ID of the product from which the money amount will be deleted. + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. schema: type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.priceLists.deleteProductPrices(price_list_id, - product_id) - - .then(({ ids, object, deleted }) => { - console.log(ids.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Price List - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - ids: - type: array - description: The price ids that have been deleted. - items: - type: string - object: - type: string - description: The type of the object that was deleted. - default: money-amount - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/price-lists/{id}/variants/{variant_id}/prices': - delete: - operationId: DeletePriceListsPriceListVariantsVariantPrices - summary: Delete Variant's Prices - description: Delete all the prices related to a specific variant in a price list - x-authenticated: true - parameters: - - in: path + - in: query name: id - required: true - description: >- - The ID of the Price List that the Money Amounts that will be deleted - belongs to. - schema: - type: string - - in: path - name: variant_id - required: true - description: The ID of the variant from which the money amount will be deleted. + style: form + explode: false + description: Filter by product IDs. schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.priceLists.deleteVariantPrices(price_list_id, - variant_id) - - .then(({ ids, object, deleted }) => { - console.log(ids); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Price List - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - ids: - type: array - description: The price ids that have been deleted. - items: - type: string - object: - type: string - description: The type of the object that was deleted. - default: money-amount - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/price-lists/{id}/products': - get: - operationId: GetPriceListsPriceListProducts - summary: List Products - description: Retrieves a list of Product that are part of a Price List - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: ID of the price list. + oneOf: + - type: string + description: ID of the product to search for. + - type: array + items: + type: string + description: ID of a product. + - in: query + name: status + style: form + explode: false + description: Status to search for schema: - type: string + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected - in: query - name: q - description: >- - Query used for searching product title and description, variant - title and sku, and collection title. + name: collection_id + style: form + explode: false + description: Collection ids to search for. schema: - type: string + type: array + items: + type: string - in: query - name: id - description: ID of the product to search for. + name: tags + style: form + explode: false + description: Tag IDs to search for schema: - type: string + type: array + items: + type: string - in: query - name: status - description: Product status to search for + name: price_list_id style: form explode: false + description: Price List IDs to search for schema: type: array items: type: string - enum: - - draft - - proposed - - published - - rejected - in: query - name: collection_id - description: Collection IDs to search for + name: sales_channel_id style: form explode: false + description: Sales Channel IDs to filter products by schema: type: array items: type: string - in: query - name: tags - description: Tag IDs to search for + name: type_id style: form explode: false + description: Type IDs to filter products by schema: type: array items: type: string - in: query name: title - description: product title to search for. + description: title to search for. schema: type: string - in: query name: description - description: product description to search for. + description: description to search for. schema: type: string - in: query name: handle - description: product handle to search for. + description: handle to search for. schema: type: string - in: query name: is_giftcard description: Search for giftcards using is_giftcard=true. schema: - type: string - - in: query - name: type - description: to search for. - schema: - type: string - - in: query - name: order - description: field to sort results by. - schema: - type: string + type: boolean - in: query name: created_at description: Date comparison for when resulting products were created. @@ -11551,7 +13183,7 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.listProducts(price_list_id) + medusa.admin.products.list() .then(({ products, limit, offset, count }) => { console.log(products.length); @@ -11560,7 +13192,7 @@ paths: label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/price-lists/{id}/products' \ + 'https://medusa-url.com/admin/products' \ --header 'Authorization: Bearer {api_token}' security: @@ -11574,6 +13206,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -11600,102 +13233,136 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /product-tags: - get: - operationId: GetProductTags - summary: List Product Tags - description: Retrieve a list of Product Tags. + '/products/{id}/variants': + post: + operationId: PostProductsProductVariants + summary: Create a Product Variant + description: >- + Creates a Product Variant. Each Product Variant must have a unique + combination of Product Option Values. x-authenticated: true parameters: - - in: query - name: limit - description: The number of tags to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: order - description: The field to sort items by. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the tags. - schema: - type: string - - in: query - name: value - style: form - explode: false - description: The tag values to search for - schema: - type: array - items: - type: string - - in: query - name: q - description: A query string to search values for - schema: - type: string - - in: query + - in: path name: id - style: form - explode: false - description: The tag IDs to search for - schema: - type: array - items: - type: string - - in: query - name: created_at - description: Date comparison for when resulting product tags were created. - 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: Date comparison for when resulting product tags were updated. + required: true + description: The ID of the Product. 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 + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: >- + The Manufacturer Identification code for the Product + Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -11707,41 +13374,66 @@ paths: // must be previously logged in or use api token - medusa.admin.productTags.list() + medusa.admin.products.createVariant(product_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) - .then(({ product_tags }) => { - console.log(product_tags.length); + .then(({ product }) => { + console.log(product.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/product-tags' \ + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/variants' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ], + "options": [ + { + "option_id": "asdasf", + "value": "S" + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Product Tag + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - product_tags: - $ref: '#/components/schemas/product_tag' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -11754,139 +13446,65 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /product-types: get: - operationId: GetProductTypes - summary: List Product Types - description: Retrieve a list of Product Types. + operationId: GetProductsProductVariants + summary: List a Product's Variants + description: Retrieves a list of the Product Variants associated with a Product. x-authenticated: true parameters: - - in: query - name: limit - description: The number of types to return. - schema: - type: integer - default: 20 - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: order - description: The field to sort items by. + - in: path + name: id + required: true + description: ID of the product to search for the variants. schema: type: string - in: query - name: discount_condition_id - description: The discount condition id on which to filter the product types. + name: fields + description: Comma separated string of the column to select. schema: type: string - in: query - name: value - style: form - explode: false - description: The type values to search for - schema: - type: array - items: - type: string - - in: query - name: id - style: form - explode: false - description: The type IDs to search for - schema: - type: array - items: - type: string - - in: query - name: q - description: A query string to search values for + name: expand + description: Comma separated string of the relations to include. schema: type: string - in: query - name: created_at - description: Date comparison for when resulting product types were created. + name: offset + description: How many items to skip before the results. 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 + type: integer + default: 0 - in: query - name: updated_at - description: Date comparison for when resulting product types were updated. + name: limit + description: Limit the number of items returned. 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 + type: integer + default: 100 x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.productTypes.list() - - .then(({ product_types }) => { - console.log(product_types.length); - }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/product-types' \ + 'https://medusa-url.com/admin/products/{id}/variants' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product Type + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - product_types: - $ref: '#/components/schemas/product_type' + variants: + type: array + items: + $ref: '#/components/schemas/product_variant' count: type: integer description: The total number of items available @@ -11908,12 +13526,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/options': - post: - operationId: PostProductsProductOptions - summary: Add an Option + '/products/{id}/options/{option_id}': + delete: + operationId: DeleteProductsProductOptionsOption + summary: Delete a Product Option + description: >- + Deletes a Product Option. Before a Product Option can be deleted all + Option Values for the Product Option must be the same. You may, for + example, have to delete some of your variants prior to deleting the + Product Option x-authenticated: true - description: Adds a Product Option to a Product parameters: - in: path name: id @@ -11921,18 +13543,12 @@ paths: description: The ID of the Product. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - title - properties: - title: - description: >- - The title the Product Option will be identified by i.e. - "Size" - type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -11944,26 +13560,18 @@ paths: // must be previously logged in or use api token - medusa.admin.products.addOption(product_id, { - title: 'Size' - }) + medusa.admin.products.deleteOption(product_id, option_id) - .then(({ product }) => { + .then(({ option_id, object, delete, product }) => { console.log(product.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/options' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ - --data-raw '{ - "title": "Size" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -11975,7 +13583,19 @@ paths: content: application/json: schema: + type: object properties: + option_id: + type: string + description: The ID of the deleted Product Option + object: + type: string + description: The type of the object that was deleted. + default: option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true product: $ref: '#/components/schemas/product' '400': @@ -11990,253 +13610,35 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /products: post: - operationId: PostProducts - summary: Create a Product + operationId: PostProductsProductOptionsOption + summary: Update a Product Option + description: Updates a Product Option x-authenticated: true - description: Creates a Product + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string requestBody: content: application/json: schema: + type: object required: - title properties: title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result - in a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on - which properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + description: The title of the Product Option + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -12248,10 +13650,8 @@ paths: // must be previously logged in or use api token - medusa.admin.products.create({ - title: 'Shirt', - is_giftcard: false, - discountable: true + medusa.admin.products.updateOption(product_id, option_id, { + title: 'Size' }) .then(({ product }) => { @@ -12261,14 +13661,14 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products' \ + 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "Shirt" + "title": "Size" }' security: - api_token: [] @@ -12281,6 +13681,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12296,206 +13697,88 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetProducts - summary: List Products - description: Retrieves a list of Product + '/products/{id}': + delete: + operationId: DeleteProductsProduct + summary: Delete a Product + description: Deletes a Product and it's associated Product Variants. x-authenticated: true parameters: - - in: query - name: q - description: >- - Query used for searching product title and description, variant - title and sku, and collection title. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the product. - schema: - type: string - - in: query + - in: path name: id - style: form - explode: false - description: Filter by product IDs. - schema: - oneOf: - - type: string - description: ID of the product to search for. - - type: array - items: - type: string - description: ID of a product. - - in: query - name: status - style: form - explode: false - description: Status to search for - schema: - type: array - items: - type: string - enum: - - draft - - proposed - - published - - rejected - - in: query - name: collection_id - style: form - explode: false - description: Collection ids to search for. - schema: - type: array - items: - type: string - - in: query - name: tags - style: form - explode: false - description: Tag IDs to search for - schema: - type: array - items: - type: string - - in: query - name: price_list_id - style: form - explode: false - description: Price List IDs to search for - schema: - type: array - items: - type: string - - in: query - name: sales_channel_id - style: form - explode: false - description: Sales Channel IDs to filter products by - schema: - type: array - items: - type: string - - in: query - name: type_id - style: form - explode: false - description: Type IDs to filter products by - schema: - type: array - items: - type: string - - in: query - name: title - description: title to search for. - schema: - type: string - - in: query - name: description - description: description to search for. - schema: - type: string - - in: query - name: handle - description: handle to search for. - schema: - type: string - - in: query - name: is_giftcard - description: Search for giftcards using is_giftcard=true. - schema: - type: boolean - - in: query - name: created_at - description: Date comparison for when resulting products were created. - 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: Date comparison for when resulting products were updated. - 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: deleted_at - description: Date comparison for when resulting products were deleted. - 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: offset - description: How many products to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: integer - default: 50 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. + required: true + description: The ID of the Product. schema: type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.delete(product_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/products/asfsaf' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Product. + object: + type: string + description: The type of the object that was deleted. + default: product + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. schema: type: string x-codeSamples: @@ -12509,16 +13792,16 @@ paths: // must be previously logged in or use api token - medusa.admin.products.list() + medusa.admin.products.retrieve(product_id) - .then(({ products, limit, offset, count }) => { - console.log(products.length); + .then(({ product }) => { + console.log(product.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/products' \ + 'https://medusa-url.com/admin/products/{id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -12532,20 +13815,10 @@ paths: content: application/json: schema: + type: object properties: - products: - type: array - items: - $ref: '#/components/schemas/product' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -12558,13 +13831,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/variants': post: - operationId: PostProductsProductVariants - summary: Create a Product Variant - description: >- - Creates a Product Variant. Each Product Variant must have a unique - combination of Product Option Values. + operationId: PostProductsProduct + summary: Update a Product + description: Updates a Product x-authenticated: true parameters: - in: path @@ -12577,116 +13847,225 @@ paths: content: application/json: schema: - required: - - title - - prices - - options + type: object properties: title: - description: The title to identify the Product Variant by. + description: The title of the Product type: string - sku: - description: The unique SKU for the Product Variant. + subtitle: + description: The subtitle of the Product type: string - ean: - description: The EAN number of the item. + description: + description: A description of the Product. type: string - upc: - description: The UPC number of the item. + discountable: + description: >- + A flag to indicate if discounts can be applied to the + LineItems generated from this Product + type: boolean + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. type: string - barcode: - description: A generic GTIN field for the Product Variant. + handle: + description: A unique handle to identify the Product by. type: string - hs_code: - description: The Harmonized System code for the Product Variant. + status: + description: The status of the product. type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean + enum: + - draft + - proposed + - published + - rejected + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out + of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for + this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: >- + The Manufacturer Identification code for the Product + Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is + used. Only required if currency_code is not + provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the + price will be used. Only required if region_id + is not provided. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: >- + The minimum quantity for which the price will be + used. + type: integer + max_quantity: + description: >- + The maximum quantity for which the price will be + used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the + same index in the Product's `options` field. + type: string weight: - description: The wieght of the Product Variant. + description: The wieght of the Product. type: number length: - description: The length of the Product Variant. + description: The length of the Product. type: number height: - description: The height of the Product Variant. + description: The height of the Product. type: number width: - description: The width of the Product Variant. + description: The width of the Product. type: number origin_country: - description: The country of origin of the Product Variant. + description: The country of origin of the Product. type: string mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. + description: The Manufacturer Identification code for the Product. type: string material: - description: The material composition of the Product Variant. + description: The material composition of the Product. type: string metadata: description: >- An optional set of key-value pairs with additional information. type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -12698,21 +14077,9 @@ paths: // must be previously logged in or use api token - medusa.admin.products.createVariant(product_id, { - title: 'Color', - prices: [ - { - amount: 1000, - currency_code: "eur" - } - ], - options: [ - { - option_id, - value: 'S' - } - ], - inventory_quantity: 100 + medusa.admin.products.update(product_id, { + title: 'Shirt', + images: [] }) .then(({ product }) => { @@ -12722,26 +14089,14 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/variants' \ + 'https://medusa-url.com/admin/products/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "Color", - "prices": [ - { - "amount": 1000, - "currency_code": "eur" - } - ], - "options": [ - { - "option_id": "asdasf", - "value": "S" - } - ] + "title": "Size" }' security: - api_token: [] @@ -12754,6 +14109,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12769,46 +14125,46 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetProductsProductVariants - summary: List a Product's Variants - description: Retrieves a list of the Product Variants associated with a Product. + '/products/{id}/variants/{variant_id}': + delete: + operationId: DeleteProductsProductVariantsVariant + summary: Delete a Product Variant + description: Deletes a Product Variant. x-authenticated: true parameters: - in: path name: id required: true - description: ID of the product to search for the variants. - schema: - type: string - - in: query - name: fields - description: Comma separated string of the column to select. + description: The ID of the Product. schema: type: string - - in: query - name: expand - description: Comma separated string of the relations to include. + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. schema: type: string - - in: query - name: offset - description: How many items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of items returned. - schema: - type: integer - default: 100 x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.deleteVariant(product_id, variant_id) + + .then(({ variant_id, object, deleted, product }) => { + console.log(product.id); + }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/{id}/variants' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -12822,20 +14178,21 @@ paths: content: application/json: schema: + type: object properties: - variants: - type: array - items: - $ref: '#/components/schemas/product_variant' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + variant_id: + type: string + description: The ID of the deleted Product Variant. + object: + type: string + description: The type of the object that was deleted. + default: variant + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -12848,15 +14205,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/options/{option_id}': - delete: - operationId: DeleteProductsProductOptionsOption - summary: Delete a Product Option - description: >- - Deletes a Product Option. Before a Product Option can be deleted all - Option Values for the Product Option must be the same. You may, for - example, have to delete some of your variants prior to deleting the - Product Option + post: + operationId: PostProductsProductVariantsVariant + summary: Update a Product Variant + description: Update a Product Variant. x-authenticated: true parameters: - in: path @@ -12866,11 +14218,123 @@ paths: schema: type: string - in: path - name: option_id + name: variant_id required: true - description: The ID of the Product Option. + description: The ID of the Product Variant. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - prices + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: >- + The Manufacturer Identification code for the Product + Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -12882,18 +14346,45 @@ paths: // must be previously logged in or use api token - medusa.admin.products.deleteOption(product_id, option_id) + medusa.admin.products.updateVariant(product_id, variant_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) - .then(({ option_id, object, delete, product }) => { + .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ] + }' security: - api_token: [] - cookie_auth: [] @@ -12905,18 +14396,8 @@ paths: content: application/json: schema: + type: object properties: - option_id: - type: string - description: The ID of the deleted Product Option - object: - type: string - description: The type of the object that was deleted. - default: option - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true product: $ref: '#/components/schemas/product' '400': @@ -12931,34 +14412,12 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostProductsProductOptionsOption - summary: Update a Product Option - description: Updates a Product Option + /products/tag-usage: + get: + operationId: GetProductsTagUsage + summary: List Tags Usage Number + description: Retrieves a list of Product Tags with how many times each is used. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: option_id - required: true - description: The ID of the Product Option. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - title - properties: - title: - description: The title of the Product Option - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -12970,40 +14429,44 @@ paths: // must be previously logged in or use api token - medusa.admin.products.updateOption(product_id, option_id, { - title: 'Size' - }) + medusa.admin.products.listTags() - .then(({ product }) => { - console.log(product.id); + .then(({ tags }) => { + console.log(tags.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/products/tag-usage' \ - --data-raw '{ - "title": "Size" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product + - Product Tag responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + tags: + type: array + items: + properties: + id: + description: The ID of the tag. + type: string + usage_count: + description: The number of products that use this tag. + type: string + value: + description: The value of the tag. + type: string '400': $ref: '#/components/responses/400_error' '401': @@ -13016,19 +14479,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}': - delete: - operationId: DeleteProductsProduct - summary: Delete a Product - description: Deletes a Product and it's associated Product Variants. + /products/types: + get: + deprecated: true + operationId: GetProductsTypes + summary: List Product Types + description: Retrieves a list of Product Types. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13040,16 +14497,16 @@ paths: // must be previously logged in or use api token - medusa.admin.products.delete(product_id) + medusa.admin.products.listTypes() - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ types }) => { + console.log(types.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/asfsaf' \ + curl --location --request GET + 'https://medusa-url.com/admin/products/types' \ --header 'Authorization: Bearer {api_token}' security: @@ -13063,18 +14520,12 @@ paths: content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Product. - object: - type: string - description: The type of the object that was deleted. - default: product - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + types: + type: array + items: + $ref: '#/components/schemas/product_type' '400': $ref: '#/components/responses/400_error' '401': @@ -13087,10 +14538,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetProductsProduct - summary: Get a Product - description: Retrieves a Product. + '/products/{id}/metadata': + post: + operationId: PostProductsProductMetadata + summary: Set Product Metadata + description: Set metadata key/value pair for Product x-authenticated: true parameters: - in: path @@ -13099,6 +14551,21 @@ paths: description: The ID of the Product. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - key + - value + properties: + key: + description: The metadata key + type: string + value: + description: The metadata value + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13110,7 +14577,11 @@ paths: // must be previously logged in or use api token - medusa.admin.products.retrieve(product_id) + medusa.admin.products.setMetadata(product_id, { + + key: 'test', + value: 'true' + }) .then(({ product }) => { console.log(product.id); @@ -13118,10 +14589,17 @@ paths: - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/metadata' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "key": "test", + "value": "true" + }' security: - api_token: [] - cookie_auth: [] @@ -13133,255 +14611,55 @@ paths: content: application/json: schema: - properties: - product: - $ref: '#/components/schemas/product' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostProductsProduct - summary: Update a Product - description: Updates a Product - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: + type: object + properties: + product: + $ref: '#/components/schemas/product' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}/sales-channels/batch': + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add sales channel to a publishable api key scope + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: description: >- - An optional set of key-value pairs with additional - information. - type: object + The IDs of the sales channels to add to the publishable api + key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel x-codeSamples: - lang: JavaScript label: JS Client @@ -13393,41 +14671,298 @@ paths: // must be previously logged in or use api token - medusa.admin.products.update(product_id, { - title: 'Shirt', - images: [] + medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] }) - .then(({ product }) => { - console.log(product.id); + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}' \ + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "Size" + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Remove sales channel from a publishable api key scope + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to delete from the publishable + api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys: + post: + operationId: PostPublishableApiKeys + summary: Create a PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.create() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeys responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + publishable_api_keys: + type: array + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13440,23 +14975,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/variants/{variant_id}': + '/publishable-api-keys/{id}': delete: - operationId: DeleteProductsProductVariantsVariant - summary: Delete a Product Variant - description: Deletes a Product Variant. + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: variant_id - required: true - description: The ID of the Product Variant. + description: The ID of the PublishableApiKeys to delete. schema: type: string x-codeSamples: @@ -13470,184 +14999,55 @@ paths: // must be previously logged in or use api token - medusa.admin.products.deleteVariant(product_id, variant_id) - - .then(({ variant_id, object, deleted, product }) => { - console.log(product.id); - }); + medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - variant_id: + id: type: string - description: The ID of the deleted Product Variant. + description: The ID of the deleted PublishableApiKey. object: type: string description: The type of the object that was deleted. - default: variant + format: publishable_api_key deleted: type: boolean - description: Whether or not the items were deleted. + description: Whether the PublishableApiKeys was deleted. default: true - product: - $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostProductsProductVariantsVariant - summary: Update a Product Variant - description: Update a Product Variant. - x-authenticated: true + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. parameters: - in: path name: id required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: variant_id - required: true - description: The ID of the Product Variant. + description: The ID of the PublishableApiKey. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -13659,59 +15059,34 @@ paths: // must be previously logged in or use api token - medusa.admin.products.updateVariant(product_id, variant_id, { - title: 'Color', - prices: [ - { - amount: 1000, - currency_code: "eur" - } - ], - options: [ - { - option_id, - value: 'S' - } - ], - inventory_quantity: 100 - }) - - .then(({ product }) => { - console.log(product.id); - }); + medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ - - --header 'Authorization: Bearer {api_token}' \ + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ - --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' - --data-raw '{ - "title": "Color", - "prices": [ - { - "amount": 1000, - "currency_code": "eur" - } - ] - }' + -d '{ "created_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13724,11 +15099,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /products/tag-usage: + '/publishable-api-keys/:id/sales-channels': get: - operationId: GetProductsTagUsage - summary: List Tags Usage Number - description: Retrieves a list of Product Tags with how many times each is used. + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels x-authenticated: true x-codeSamples: - lang: JavaScript @@ -13741,23 +15116,23 @@ paths: // must be previously logged in or use api token - medusa.admin.products.listTags() - - .then(({ tags }) => { - console.log(tags.length); - }); + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/products/tag-usage' \ + 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product Tag + - PublishableApiKeySalesChannels responses: '200': description: OK @@ -13765,19 +15140,10 @@ paths: application/json: schema: properties: - tags: + sales_channels: type: array items: - properties: - id: - description: The ID of the tag. - type: string - usage_count: - description: The number of products that use this tag. - type: string - value: - description: The value of the tag. - type: string + $ref: '#/components/schemas/sales_channel' '400': $ref: '#/components/responses/400_error' '401': @@ -13790,12 +15156,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /products/types: - get: - deprecated: true - operationId: GetProductsTypes - summary: List Product Types - description: Retrieves a list of Product Types. + '/publishable-api-keys/{id}/revoke': + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string x-authenticated: true x-codeSamples: - lang: JavaScript @@ -13808,34 +15180,35 @@ paths: // must be previously logged in or use api token - medusa.admin.products.listTypes() - - .then(({ types }) => { - console.log(types.length); - }); + medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/types' \ + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' + \ --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123", "revoked_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - types: - type: array - items: - $ref: '#/components/schemas/product_type' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13848,32 +15221,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/metadata': + '/publishable-api-key/{id}': post: - operationId: PostProductsProductMetadata - summary: Set Product Metadata - description: Set metadata key/value pair for Product + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product. + description: The ID of the PublishableApiKey. schema: type: string requestBody: content: application/json: schema: - required: - - key - - value + type: object properties: - key: - description: The metadata key - type: string - value: - description: The metadata value + title: + description: A title to update for the key. type: string x-codeSamples: - lang: JavaScript @@ -13886,43 +15254,40 @@ paths: // must be previously logged in or use api token - medusa.admin.products.setMetadata(product_id, { - - key: 'test', - value: 'true' + medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" }) - - .then(({ product }) => { - console.log(product.id); - }); + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/metadata' \ + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "key": "test", - "value": "true" + "title": "updated title" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13952,6 +15317,7 @@ paths: content: application/json: schema: + type: object required: - country_code properties: @@ -14004,6 +15370,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14036,6 +15403,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14084,6 +15452,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14116,6 +15485,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14164,6 +15534,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14189,6 +15560,7 @@ paths: content: application/json: schema: + type: object required: - name - currency_code @@ -14302,6 +15674,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14395,6 +15768,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -14468,6 +15842,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -14538,6 +15913,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14569,6 +15945,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Region @@ -14667,6 +16044,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14729,6 +16107,7 @@ paths: content: application/json: schema: + type: object properties: fulfillment_options: type: array @@ -14812,6 +16191,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14881,6 +16261,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14909,12 +16290,236 @@ paths: description: The ID of the Region. schema: type: string - - in: path - name: provider_id - required: true - description: The ID of the Payment Provider. + - in: path + name: provider_id + required: true + description: The ID of the Payment Provider. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + region: + $ref: '#/components/schemas/region' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-options: + post: + operationId: PostShippingOptions + summary: Create Shipping Option + description: Creates a Shipping Option + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: >- + The ID of the Region in which the Shipping Option will be + available. + type: string + provider_id: + description: >- + The ID of the Fulfillment Provider that handles the Shipping + Option. + type: string + profile_id: + description: >- + The ID of the Shipping Profile to add the Shipping Option + to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle + shipping with this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping + Option to be available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + default: false + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' + }) + + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/shipping_option' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. + x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return schema: - type: string + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options x-codeSamples: - lang: JavaScript label: JS Client @@ -14926,33 +16531,38 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + medusa.admin.shippingOptions.list() - .then(({ region }) => { - console.log(region.id); + .then(({ shipping_options, count }) => { + console.log(shipping_options.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' - \ + curl --location --request GET + 'https://medusa-url.com/admin/shipping-options' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Region + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - region: - $ref: '#/components/schemas/region' + shipping_options: + type: array + items: + $ref: '#/components/schemas/shipping_option' + count: + type: integer + description: The total number of items available '400': $ref: '#/components/responses/400_error' '401': @@ -14965,39 +16575,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /return-reasons: - post: - operationId: PostReturnReasons - summary: Create a Return Reason - description: Creates a Return Reason + '/shipping-options/{id}': + delete: + operationId: DeleteShippingOptionsOption + summary: Delete a Shipping Option + description: Deletes a Shipping Option. x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - label - - value - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - parent_return_reason_id: - description: The ID of the parent return reason. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15009,42 +16599,42 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.create({ - label: 'Damaged', - value: 'damaged' - }) + medusa.admin.shippingOptions.delete(option_id) - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-options/{option_id}' \ - --data-raw '{ - "label": "Damaged", - "value": "damaged" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + id: + type: string + description: The ID of the deleted Shipping Option. + object: + type: string + description: The type of the object that was deleted. + default: shipping-option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -15058,10 +16648,17 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15073,34 +16670,33 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.list() + medusa.admin.shippingOptions.retrieve(option_id) - .then(({ return_reasons }) => { - console.log(return_reasons.length); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/return-reasons' \ + 'https://medusa-url.com/admin/shipping-options/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reasons: - type: array - items: - $ref: '#/components/schemas/return_reason' + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -15113,19 +16709,65 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/return-reasons/{id}': - delete: - operationId: DeleteReturnReason - summary: Delete a Return Reason - description: Deletes a return reason. + post: + operationId: PostShippingOptionsOption + summary: Update Shipping Option + description: Updates a Shipping Option x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the return reason + description: The ID of the Shipping Option. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + requirements: + description: >- + The requirements that must be satisfied for the Shipping + Option to be available. + type: array + items: + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -15137,41 +16779,53 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.delete(return_reason_id) + medusa.admin.shippingOptions.update(option_id, { + name: 'PostFake', + requirements: [ + { + id, + type: 'max_subtotal', + amount: 1000 + } + ] + }) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/return-reasons/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "requirements": [ + { + "type": "max_subtotal", + "amount": 1000 + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted return reason - object: - type: string - description: The type of the object that was deleted. - default: return_reason - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + content: + application/json: + schema: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -15184,18 +16838,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetReturnReasonsReason - summary: Get a Return Reason - description: Retrieves a Return Reason. + /shipping-profiles: + post: + operationId: PostShippingProfiles + summary: Create a Shipping Profile + description: Creates a Shipping Profile x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Return Reason. - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15207,32 +16866,41 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.retrieve(return_reason_id) + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/return-reasons/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Profile responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -15245,39 +16913,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostReturnReasonsReason - summary: Update a Return Reason - description: Updates a Return Reason + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Return Reason. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -15289,40 +16929,35 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.update(return_reason_id, { - label: 'Damaged' - }) + medusa.admin.shippingProfiles.list() - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ - --data-raw '{ - "label": "Damaged" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Profile responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -15335,16 +16970,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/cancel': - post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. + '/shipping-profiles/{id}': + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Return. + description: The ID of the Shipping Profile. schema: type: string x-codeSamples: @@ -15358,32 +16994,42 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.cancel(return_id) + medusa.admin.shippingProfiles.delete(profile_id) - .then(({ order }) => { - console.log(order.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/cancel' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Profile responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -15396,24 +17042,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /returns: get: - operationId: GetReturns - summary: List Returns - description: Retrieves a list of Returns + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. + - in: path + name: id + required: true + description: The ID of the Shipping Profile. schema: - type: number - default: '0' + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15425,43 +17065,33 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.list() + medusa.admin.shippingProfiles.retrieve(profile_id) - .then(({ returns, limit, offset, count }) => { - console.log(returns.length); + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); }); - lang: Shell label: cURL source: > - curl --location --request GET 'https://medusa-url.com/admin/returns' - \ + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Profile responses: '200': description: OK content: application/json: schema: + type: object properties: - returns: - type: array - items: - $ref: '#/components/schemas/return' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -15474,44 +17104,26 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/receive': post: - operationId: PostReturnsReturnReceive - summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile parameters: - in: path name: id required: true - description: The ID of the Return. + description: The ID of the Shipping Profile. schema: type: string requestBody: content: application/json: schema: - required: - - items + type: object properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + name: + description: The name of the Shipping Profile + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15520,53 +17132,44 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.receive(return_id, { - items: [ - { - item_id, - quantity: 1 - } - ] + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' }) - .then((data) => { - console.log(data.return.id); + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/receive' \ + 'https://medusa-url.com/admin/shipping-profiles/{id} \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "items": [ - { - "item_id": "asafg", - "quantity": 1 - } - ] + "name": "Large Products" }' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Profile responses: '200': description: OK content: application/json: schema: + type: object properties: - return: - $ref: '#/components/schemas/return' + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -15596,6 +17199,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15660,6 +17264,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15691,6 +17296,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15755,6 +17361,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15780,6 +17387,7 @@ paths: content: application/json: schema: + type: object required: - name properties: @@ -15835,6 +17443,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16007,6 +17616,7 @@ paths: content: application/json: schema: + type: object properties: sales_channels: type: array @@ -16080,6 +17690,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16150,6 +17761,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16181,6 +17793,7 @@ paths: content: application/json: schema: + type: object properties: name: type: string @@ -16203,264 +17816,40 @@ paths: // must be previously logged in or use api token medusa.admin.salesChannels.update(sales_channel_id, { - name: 'App' - }) - - .then(({ sales_channel }) => { - console.log(sales_channel.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/sales-channels/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "App" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Sales Channel - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - sales_channel: - $ref: '#/components/schemas/sales_channel' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /shipping-options: - post: - operationId: PostShippingOptions - summary: Create Shipping Option - description: Creates a Shipping Option - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingOptions.create({ - name: 'PostFake', - region_id: "saasf", - provider_id: "manual", - data: { - }, - price_type: 'flat_rate' - }) - - .then(({ shipping_option }) => { - console.log(shipping_option.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-options' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "PostFake", - "region_id": "afasf", - "provider_id": "manual", - "data": {}, - "price_type": "flat_rate" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingOptions - summary: List Shipping Options - description: Retrieves a list of Shipping Options. - x-authenticated: true - parameters: - - in: query - name: region_id - schema: - type: string - description: Region ID to fetch options from - - in: query - name: is_return - schema: - type: boolean - description: Flag for fetching return options only - - in: query - name: admin_only - schema: - type: boolean - description: Flag for fetching admin specific options - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingOptions.list() + name: 'App' + }) - .then(({ shipping_options, count }) => { - console.log(shipping_options.length); + .then(({ sales_channel }) => { + console.log(sales_channel.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options' \ + curl --location --request POST + 'https://medusa-url.com/admin/sales-channels/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "App" + }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Sales Channel responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_options: - type: array - items: - $ref: '#/components/schemas/shipping_option' - count: - type: integer - description: The total number of items available + sales_channel: + $ref: '#/components/schemas/sales_channel' '400': $ref: '#/components/responses/400_error' '401': @@ -16473,17 +17862,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-options/{id}': - delete: - operationId: DeleteShippingOptionsOption - summary: Delete a Shipping Option - description: Deletes a Shipping Option. - x-authenticated: true + '/returns/{id}/cancel': + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. parameters: - in: path name: id required: true - description: The ID of the Shipping Option. + description: The ID of the Return. schema: type: string x-codeSamples: @@ -16497,41 +17885,33 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.delete(option_id) + medusa.admin.returns.cancel(return_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-options/{option_id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Shipping Option. - object: - type: string - description: The type of the object that was deleted. - default: shipping-option - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -16544,18 +17924,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /returns: get: - operationId: GetShippingOptionsOption - summary: Get a Shipping Option - description: Retrieves a Shipping Option. - x-authenticated: true + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. + - in: query + name: limit + description: The upper limit for the amount of responses returned. schema: - type: string + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' x-codeSamples: - lang: JavaScript label: JS Client @@ -16567,32 +17953,44 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.retrieve(option_id) + medusa.admin.returns.list() - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options/{id}' \ + curl --location --request GET 'https://medusa-url.com/admin/returns' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + returns: + type: array + items: + $ref: '#/components/schemas/return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -16605,64 +18003,45 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/returns/{id}/receive': post: - operationId: PostShippingOptionsOption - summary: Update Shipping Option - description: Updates a Shipping Option - x-authenticated: true + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. parameters: - in: path name: id required: true - description: The ID of the Shipping Option. + description: The ID of the Return. schema: type: string requestBody: content: application/json: schema: + type: object required: - - requirements + - items properties: - name: - description: The name of the Shipping Option - type: string - amount: - description: The amount to charge for the Shipping Option. - type: integer - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. + items: + description: The Line Items that have been received. type: array items: required: - - type - - amount + - item_id + - quantity properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement + item_id: + description: The ID of the Line Item. type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. + quantity: + description: The quantity of the Line Item. type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + refund: + description: The amount to refund. + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -16674,35 +18053,33 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.update(option_id, { - name: 'PostFake', - requirements: [ + medusa.admin.returns.receive(return_id, { + items: [ { - id, - type: 'max_subtotal', - amount: 1000 + item_id, + quantity: 1 } ] }) - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-options/{id}' \ + 'https://medusa-url.com/admin/returns/{id}/receive' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "requirements": [ + "items": [ { - "type": "max_subtotal", - "amount": 1000 + "item_id": "asafg", + "quantity": 1 } ] }' @@ -16710,16 +18087,17 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + return: + $ref: '#/components/schemas/return' '400': $ref: '#/components/responses/400_error' '401': @@ -16732,22 +18110,40 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /shipping-profiles: + /return-reasons: post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason x-authenticated: true requestBody: content: application/json: schema: + type: object required: - - name + - label + - value properties: - name: - description: The name of the Shipping Profile + label: + description: The label to display to the Customer. + type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + parent_return_reason_id: + description: The ID of the parent return reason. + type: string + description: + description: An optional description to for the Reason. type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -16759,40 +18155,43 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.create({ - name: 'Large Products' + medusa.admin.returnReasons.create({ + label: 'Damaged', + value: 'damaged' }) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles' \ + 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Large Products" + "label": "Damaged", + "value": "damaged" }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + type: object + properties: + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16806,9 +18205,9 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetShippingProfiles - summary: List Shipping Profiles - description: Retrieves a list of Shipping Profile. + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. x-authenticated: true x-codeSamples: - lang: JavaScript @@ -16821,34 +18220,35 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.list() + medusa.admin.returnReasons.list() - .then(({ shipping_profiles }) => { - console.log(shipping_profiles.length); + .then(({ return_reasons }) => { + console.log(return_reasons.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ + 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profiles: + return_reasons: type: array items: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16861,17 +18261,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': + '/return-reasons/{id}': delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the return reason schema: type: string x-codeSamples: @@ -16885,7 +18285,7 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.delete(profile_id) + medusa.admin.returnReasons.delete(return_reason_id) .then(({ id, object, deleted }) => { console.log(id); @@ -16894,28 +18294,29 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: id: type: string - description: The ID of the deleted Shipping Profile. + description: The ID of the deleted return reason object: type: string description: The type of the object that was deleted. - default: shipping_profile + default: return_reason deleted: type: boolean description: Whether or not the items were deleted. @@ -16933,15 +18334,15 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetShippingProfilesProfile - summary: Get a Shipping Profile - description: Retrieves a Shipping Profile. + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the Return Reason. schema: type: string x-codeSamples: @@ -16955,32 +18356,33 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.retrieve(profile_id) + medusa.admin.returnReasons.retrieve(return_reason_id) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16994,24 +18396,39 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostShippingProfilesProfile - summary: Update a Shipping Profile - description: Updates a Shipping Profile + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason + x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the Return Reason. schema: type: string requestBody: content: application/json: schema: + type: object properties: - name: - description: The name of the Shipping Profile + label: + description: The label to display to the Customer. + type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -17023,40 +18440,41 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.update(shipping_profile_id, { - name: 'Large Products' + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' }) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles/{id} \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Large Products" + "label": "Damaged" }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -17119,6 +18537,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17183,6 +18602,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17236,6 +18656,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17260,6 +18681,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Store @@ -17337,6 +18759,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17392,6 +18815,7 @@ paths: content: application/json: schema: + type: object properties: payment_providers: type: array @@ -17449,6 +18873,7 @@ paths: content: application/json: schema: + type: object properties: tax_providers: type: array @@ -17513,6 +18938,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -17579,6 +19005,7 @@ paths: content: application/json: schema: + type: object properties: swaps: type: array @@ -17640,6 +19067,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17696,6 +19124,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17745,6 +19174,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17801,6 +19231,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17851,6 +19282,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -17905,6 +19337,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17954,6 +19387,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -18010,6 +19444,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18060,6 +19495,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18117,6 +19553,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18166,6 +19603,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18223,6 +19661,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18267,6 +19706,7 @@ paths: content: application/json: schema: + type: object required: - code - name @@ -18349,6 +19789,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18477,6 +19918,7 @@ paths: content: application/json: schema: + type: object properties: tax_rates: type: array @@ -18550,6 +19992,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -18638,6 +20081,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18687,6 +20131,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -18730,40 +20175,200 @@ paths: // must be previously logged in or use api token - medusa.admin.taxRates.update(tax_rate_id, { - name: 'New Tax Rate' - }) + medusa.admin.taxRates.update(tax_rate_id, { + name: 'New Tax Rate' + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Tax Rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + tax_rate: + $ref: '#/components/schemas/tax_rate' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants: + get: + operationId: GetVariants + summary: List Product Variants + description: Retrieves a list of Product Variants + x-authenticated: true + parameters: + - in: query + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.variants.list() - .then(({ tax_rate }) => { - console.log(tax_rate.id); + .then(({ variants, limit, offset, count }) => { + console.log(variants.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/variants' \ - --data-raw '{ - "name": "New Tax Rate" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Product Variant responses: '200': description: OK content: application/json: schema: + type: object properties: - tax_rate: - $ref: '#/components/schemas/tax_rate' + variants: + type: array + items: + $ref: '#/components/schemas/product_variant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -18833,6 +20438,7 @@ paths: content: application/json: schema: + type: object properties: uploads: type: array @@ -18912,6 +20518,7 @@ paths: content: application/json: schema: + type: object properties: uploads: type: array @@ -18944,6 +20551,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -19013,6 +20621,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19065,6 +20674,7 @@ paths: content: application/json: schema: + type: object properties: users: type: array @@ -19129,6 +20739,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -19199,6 +20810,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19230,6 +20842,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The name of the User. @@ -19294,6 +20907,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19319,6 +20933,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -19391,6 +21006,7 @@ paths: content: application/json: schema: + type: object required: - token - password @@ -19450,6 +21066,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19465,164 +21082,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /variants: - get: - operationId: GetVariants - summary: List Product Variants - description: Retrieves a list of Product Variants - x-authenticated: true - parameters: - - in: query - name: id - description: A Product Variant id to filter by. - schema: - type: string - - in: query - name: ids - description: A comma separated list of Product Variant ids to filter by. - schema: - type: string - - in: query - name: expand - description: A comma separated list of Product Variant relations to load. - schema: - type: string - - in: query - name: fields - description: A comma separated list of Product Variant fields to include. - schema: - type: string - - in: query - name: offset - description: How many product variants to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Maximum number of Product Variants to return. - schema: - type: number - default: '100' - - in: query - name: cart_id - description: The id of the cart to use for price selection. - schema: - type: string - - in: query - name: region_id - description: The id of the region to use for price selection. - schema: - type: string - - in: query - name: currency_code - description: The currency code to use for price selection. - schema: - type: string - - in: query - name: customer_id - description: The id of the customer to use for price selection. - schema: - type: string - - in: query - name: title - style: form - explode: false - description: product variant title to search for. - schema: - oneOf: - - type: string - description: a single title to search by - - type: array - description: multiple titles to search by - items: - type: string - - in: query - name: inventory_quantity - description: Filter by available inventory quantity - schema: - oneOf: - - type: number - description: a specific number to search by. - - type: object - description: search 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.variants.list() - - .then(({ variants, limit, offset, count }) => { - console.log(variants.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/variants' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product Variant - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - variants: - type: array - items: - $ref: '#/components/schemas/product_variant' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' components: responses: default_error: @@ -19901,6 +21360,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -19955,6 +21415,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -20038,6 +21499,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -20180,6 +21642,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -20357,6 +21820,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -20400,6 +21864,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -20487,6 +21952,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -20608,6 +22074,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -20640,6 +22107,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -20694,6 +22162,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -20729,6 +22198,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -20787,6 +22257,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -20834,6 +22305,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -20851,7 +22323,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -20907,6 +22379,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -20942,6 +22415,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -20977,6 +22451,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -21012,6 +22487,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -21047,6 +22523,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -21082,6 +22559,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -21179,6 +22657,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -21246,6 +22725,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -21338,6 +22818,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -21412,6 +22893,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -21443,6 +22925,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -21466,6 +22949,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -21581,6 +23065,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -21627,6 +23112,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -21698,6 +23184,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -21752,6 +23239,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -21784,6 +23272,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -21835,6 +23324,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -21875,6 +23365,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -21925,6 +23416,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -22119,6 +23611,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -22202,6 +23695,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -22253,6 +23747,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -22275,6 +23770,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -22342,6 +23838,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -22405,6 +23902,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -22438,6 +23936,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -22566,6 +24065,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -22623,6 +24123,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -22901,6 +24402,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -22926,12 +24428,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -22941,12 +24438,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -22998,6 +24489,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -23022,6 +24514,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -23095,6 +24588,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -23192,6 +24686,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -23268,6 +24763,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -23317,6 +24813,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -23375,6 +24872,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -23422,6 +24920,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -23456,6 +24955,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -23493,6 +24993,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -23530,6 +25031,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -23566,6 +25068,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -23719,6 +25222,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -23762,6 +25266,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -23952,6 +25457,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -23959,6 +25520,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -24025,6 +25587,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -24129,6 +25692,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -24187,6 +25751,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -24241,6 +25806,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -24341,6 +25907,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -24376,6 +25943,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -24425,6 +25993,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -24509,6 +26078,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -24557,6 +26127,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -24663,6 +26234,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -24726,6 +26298,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -24761,6 +26334,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -24780,6 +26354,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -24847,6 +26422,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -24994,6 +26570,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -25031,6 +26608,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -25049,6 +26627,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -25132,6 +26711,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -25185,6 +26765,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -25228,6 +26809,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -25242,6 +26824,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 776f7aef994dd..2f6475989bfaf 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -212,6 +212,7 @@ paths: content: application/json: schema: + type: object required: - application_name - state @@ -253,6 +254,7 @@ paths: content: application/json: schema: + type: object properties: apps: $ref: '#/components/schemas/OAuth' @@ -291,6 +293,7 @@ paths: content: application/json: schema: + type: object properties: apps: type: array @@ -362,6 +365,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -458,6 +462,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -473,6 +478,151 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currency: + $ref: '#/components/schemas/currency' '/batch-jobs/{id}/cancel': post: operationId: PostBatchJobsBatchJobCancel @@ -520,6 +670,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -582,6 +733,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -607,6 +759,7 @@ paths: content: application/json: schema: + type: object required: - type - context @@ -685,6 +838,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -975,6 +1129,7 @@ paths: content: application/json: schema: + type: object properties: batch_jobs: type: array @@ -1048,6 +1203,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -1063,62 +1219,92 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': + '/customer-groups/{id}/customers/batch': post: - operationId: PostProductsToCollection - summary: Update Products - description: Updates products associated with a Product Collection + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: 'Adds a list of customers, represented by id''s, to a customer group.' x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the customer group. schema: type: string requestBody: content: application/json: schema: + type: object required: - - product_ids + - customer_ids properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. + customer_ids: + description: The ids of the customers to add type: array items: - description: The ID of a Product to add to the Product Collection. - type: string + required: + - id + properties: + id: + description: ID of the customer + type: string x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } ] }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1132,73 +1318,90 @@ paths: '500': $ref: '#/components/responses/500_error' delete: - operationId: DeleteProductsFromCollection - summary: Remove Product - description: Removes products associated with a Product Collection + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: 'Removes a list of customers, represented by id''s, from a customer group.' x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the customer group. schema: type: string requestBody: content: application/json: schema: + type: object required: - - product_ids + - customer_ids properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. + customer_ids: + description: The ids of the customers to remove type: array items: - description: The ID of a Product to add to the Product Collection. - type: string + required: + - id + properties: + id: + description: ID of the customer + type: string x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } ] }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1211,32 +1414,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /collections: + /customer-groups: post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + parameters: [] x-codeSamples: - lang: JavaScript label: JS Client @@ -1248,40 +1432,41 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.create({ - title: 'New Collection' + medusa.admin.customerGroups.create({ + name: 'VIP' }) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections' \ + 'https://medusa-url.com/admin/customer-groups' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "New Collection" + "name": "VIP" }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1294,49 +1479,88 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. x-authenticated: true parameters: - in: query - name: limit - description: The number of collections to return. + name: q + description: Query used for searching customer group names. schema: - type: integer - default: 10 + type: string - in: query name: offset - description: The number of collections to skip before the results. + description: How many groups to skip in the result. schema: type: integer default: 0 - in: query - name: title - description: The title of collections to return. + name: order + description: the field used to order the customer groups. schema: type: string - in: query - name: handle - description: The handle of collections to return. + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. schema: type: string - in: query - name: q - description: a search term to search titles and handles. + name: id + style: form + explode: false + description: Filter by the customer group ID schema: - type: string + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID - in: query - name: discount_condition_id - description: >- - The discount condition id on which to filter the product - collections. + name: name + style: form + explode: false + description: Filter by the customer group name schema: - type: string + type: array + description: multiple customer group names + items: + type: string + description: customer group name - in: query name: created_at - description: Date comparison for when resulting collections were created. + description: Date comparison for when resulting customer groups were created. schema: type: object properties: @@ -1358,7 +1582,7 @@ paths: format: date - in: query name: updated_at - description: Date comparison for when resulting collections were updated. + description: Date comparison for when resulting customer groups were updated. schema: type: object properties: @@ -1379,27 +1603,18 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: deleted_at - description: Date comparison for when resulting collections were deleted. + name: limit + description: Limit the number of customer groups returned. 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 + type: integer + default: 10 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1411,34 +1626,35 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.list() + medusa.admin.customerGroups.list() - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/collections' \ + 'https://medusa-url.com/admin/customer-groups' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collections: + customer_groups: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/customer_group' count: type: integer description: The total number of items available @@ -1460,17 +1676,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}': + '/customer-groups/{id}': delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the Customer Group schema: type: string x-codeSamples: @@ -1484,7 +1700,7 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.delete(collection_id) + medusa.admin.customerGroups.delete(customer_group_id) .then(({ id, object, deleted }) => { console.log(id); @@ -1493,31 +1709,34 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: id: type: string - description: The ID of the deleted Collection + description: The ID of the deleted customer group. object: type: string description: The type of the object that was deleted. - default: product-collection + default: customer_group deleted: type: boolean - description: Whether the collection was deleted successfully or not. + description: >- + Whether the customer group was deleted successfully or + not. default: true '400': $ref: '#/components/responses/400_error' @@ -1532,15 +1751,29 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product Collection + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the customer + group. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the customer + group. schema: type: string x-codeSamples: @@ -1554,33 +1787,34 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.retrieve(collection_id) + medusa.admin.customerGroups.retrieve(customer_group_id) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': + customer_group: + $ref: '#/components/schemas/customer_group' + '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' @@ -1593,34 +1827,28 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostCollectionsCollection - summary: Update a Collection - description: Updates a Product Collection. + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the customer group. schema: type: string requestBody: content: application/json: schema: + type: object properties: - title: - type: string - description: The title to identify the Collection by. - handle: + name: + description: Name of the customer group type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. metadata: - description: >- - An optional set of key-value pairs to hold additional - information. + description: Metadata for the customer. type: object x-codeSamples: - lang: JavaScript @@ -1633,40 +1861,41 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.update(collection_id, { - title: 'New Collection' + medusa.admin.customerGroups.update(customer_group_id, { + name: 'VIP' }) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "New Collection" + "name": "VIP" }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1679,40 +1908,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /currencies: + '/customer-groups/{id}/customers': get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group x-authenticated: true parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. + - in: path + name: id + required: true + description: The ID of the customer group. schema: type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' x-codeSamples: - lang: JavaScript label: JS Client @@ -1724,31 +1932,35 @@ paths: // must be previously logged in or use api token - medusa.admin.currencies.list() + medusa.admin.customerGroups.listCustomers(customer_group_id) - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); + .then(({ customers }) => { + console.log(customers.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] tags: - - Currency + - Customer Group responses: '200': description: OK content: application/json: schema: + type: object properties: - currencies: + customers: type: array items: - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/customer' count: type: integer description: The total number of items available @@ -1758,153 +1970,158 @@ paths: limit: type: integer description: The number of items per page - '/currencies/{code}': + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/collections/{id}/products/batch': post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection x-authenticated: true parameters: - in: path - name: code + name: id required: true - description: The code of the Currency. + description: The ID of the Collection. schema: type: string requestBody: content: application/json: schema: + type: object + required: + - product_ids properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.update(code, { - includes_tax: true - }) - - .then(({ currency }) => { - console.log(currency.id); - }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "includes_tax": true + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] }' + security: + - api_token: [] + - cookie_auth: [] tags: - - Currency + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - currency: - $ref: '#/components/schemas/currency' - '/customer-groups/{id}/customers/batch': - post: - operationId: PostCustomerGroupsGroupCustomersBatch - summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' + collection: + $ref: '#/components/schemas/product_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Collection. schema: type: string requestBody: content: application/json: schema: + type: object required: - - customer_ids + - product_ids properties: - customer_ids: - description: The ids of the customers to add + product_ids: + description: >- + An array of Product IDs to remove from the Product + Collection. type: array items: - required: - - id - properties: - id: - description: ID of the customer - type: string + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.addCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" ] }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string '400': $ref: '#/components/responses/400_error' '401': @@ -1917,108 +2134,33 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteCustomerGroupsGroupCustomerBatch - summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' + /collections: + post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string requestBody: content: application/json: schema: + type: object required: - - customer_ids + - title properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.removeCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customer-groups: - post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. - x-authenticated: true - parameters: [] + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -2030,40 +2172,41 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.create({ - name: 'VIP' + medusa.admin.collections.create({ + title: 'New Collection' }) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "VIP" + "title": "New Collection" }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -2076,88 +2219,49 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. get: - operationId: GetCustomerGroups - summary: List Customer Groups - description: Retrieve a list of customer groups. + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. x-authenticated: true parameters: - in: query - name: q - description: Query used for searching customer group names. + name: limit + description: The number of collections to return. schema: - type: string + type: integer + default: 10 - in: query name: offset - description: How many groups to skip in the result. + description: The number of collections to skip before the results. schema: type: integer default: 0 - in: query - name: order - description: the field used to order the customer groups. + name: title + description: The title of collections to return. schema: type: string - in: query - name: discount_condition_id - description: The discount condition id on which to filter the customer groups. + name: handle + description: The handle of collections to return. schema: type: string - in: query - name: id - style: form - explode: false - description: Filter by the customer group ID + name: q + description: a search term to search titles and handles. schema: - oneOf: - - type: string - description: customer group ID - - type: array - description: multiple customer group IDs - items: - type: string - - type: object - properties: - lt: - type: string - description: filter by IDs less than this ID - gt: - type: string - description: filter by IDs greater than this ID - lte: - type: string - description: filter by IDs less than or equal to this ID - gte: - type: string - description: filter by IDs greater than or equal to this ID + type: string - in: query - name: name - style: form - explode: false - description: Filter by the customer group name + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. schema: - type: array - description: multiple customer group names - items: - type: string - description: customer group name + type: string - in: query name: created_at - description: Date comparison for when resulting customer groups were created. + description: Date comparison for when resulting collections were created. schema: type: object properties: @@ -2179,7 +2283,7 @@ paths: format: date - in: query name: updated_at - description: Date comparison for when resulting customer groups were updated. + description: Date comparison for when resulting collections were updated. schema: type: object properties: @@ -2200,18 +2304,27 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: limit - description: Limit the number of customer groups returned. - schema: - type: integer - default: 10 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each customer - groups of the result. + name: deleted_at + description: Date comparison for when resulting collections were deleted. schema: - type: string + 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 @@ -2223,34 +2336,35 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.list() + medusa.admin.collections.list() - .then(({ customer_groups, limit, offset, count }) => { - console.log(customer_groups.length); + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - customer_groups: + collections: type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/product_collection' count: type: integer description: The total number of items available @@ -2272,17 +2386,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}': + '/collections/{id}': delete: - operationId: DeleteCustomerGroupsCustomerGroup - summary: Delete a Customer Group - description: Deletes a CustomerGroup. + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer Group + description: The ID of the Collection. schema: type: string x-codeSamples: @@ -2296,7 +2410,7 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.delete(customer_group_id) + medusa.admin.collections.delete(collection_id) .then(({ id, object, deleted }) => { console.log(id); @@ -2305,33 +2419,32 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: id: type: string - description: The ID of the deleted customer group. + description: The ID of the deleted Collection object: type: string description: The type of the object that was deleted. - default: customer_group + default: product-collection deleted: type: boolean - description: >- - Whether the customer group was deleted successfully or - not. + description: Whether the collection was deleted successfully or not. default: true '400': $ref: '#/components/responses/400_error' @@ -2346,29 +2459,15 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetCustomerGroupsGroup - summary: Get a Customer Group - description: Retrieves a Customer Group. + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer Group. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in the customer - group. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in the customer - group. + description: The ID of the Product Collection schema: type: string x-codeSamples: @@ -2382,32 +2481,33 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.retrieve(customer_group_id) + medusa.admin.collections.retrieve(collection_id) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -2421,27 +2521,35 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostCustomerGroupsGroup - summary: Update a Customer Group - description: Update a CustomerGroup. + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Collection. schema: type: string requestBody: content: application/json: schema: + type: object properties: - name: - description: Name of the customer group + title: + type: string + description: The title to identify the Collection by. + handle: type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. metadata: - description: Metadata for the customer. + description: >- + An optional set of key-value pairs to hold additional + information. type: object x-codeSamples: - lang: JavaScript @@ -2454,113 +2562,41 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.update(customer_group_id, { - name: 'VIP' + medusa.admin.collections.update(collection_id, { + title: 'New Collection' }) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "VIP" + "title": "New Collection" }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/customer-groups/{id}/customers': - get: - operationId: GetCustomerGroupsGroupCustomers - summary: List Customers - description: Retrieves a list of customers in a customer group - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.listCustomers(customer_group_id) - - .then(({ customers }) => { - console.log(customers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group + - Collection responses: '200': description: OK content: application/json: schema: + type: object properties: - customers: - type: array - items: - $ref: '#/components/schemas/customer' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -2583,6 +2619,7 @@ paths: content: application/json: schema: + type: object required: - email - first_name @@ -2659,6 +2696,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2736,6 +2774,7 @@ paths: content: application/json: schema: + type: object properties: customers: type: array @@ -2819,6 +2858,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2860,6 +2900,7 @@ paths: content: application/json: schema: + type: object properties: email: type: string @@ -2935,6 +2976,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -3003,6 +3045,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3072,6 +3115,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3124,6 +3168,7 @@ paths: content: application/json: schema: + type: object required: - resources properties: @@ -3181,6 +3226,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3232,6 +3278,7 @@ paths: content: application/json: schema: + type: object required: - resources properties: @@ -3289,6 +3336,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3338,6 +3386,7 @@ paths: content: application/json: schema: + type: object required: - operator properties: @@ -3424,6 +3473,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3462,9 +3512,11 @@ paths: content: application/json: schema: + type: object required: - code - rule + - regions properties: code: type: string @@ -3618,6 +3670,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, + regions: ['reg_XXXXXXXX'], is_dynamic: false, is_disabled: false }) @@ -3641,7 +3694,8 @@ paths: "type": "fixed", "value": 10, "allocation": "item" - } + }, + "regions": ['reg_XXXXXXXX'] }' security: - api_token: [] @@ -3654,6 +3708,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3766,6 +3821,7 @@ paths: content: application/json: schema: + type: object properties: discounts: type: array @@ -3851,6 +3907,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3950,6 +4007,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -4042,6 +4100,7 @@ paths: content: application/json: schema: + type: object properties: discount_condition: $ref: '#/components/schemas/discount_condition' @@ -4096,6 +4155,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -4177,6 +4237,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4239,6 +4300,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -4319,6 +4381,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4366,6 +4429,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -4523,6 +4587,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4591,6 +4656,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4663,6 +4729,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4688,6 +4755,7 @@ paths: content: application/json: schema: + type: object required: - email - items @@ -4851,6 +4919,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -4925,6 +4994,7 @@ paths: content: application/json: schema: + type: object properties: draft_orders: type: array @@ -4968,6 +5038,7 @@ paths: content: application/json: schema: + type: object required: - quantity properties: @@ -5033,6 +5104,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5095,6 +5167,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -5165,6 +5238,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5234,6 +5308,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5271,6 +5346,7 @@ paths: content: application/json: schema: + type: object properties: unit_price: description: The potential custom price of the item. @@ -5329,6 +5405,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5391,6 +5468,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/draft-order' @@ -5423,6 +5501,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -5509,6 +5588,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5536,6 +5616,7 @@ paths: content: application/json: schema: + type: object required: - region_id properties: @@ -5605,6 +5686,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5677,6 +5759,7 @@ paths: content: application/json: schema: + type: object properties: gift_cards: type: array @@ -5750,6 +5833,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -5820,6 +5904,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5853,6 +5938,7 @@ paths: content: application/json: schema: + type: object properties: balance: type: integer @@ -5920,6 +6006,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5944,6 +6031,7 @@ paths: content: application/json: schema: + type: object required: - token - user @@ -6044,6 +6132,7 @@ paths: content: application/json: schema: + type: object required: - user - role @@ -6155,6 +6244,7 @@ paths: content: application/json: schema: + type: object properties: invites: type: array @@ -6219,6 +6309,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -6313,6 +6404,7 @@ paths: content: application/json: schema: + type: object required: - resource_id - resource_type @@ -6373,6 +6465,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6443,6 +6536,7 @@ paths: content: application/json: schema: + type: object properties: notes: type: array @@ -6516,6 +6610,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -6586,6 +6681,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6617,6 +6713,7 @@ paths: content: application/json: schema: + type: object required: - value properties: @@ -6665,6 +6762,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6775,6 +6873,7 @@ paths: content: application/json: schema: + type: object properties: notifications: type: array @@ -6811,6 +6910,7 @@ paths: content: application/json: schema: + type: object properties: to: description: >- @@ -6851,6 +6951,7 @@ paths: content: application/json: schema: + type: object properties: notification: $ref: '#/components/schemas/notification' @@ -6882,6 +6983,7 @@ paths: content: application/json: schema: + type: object required: - variant_id - quantity @@ -6940,6 +7042,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7001,6 +7104,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7058,6 +7162,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7078,6 +7183,7 @@ paths: content: application/json: schema: + type: object required: - order_id properties: @@ -7126,6 +7232,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7143,8 +7250,8 @@ paths: $ref: '#/components/responses/500_error' get: operationId: GetOrderEdits - summary: List an OrderEdit - description: List a OrderEdit. + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true parameters: - in: query @@ -7212,6 +7319,7 @@ paths: content: application/json: schema: + type: object properties: order_edits: type: array @@ -7289,6 +7397,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7326,6 +7435,7 @@ paths: content: application/json: schema: + type: object required: - quantity properties: @@ -7372,6 +7482,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7441,6 +7552,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -7501,6 +7613,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -7570,6 +7683,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7601,6 +7715,7 @@ paths: content: application/json: schema: + type: object properties: internal_note: description: An optional note to create or update for the order edit. @@ -7646,6 +7761,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7707,6 +7823,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7778,6 +7895,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7865,6 +7983,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7934,6 +8053,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8010,6 +8130,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8086,6 +8207,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8155,6 +8277,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8220,6 +8343,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8289,6 +8413,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8351,6 +8476,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8413,6 +8539,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8451,6 +8578,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -8505,6 +8633,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8537,6 +8666,7 @@ paths: content: application/json: schema: + type: object required: - type - claim_items @@ -8710,6 +8840,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8744,6 +8875,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -8823,6 +8955,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8855,6 +8988,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -8913,6 +9047,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8951,6 +9086,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -9010,6 +9146,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9044,6 +9181,7 @@ paths: content: application/json: schema: + type: object required: - return_items properties: @@ -9174,6 +9312,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9212,6 +9351,7 @@ paths: content: application/json: schema: + type: object properties: metadata: description: >- @@ -9258,6 +9398,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9296,6 +9437,7 @@ paths: content: application/json: schema: + type: object properties: metadata: description: >- @@ -9342,6 +9484,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9404,6 +9547,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9435,6 +9579,7 @@ paths: content: application/json: schema: + type: object properties: email: description: the email for the order @@ -9541,6 +9686,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9810,6 +9956,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -9893,6 +10040,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9925,6 +10073,7 @@ paths: content: application/json: schema: + type: object required: - amount - reason @@ -9987,6 +10136,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10021,6 +10171,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -10128,6 +10279,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10166,6 +10318,7 @@ paths: content: application/json: schema: + type: object properties: claim_items: description: The Claim Items that the Claim will consist of. @@ -10297,6 +10450,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10312,66 +10466,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/prices/batch': - post: - operationId: PostPriceListsPriceListPricesBatch - summary: Update Prices - description: Batch update prices for a Price List + '/payment-collections/{id}': + delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Delete a Payment Collection + description: Deletes a Payment Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Price List to update prices for. + description: The ID of the Payment Collection to delete. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices - associated with the Price List. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -10383,88 +10490,67 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.addPrices(price_list_id, { - prices: [ - { - amount: 1000, - variant_id, - currency_code: 'eur' - } - ] - }) - - .then(({ price_list }) => { - console.log(price_list.id); - }); + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/payment-collections/{id}' \ - --data-raw '{ - "prices": [ - { - "amount": 100, - "variant_id": "afasfa", - "currency_code": "eur" - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - delete: - operationId: DeletePriceListsPriceListPricesBatch - summary: Delete Prices - description: Batch delete prices that belong to a Price List + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. x-authenticated: true parameters: - in: path name: id required: true - description: >- - The ID of the Price List that the Money Amounts (Prices) that will - be deleted belongs to. + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -10476,55 +10562,32 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.deletePrices(price_list_id, { - price_ids: [ - price_id - ] - }) - - .then(({ ids, object, deleted }) => { - console.log(ids.length); - }); + medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/payment-collections/{id}' \ - --data-raw '{ - "price_ids": [ - "adasfa" - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - ids: - type: array - items: - type: string - description: The IDs of the deleted Money Amounts (Prices). - object: - type: string - description: The type of the object that was deleted. - default: money-amount - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -10537,162 +10600,79 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /price-lists: post: - operationId: PostPriceListsPriceList - summary: Create a Price List - description: Creates a Price List + operationId: PostPaymentCollectionsPaymentCollection + summary: Updates a PaymentCollection + description: Updates a PaymentCollection. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string requestBody: content: application/json: schema: - required: - - name - - description - - type - - prices + type: object properties: - name: - description: The name of the Price List - type: string description: - description: A description of the Price List. - type: string - starts_at: description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. + An optional description to create or update the payment + collection. type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" - import { PriceListType } from "@medusajs/medusa" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.create({ - name: 'New Price List', - description: 'A new price list', - type: PriceListType.SALE, - prices: [ - { - amount: 1000, - variant_id, - currency_code: 'eur' - } - ] + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" }) - - .then(({ price_list }) => { - console.log(price_list.id); - }); + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/price-lists' \ + 'https://medusa-url.com/admin/payment-collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "New Price List", - "description": "A new price list", - "type": "sale", - "prices": [ - { - "amount": 1000, - "variant_id": "afafa", - "currency_code": "eur" - } - ] + "description": "Description of payCol" }' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -10705,152 +10685,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetPriceLists - summary: List Price Lists - description: Retrieves a list of Price Lists. + '/payment-collections/{id}/authorize': + post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Set the status of PaymentCollection as Authorized + description: Sets the status of PaymentCollection as Authorized. x-authenticated: true parameters: - - in: query - name: limit - description: The number of items to get - schema: - type: number - default: '10' - - in: query - name: offset - description: The offset at which to get items - schema: - type: number - default: '0' - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. - schema: - type: string - - in: query - name: order - description: field to order results by. - schema: - type: string - - in: query + - in: path name: id - description: ID to search for. - schema: - type: string - - in: query - name: q - description: >- - query to search in price list description, price list name, and - customer group name fields. - schema: - type: string - - in: query - name: status - style: form - explode: false - description: Status to search for. - schema: - type: array - items: - type: string - enum: - - active - - draft - - in: query - name: name - description: price list name to search for. + required: true + description: The ID of the PaymentCollection. schema: type: string - - in: query - name: customer_groups - style: form - explode: false - description: Customer Group IDs to search for. - schema: - type: array - items: - type: string - - in: query - name: type - style: form - explode: false - description: Type to search for. - schema: - type: array - items: - type: string - enum: - - sale - - override - - in: query - name: created_at - description: Date comparison for when resulting price lists were created. - 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: Date comparison for when resulting price lists were updated. - 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: deleted_at - description: Date comparison for when resulting price lists were deleted. - 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 @@ -10862,43 +10709,32 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.list() - - .then(({ price_lists, limit, offset, count }) => { - console.log(price_lists.length); - }); + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/price-lists' \ + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - price_lists: - type: array - items: - $ref: '#/components/schemas/price_list' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -10911,17 +10747,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}': - delete: - operationId: DeletePriceListsPriceList - summary: Delete a Price List - description: Deletes a Price List + '/payments/{id}/capture': + post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Price List to delete. + description: The ID of the Payment. schema: type: string x-codeSamples: @@ -10935,41 +10771,33 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.delete(price_list_id) + medusa.admin.payments.capturePayment(payment_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ payment }) => { + console.log(payment.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/payments/{id}/capture' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Payment responses: '200': description: OK content: application/json: schema: + type: object properties: - id: - type: string - description: The ID of the deleted Price List. - object: - type: string - description: The type of the object that was deleted. - default: price-list - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + payment: + $ref: '#/components/schemas/payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10982,16 +10810,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/payments/{id}': get: - operationId: GetPriceListsPriceList - summary: Get a Price List - description: Retrieves a Price List. + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Price List. + description: The ID of the Payment. schema: type: string x-codeSamples: @@ -11005,32 +10834,33 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.retrieve(price_list_id) + medusa.admin.payments.retrieve(payment_id) - .then(({ price_list }) => { - console.log(price_list.id); + .then(({ payment }) => { + console.log(payment.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/price-lists/{id}' \ + 'https://medusa-url.com/admin/payments/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Payment responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + payment: + $ref: '#/components/schemas/payment' '400': $ref: '#/components/responses/400_error' '401': @@ -11043,101 +10873,37 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/payments/{id}/refund': post: - operationId: PostPriceListsPriceListPriceList - summary: Update a Price List - description: Updates a Price List + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Price List. + description: The ID of the Payment. schema: type: string requestBody: content: application/json: schema: + type: object + required: + - amount + - reason properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. type: string - enum: - - sale - - override - status: - description: The status of the Price List. + note: + description: A note with additional details about the Refund. type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -11149,40 +10915,45 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.update(price_list_id, { - name: 'New Price List' + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', }) - .then(({ price_list }) => { - console.log(price_list.id); + .then(({ payment }) => { + console.log(payment.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/price-lists/{id}' \ + 'https://medusa-url.com/admin/payments/pay_123/refund' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "New Price List" + "amount": 1000, + "reason": "return", + "note": "Do not like it" }' security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Payment responses: '200': description: OK content: application/json: schema: + type: object properties: - price_list: - $ref: '#/components/schemas/price_list' + refund: + $ref: '#/components/schemas/refund' '400': $ref: '#/components/responses/400_error' '401': @@ -11195,27 +10966,67 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/products/{product_id}/prices': - delete: - operationId: DeletePriceListsPriceListProductsProductPrices - summary: Delete Product's Prices - description: Delete all the prices related to a specific product in a price list + '/price-lists/{id}/prices/batch': + post: + operationId: PostPriceListsPriceListPricesBatch + summary: Update Prices + description: Batch update prices for a Price List x-authenticated: true parameters: - in: path name: id required: true - description: >- - The ID of the Price List that the Money Amounts that will be deleted - belongs to. - schema: - type: string - - in: path - name: product_id - required: true - description: The ID of the product from which the money amount will be deleted. + description: The ID of the Price List to update prices for. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices + associated with the Price List. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -11227,20 +11038,38 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.deleteProductPrices(price_list_id, - product_id) + medusa.admin.priceLists.addPrices(price_list_id, { + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) - .then(({ ids, object, deleted }) => { - console.log(ids.length); + .then(({ price_list }) => { + console.log(price_list.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' - \ + curl --location --request POST + 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "prices": [ + { + "amount": 100, + "variant_id": "afasfa", + "currency_code": "eur" + } + ] + }' security: - api_token: [] - cookie_auth: [] @@ -11252,20 +11081,10 @@ paths: content: application/json: schema: + type: object properties: - ids: - type: array - description: The price ids that have been deleted. - items: - type: string - object: - type: string - description: The type of the object that was deleted. - default: money-amount - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + price_list: + $ref: '#/components/schemas/price_list' '400': $ref: '#/components/responses/400_error' '401': @@ -11278,27 +11097,31 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/variants/{variant_id}/prices': delete: - operationId: DeletePriceListsPriceListVariantsVariantPrices - summary: Delete Variant's Prices - description: Delete all the prices related to a specific variant in a price list + operationId: DeletePriceListsPriceListPricesBatch + summary: Delete Prices + description: Batch delete prices that belong to a Price List x-authenticated: true parameters: - in: path name: id required: true description: >- - The ID of the Price List that the Money Amounts that will be deleted - belongs to. - schema: - type: string - - in: path - name: variant_id - required: true - description: The ID of the variant from which the money amount will be deleted. + The ID of the Price List that the Money Amounts (Prices) that will + be deleted belongs to. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -11310,20 +11133,30 @@ paths: // must be previously logged in or use api token - medusa.admin.priceLists.deleteVariantPrices(price_list_id, - variant_id) + medusa.admin.priceLists.deletePrices(price_list_id, { + price_ids: [ + price_id + ] + }) .then(({ ids, object, deleted }) => { - console.log(ids); + console.log(ids.length); }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' - \ + 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "price_ids": [ + "adasfa" + ] + }' security: - api_token: [] - cookie_auth: [] @@ -11335,12 +11168,13 @@ paths: content: application/json: schema: + type: object properties: ids: type: array - description: The price ids that have been deleted. items: type: string + description: The IDs of the deleted Money Amounts (Prices). object: type: string description: The type of the object that was deleted. @@ -11361,96 +11195,259 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/products': - get: - operationId: GetPriceListsPriceListProducts - summary: List Products - description: Retrieves a list of Product that are part of a Price List + /price-lists: + post: + operationId: PostPriceListsPriceList + summary: Create a Price List + description: Creates a Price List x-authenticated: true - parameters: - - in: path - name: id - required: true - description: ID of the price list. - schema: - type: string - - in: query - name: q - description: >- - Query used for searching product title and description, variant - title and sku, and collection title. - schema: - type: string - - in: query - name: id - description: ID of the product to search for. - schema: - type: string - - in: query - name: status - description: Product status to search for - style: form - explode: false - schema: - type: array - items: - type: string - enum: - - draft - - proposed - - published - - rejected + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: >- + The date with timezone that the Price List starts being + valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + import { PriceListType } from "@medusajs/medusa" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.create({ + name: 'New Price List', + description: 'A new price list', + type: PriceListType.SALE, + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/price-lists' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Price List", + "description": "A new price list", + "type": "sale", + "prices": [ + { + "amount": 1000, + "variant_id": "afafa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + price_list: + $ref: '#/components/schemas/price_list' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. + x-authenticated: true + parameters: - in: query - name: collection_id - description: Collection IDs to search for - style: form - explode: false + name: limit + description: The number of items to get schema: - type: array - items: - type: string + type: number + default: '10' - in: query - name: tags - description: Tag IDs to search for - style: form - explode: false + name: offset + description: The offset at which to get items schema: - type: array - items: - type: string + type: number + default: '0' - in: query - name: title - description: product title to search for. + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. schema: type: string - in: query - name: description - description: product description to search for. + name: order + description: field to order results by. schema: type: string - in: query - name: handle - description: product handle to search for. + name: id + description: ID to search for. schema: type: string - in: query - name: is_giftcard - description: Search for giftcards using is_giftcard=true. + name: q + description: >- + query to search in price list description, price list name, and + customer group name fields. schema: type: string - in: query - name: type - description: to search for. + name: status + style: form + explode: false + description: Status to search for. schema: - type: string + type: array + items: + type: string + enum: + - active + - draft - in: query - name: order - description: field to sort results by. + name: name + description: price list name to search for. schema: type: string + - in: query + name: customer_groups + style: form + explode: false + description: Customer Group IDs to search for. + schema: + type: array + items: + type: string + - in: query + name: type + style: form + explode: false + description: Type to search for. + schema: + type: array + items: + type: string + enum: + - sale + - override - in: query name: created_at - description: Date comparison for when resulting products were created. + description: Date comparison for when resulting price lists were created. schema: type: object properties: @@ -11472,7 +11469,7 @@ paths: format: date - in: query name: updated_at - description: Date comparison for when resulting products were updated. + description: Date comparison for when resulting price lists were updated. schema: type: object properties: @@ -11494,7 +11491,7 @@ paths: format: date - in: query name: deleted_at - description: Date comparison for when resulting products were deleted. + description: Date comparison for when resulting price lists were deleted. schema: type: object properties: @@ -11514,53 +11511,1981 @@ paths: type: string description: filter by dates greater than or equal to this date format: date - - in: query - name: offset - description: How many products to skip in the result. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.list() + + .then(({ price_lists, limit, offset, count }) => { + console.log(price_lists.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/price-lists' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + price_lists: + type: array + items: + $ref: '#/components/schemas/price_list' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}': + delete: + operationId: DeletePriceListsPriceList + summary: Delete a Price List + description: Deletes a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List to delete. schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of products returned. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.delete(price_list_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + default: price-list + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPriceListsPriceList + summary: Get a Price List + description: Retrieves a Price List. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. schema: - type: integer - default: 50 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.retrieve(price_list_id) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + price_list: + $ref: '#/components/schemas/price_list' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPriceListsPriceListPriceList + summary: Update a Price List + description: Updates a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. schema: type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: >- + The date with timezone that the Price List starts being + valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.update(price_list_id, { + name: 'New Price List' + }) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Price List" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + price_list: + $ref: '#/components/schemas/price_list' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/products/{product_id}/prices': + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete Product's Prices + description: Delete all the prices related to a specific product in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The ID of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: product_id + required: true + description: The ID of the product from which the money amount will be deleted. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.deleteProductPrices(price_list_id, + product_id) + + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/variants/{variant_id}/prices': + delete: + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete Variant's Prices + description: Delete all the prices related to a specific variant in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The ID of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the variant from which the money amount will be deleted. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.deleteVariantPrices(price_list_id, + variant_id) + + .then(({ ids, object, deleted }) => { + console.log(ids); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/products': + get: + operationId: GetPriceListsPriceListProducts + summary: List Products + description: Retrieves a list of Product that are part of a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the price list. + schema: + type: string + - in: query + name: q + description: >- + Query used for searching product title and description, variant + title and sku, and collection title. + schema: + type: string + - in: query + name: id + description: ID of the product to search for. + schema: + type: string + - in: query + name: status + description: Product status to search for + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + description: Collection IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: tags + description: Tag IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: title + description: product title to search for. + schema: + type: string + - in: query + name: description + description: product description to search for. + schema: + type: string + - in: query + name: handle + description: product handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: string + - in: query + name: type + description: to search for. + schema: + type: string + - in: query + name: order + description: field to sort results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting products were created. + 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: Date comparison for when resulting products were updated. + 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: deleted_at + description: Date comparison for when resulting products were deleted. + 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: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.listProducts(price_list_id) + + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/price-lists/{id}/products' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + products: + type: array + items: + $ref: '#/components/schemas/product' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-tags: + get: + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of tags to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + 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: Date comparison for when resulting product tags were updated. + 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: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productTags.list() + + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-tags' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tag + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product_tags: + $ref: '#/components/schemas/product_tag' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + 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: Date comparison for when resulting product types were updated. + 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: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productTypes.list() + + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-types' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product_types: + $ref: '#/components/schemas/product_type' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/options': + post: + operationId: PostProductsProductOptions + summary: Add an Option + x-authenticated: true + description: Adds a Product Option to a Product + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: >- + The title the Product Option will be identified by i.e. + "Size" + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.addOption(product_id, { + title: 'Size' + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/options' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product: + $ref: '#/components/schemas/product' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products: + post: + operationId: PostProducts + summary: Create a Product + x-authenticated: true + description: Creates a Product + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + is_giftcard: + description: >- + A flag to indicate if the Product represents a Gift Card. + Purchasing Products with this flag set to `true` will result + in a Gift Card being created. + type: boolean + default: false + discountable: + description: >- + A flag to indicate if discounts can be applied to the + LineItems generated from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on + which properties the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out + of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for + this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: >- + The Manufacturer Identification code for the Product + Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is + used. Only required if currency_code is not + provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the + price will be used. Only required if region_id + is not provided. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: >- + The minimum quantity for which the price will be + used. + type: integer + max_quantity: + description: >- + The maximum quantity for which the price will be + used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the + same index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.create({ + title: 'Shirt', + is_giftcard: false, + discountable: true + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Shirt" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product: + $ref: '#/components/schemas/product' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Product + x-authenticated: true + parameters: + - in: query + name: q + description: >- + Query used for searching product title and description, variant + title and sku, and collection title. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by product IDs. + schema: + oneOf: + - type: string + description: ID of the product to search for. + - type: array + items: + type: string + description: ID of a product. + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + style: form + explode: false + description: Collection ids to search for. + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: price_list_id + style: form + explode: false + description: Price List IDs to search for + schema: + type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: Sales Channel IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + 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: Date comparison for when resulting products were updated. + 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: deleted_at + description: Date comparison for when resulting products were deleted. + 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: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.list() + + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/products' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + products: + type: array + items: + $ref: '#/components/schemas/product' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/variants': + post: + operationId: PostProductsProductVariants + summary: Create a Product Variant + description: >- + Creates a Product Variant. Each Product Variant must have a unique + combination of Product Option Values. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: >- + The Manufacturer Identification code for the Product + Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.createVariant(product_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/variants' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ], + "options": [ + { + "option_id": "asdasf", + "value": "S" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product: + $ref: '#/components/schemas/product' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductsProductVariants + summary: List a Product's Variants + description: Retrieves a list of the Product Variants associated with a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the product to search for the variants. + schema: + type: string + - in: query + name: fields + description: Comma separated string of the column to select. + schema: + type: string + - in: query + name: expand + description: Comma separated string of the relations to include. + schema: + type: string + - in: query + name: offset + description: How many items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of items returned. schema: - type: string + type: integer + default: 100 x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.priceLists.listProducts(price_list_id) - - .then(({ products, limit, offset, count }) => { - console.log(products.length); - }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/price-lists/{id}/products' \ + 'https://medusa-url.com/admin/products/{id}/variants' \ --header 'Authorization: Bearer {api_token}' security: @@ -11574,11 +13499,12 @@ paths: content: application/json: schema: + type: object properties: - products: + variants: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/product_variant' count: type: integer description: The total number of items available @@ -11600,102 +13526,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /product-tags: - get: - operationId: GetProductTags - summary: List Product Tags - description: Retrieve a list of Product Tags. + '/products/{id}/options/{option_id}': + delete: + operationId: DeleteProductsProductOptionsOption + summary: Delete a Product Option + description: >- + Deletes a Product Option. Before a Product Option can be deleted all + Option Values for the Product Option must be the same. You may, for + example, have to delete some of your variants prior to deleting the + Product Option x-authenticated: true parameters: - - in: query - name: limit - description: The number of tags to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: order - description: The field to sort items by. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the tags. + - in: path + name: id + required: true + description: The ID of the Product. schema: type: string - - in: query - name: value - style: form - explode: false - description: The tag values to search for - schema: - type: array - items: - type: string - - in: query - name: q - description: A query string to search values for + - in: path + name: option_id + required: true + description: The ID of the Product Option. schema: type: string - - in: query - name: id - style: form - explode: false - description: The tag IDs to search for - schema: - type: array - items: - type: string - - in: query - name: created_at - description: Date comparison for when resulting product tags were created. - 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: Date comparison for when resulting product tags were updated. - 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 @@ -11707,41 +13560,44 @@ paths: // must be previously logged in or use api token - medusa.admin.productTags.list() + medusa.admin.products.deleteOption(product_id, option_id) - .then(({ product_tags }) => { - console.log(product_tags.length); + .then(({ option_id, object, delete, product }) => { + console.log(product.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/product-tags' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product Tag + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - product_tags: - $ref: '#/components/schemas/product_tag' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + option_id: + type: string + description: The ID of the deleted Product Option + object: + type: string + description: The type of the object that was deleted. + default: option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -11754,102 +13610,106 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /product-types: - get: - operationId: GetProductTypes - summary: List Product Types - description: Retrieve a list of Product Types. + post: + operationId: PostProductsProductOptionsOption + summary: Update a Product Option + description: Updates a Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: The title of the Product Option + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.updateOption(product_id, option_id, { + title: 'Size' + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product: + $ref: '#/components/schemas/product' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}': + delete: + operationId: DeleteProductsProduct + summary: Delete a Product + description: Deletes a Product and it's associated Product Variants. x-authenticated: true parameters: - - in: query - name: limit - description: The number of types to return. - schema: - type: integer - default: 20 - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: order - description: The field to sort items by. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the product types. - schema: - type: string - - in: query - name: value - style: form - explode: false - description: The type values to search for - schema: - type: array - items: - type: string - - in: query + - in: path name: id - style: form - explode: false - description: The type IDs to search for - schema: - type: array - items: - type: string - - in: query - name: q - description: A query string to search values for + required: true + description: The ID of the Product. schema: type: string - - in: query - name: created_at - description: Date comparison for when resulting product types were created. - 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: Date comparison for when resulting product types were updated. - 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 @@ -11861,41 +13721,42 @@ paths: // must be previously logged in or use api token - medusa.admin.productTypes.list() + medusa.admin.products.delete(product_id) - .then(({ product_types }) => { - console.log(product_types.length); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/product-types' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/products/asfsaf' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product Type + - Product responses: '200': description: OK content: application/json: schema: + type: object properties: - product_types: - $ref: '#/components/schemas/product_type' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + id: + type: string + description: The ID of the deleted Product. + object: + type: string + description: The type of the object that was deleted. + default: product + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -11908,12 +13769,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/options': - post: - operationId: PostProductsProductOptions - summary: Add an Option + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. x-authenticated: true - description: Adds a Product Option to a Product parameters: - in: path name: id @@ -11921,18 +13781,6 @@ paths: description: The ID of the Product. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - title - properties: - title: - description: >- - The title the Product Option will be identified by i.e. - "Size" - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -11944,9 +13792,7 @@ paths: // must be previously logged in or use api token - medusa.admin.products.addOption(product_id, { - title: 'Size' - }) + medusa.admin.products.retrieve(product_id) .then(({ product }) => { console.log(product.id); @@ -11954,16 +13800,10 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/options' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/products/{id}' \ - --data-raw '{ - "title": "Size" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -11975,6 +13815,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -11990,18 +13831,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /products: post: - operationId: PostProducts - summary: Create a Product + operationId: PostProductsProduct + summary: Update a Product + description: Updates a Product x-authenticated: true - description: Creates a Product + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string requestBody: content: application/json: schema: - required: - - title + type: object properties: title: description: The title of the Product @@ -12012,19 +13858,11 @@ paths: description: description: A description of the Product. type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result - in a Gift Card being created. - type: boolean - default: false discountable: description: >- A flag to indicate if discounts can be applied to the LineItems generated from this Product type: boolean - default: true images: description: Images of the Product. type: array @@ -12044,7 +13882,6 @@ paths: - proposed - published - rejected - default: draft type: description: The Product Type to associate the Product with. type: object @@ -12083,25 +13920,14 @@ paths: id: description: The ID of an existing Sales channel. type: string - options: - description: >- - The Options that the Product should have. These define on - which properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string variants: description: A list of Product Variants to create with the Product. type: array items: - required: - - title properties: + id: + description: The ID of the Product Variant. + type: string title: description: The title to identify the Product Variant by. type: string @@ -12123,7 +13949,6 @@ paths: inventory_quantity: description: The amount of stock kept for the Product Variant. type: integer - default: 0 allow_backorder: description: >- Whether the Product Variant can be purchased when out @@ -12168,6 +13993,9 @@ paths: required: - amount properties: + id: + description: The ID of the Price. + type: string region_id: description: >- The ID of the Region for which the price is @@ -12201,15 +14029,19 @@ paths: type: array items: required: + - option_id - value properties: + option_id: + description: The ID of the Option. + type: string value: description: >- The value to give for the Product Option at the same index in the Product's `options` field. type: string weight: - description: The weight of the Product. + description: The wieght of the Product. type: number length: description: The length of the Product. @@ -12220,9 +14052,6 @@ paths: width: description: The width of the Product. type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string origin_country: description: The country of origin of the Product. type: string @@ -12248,10 +14077,9 @@ paths: // must be previously logged in or use api token - medusa.admin.products.create({ + medusa.admin.products.update(product_id, { title: 'Shirt', - is_giftcard: false, - discountable: true + images: [] }) .then(({ product }) => { @@ -12261,14 +14089,14 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products' \ + 'https://medusa-url.com/admin/products/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "Shirt" + "title": "Size" }' security: - api_token: [] @@ -12281,6 +14109,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12291,211 +14120,28 @@ paths: '404': $ref: '#/components/responses/not_found_error' '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetProducts - summary: List Products - description: Retrieves a list of Product - x-authenticated: true - parameters: - - in: query - name: q - description: >- - Query used for searching product title and description, variant - title and sku, and collection title. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the product. - schema: - type: string - - in: query + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/variants/{variant_id}': + delete: + operationId: DeleteProductsProductVariantsVariant + summary: Delete a Product Variant + description: Deletes a Product Variant. + x-authenticated: true + parameters: + - in: path name: id - style: form - explode: false - description: Filter by product IDs. - schema: - oneOf: - - type: string - description: ID of the product to search for. - - type: array - items: - type: string - description: ID of a product. - - in: query - name: status - style: form - explode: false - description: Status to search for - schema: - type: array - items: - type: string - enum: - - draft - - proposed - - published - - rejected - - in: query - name: collection_id - style: form - explode: false - description: Collection ids to search for. - schema: - type: array - items: - type: string - - in: query - name: tags - style: form - explode: false - description: Tag IDs to search for - schema: - type: array - items: - type: string - - in: query - name: price_list_id - style: form - explode: false - description: Price List IDs to search for - schema: - type: array - items: - type: string - - in: query - name: sales_channel_id - style: form - explode: false - description: Sales Channel IDs to filter products by - schema: - type: array - items: - type: string - - in: query - name: type_id - style: form - explode: false - description: Type IDs to filter products by - schema: - type: array - items: - type: string - - in: query - name: title - description: title to search for. - schema: - type: string - - in: query - name: description - description: description to search for. - schema: - type: string - - in: query - name: handle - description: handle to search for. - schema: - type: string - - in: query - name: is_giftcard - description: Search for giftcards using is_giftcard=true. - schema: - type: boolean - - in: query - name: created_at - description: Date comparison for when resulting products were created. - 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: Date comparison for when resulting products were updated. - 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: deleted_at - description: Date comparison for when resulting products were deleted. - 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: offset - description: How many products to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: integer - default: 50 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. + required: true + description: The ID of the Product. schema: type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. schema: type: string x-codeSamples: @@ -12509,16 +14155,16 @@ paths: // must be previously logged in or use api token - medusa.admin.products.list() + medusa.admin.products.deleteVariant(product_id, variant_id) - .then(({ products, limit, offset, count }) => { - console.log(products.length); + .then(({ variant_id, object, deleted, product }) => { + console.log(product.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/products' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -12532,20 +14178,21 @@ paths: content: application/json: schema: + type: object properties: - products: - type: array - items: - $ref: '#/components/schemas/product' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + variant_id: + type: string + description: The ID of the deleted Product Variant. + object: + type: string + description: The type of the object that was deleted. + default: variant + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/product' '400': $ref: '#/components/responses/400_error' '401': @@ -12558,13 +14205,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/variants': post: - operationId: PostProductsProductVariants - summary: Create a Product Variant - description: >- - Creates a Product Variant. Each Product Variant must have a unique - combination of Product Option Values. + operationId: PostProductsProductVariantsVariant + summary: Update a Product Variant + description: Update a Product Variant. x-authenticated: true parameters: - in: path @@ -12573,14 +14217,19 @@ paths: description: The ID of the Product. schema: type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string requestBody: content: application/json: schema: + type: object required: - - title - prices - - options properties: title: description: The title to identify the Product Variant by. @@ -12603,7 +14252,6 @@ paths: inventory_quantity: description: The amount of stock kept for the Product Variant. type: integer - default: 0 allow_backorder: description: >- Whether the Product Variant can be purchased when out of @@ -12615,7 +14263,7 @@ paths: Product Variant. type: boolean weight: - description: The wieght of the Product Variant. + description: The weight of the Product Variant. type: number length: description: The length of the Product Variant. @@ -12698,7 +14346,7 @@ paths: // must be previously logged in or use api token - medusa.admin.products.createVariant(product_id, { + medusa.admin.products.updateVariant(product_id, variant_id, { title: 'Color', prices: [ { @@ -12722,7 +14370,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/variants' \ + 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ --header 'Authorization: Bearer {api_token}' \ @@ -12735,12 +14383,6 @@ paths: "amount": 1000, "currency_code": "eur" } - ], - "options": [ - { - "option_id": "asdasf", - "value": "S" - } ] }' security: @@ -12754,6 +14396,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12769,73 +14412,61 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /products/tag-usage: get: - operationId: GetProductsProductVariants - summary: List a Product's Variants - description: Retrieves a list of the Product Variants associated with a Product. + operationId: GetProductsTagUsage + summary: List Tags Usage Number + description: Retrieves a list of Product Tags with how many times each is used. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: ID of the product to search for the variants. - schema: - type: string - - in: query - name: fields - description: Comma separated string of the column to select. - schema: - type: string - - in: query - name: expand - description: Comma separated string of the relations to include. - schema: - type: string - - in: query - name: offset - description: How many items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of items returned. - schema: - type: integer - default: 100 x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.listTags() + + .then(({ tags }) => { + console.log(tags.length); + }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/products/{id}/variants' \ + 'https://medusa-url.com/admin/products/tag-usage' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product + - Product Tag responses: '200': description: OK content: application/json: schema: + type: object properties: - variants: + tags: type: array items: - $ref: '#/components/schemas/product_variant' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + properties: + id: + description: The ID of the tag. + type: string + usage_count: + description: The number of products that use this tag. + type: string + value: + description: The value of the tag. + type: string '400': $ref: '#/components/responses/400_error' '401': @@ -12848,29 +14479,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/options/{option_id}': - delete: - operationId: DeleteProductsProductOptionsOption - summary: Delete a Product Option - description: >- - Deletes a Product Option. Before a Product Option can be deleted all - Option Values for the Product Option must be the same. You may, for - example, have to delete some of your variants prior to deleting the - Product Option + /products/types: + get: + deprecated: true + operationId: GetProductsTypes + summary: List Product Types + description: Retrieves a list of Product Types. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: option_id - required: true - description: The ID of the Product Option. - schema: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -12882,16 +14497,16 @@ paths: // must be previously logged in or use api token - medusa.admin.products.deleteOption(product_id, option_id) + medusa.admin.products.listTypes() - .then(({ option_id, object, delete, product }) => { - console.log(product.id); + .then(({ types }) => { + console.log(types.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + curl --location --request GET + 'https://medusa-url.com/admin/products/types' \ --header 'Authorization: Bearer {api_token}' security: @@ -12905,20 +14520,12 @@ paths: content: application/json: schema: + type: object properties: - option_id: - type: string - description: The ID of the deleted Product Option - object: - type: string - description: The type of the object that was deleted. - default: option - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - product: - $ref: '#/components/schemas/product' + types: + type: array + items: + $ref: '#/components/schemas/product_type' '400': $ref: '#/components/responses/400_error' '401': @@ -12931,10 +14538,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/products/{id}/metadata': post: - operationId: PostProductsProductOptionsOption - summary: Update a Product Option - description: Updates a Product Option + operationId: PostProductsProductMetadata + summary: Set Product Metadata + description: Set metadata key/value pair for Product x-authenticated: true parameters: - in: path @@ -12943,21 +14551,20 @@ paths: description: The ID of the Product. schema: type: string - - in: path - name: option_id - required: true - description: The ID of the Product Option. - schema: - type: string requestBody: content: application/json: schema: + type: object required: - - title + - key + - value properties: - title: - description: The title of the Product Option + key: + description: The metadata key + type: string + value: + description: The metadata value type: string x-codeSamples: - lang: JavaScript @@ -12970,8 +14577,10 @@ paths: // must be previously logged in or use api token - medusa.admin.products.updateOption(product_id, option_id, { - title: 'Size' + medusa.admin.products.setMetadata(product_id, { + + key: 'test', + value: 'true' }) .then(({ product }) => { @@ -12981,14 +14590,15 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + 'https://medusa-url.com/admin/products/{id}/metadata' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "Size" + "key": "test", + "value": "true" }' security: - api_token: [] @@ -13001,6 +14611,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13016,19 +14627,39 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}': - delete: - operationId: DeleteProductsProduct - summary: Delete a Product - description: Deletes a Product and it's associated Product Variants. + '/publishable-api-keys/{id}/sales-channels/batch': + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add sales channel to a publishable api key scope + description: Assign a batch of sales channels to a publishable api key. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product. + description: The ID of the Publishable Api Key. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to add to the publishable api + key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel x-codeSamples: - lang: JavaScript label: JS Client @@ -13040,23 +14671,40 @@ paths: // must be previously logged in or use api token - medusa.admin.products.delete(product_id) + medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/asfsaf' \ + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - Publishable Api Key responses: '200': description: OK @@ -13064,17 +14712,8 @@ paths: application/json: schema: properties: - id: - type: string - description: The ID of the deleted Product. - object: - type: string - description: The type of the object that was deleted. - default: product - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13087,18 +14726,38 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetProductsProduct - summary: Get a Product - description: Retrieves a Product. + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Remove sales channel from a publishable api key scope + description: Remove a batch of sales channels from a publishable api key. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product. + description: The ID of the Publishable Api Key. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to delete from the publishable + api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel x-codeSamples: - lang: JavaScript label: JS Client @@ -13110,23 +14769,40 @@ paths: // must be previously logged in or use api token - medusa.admin.products.retrieve(product_id) + medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) - .then(({ product }) => { - console.log(product.id); + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/{id}' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - Publishable Api Key responses: '200': description: OK @@ -13134,8 +14810,8 @@ paths: application/json: schema: properties: - product: - $ref: '#/components/schemas/product' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13148,240 +14824,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /publishable-api-keys: post: - operationId: PostProductsProduct - summary: Update a Product - description: Updates a Product - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string + operationId: PostPublishableApiKeys + summary: Create a PublishableApiKey + description: Creates a PublishableApiKey. requestBody: content: application/json: schema: + type: object + required: + - title properties: title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. + description: A title for the publishable api key type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -13391,43 +14850,36 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - - medusa.admin.products.update(product_id, { - title: 'Shirt', - images: [] - }) - - .then(({ product }) => { - console.log(product.id); - }); + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.create() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ + 'https://medusa-url.com/admin/publishable-api-keys' \ - --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' - --data-raw '{ - "title": "Size" - }' + -d '{ "created_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13440,23 +14892,37 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/variants/{variant_id}': - delete: - operationId: DeleteProductsProductVariantsVariant - summary: Delete a Product Variant - description: Deletes a Product Variant. + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. x-authenticated: true parameters: - - in: path - name: id - required: true - description: The ID of the Product. + - in: query + name: q + description: Query used for searching publishable api keys by title. schema: type: string - - in: path - name: variant_id - required: true - description: The ID of the Product Variant. + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -13470,43 +14936,33 @@ paths: // must be previously logged in or use api token - medusa.admin.products.deleteVariant(product_id, variant_id) - - .then(({ variant_id, object, deleted, product }) => { - console.log(product.id); - }); + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) + }) - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKeys responses: '200': description: OK content: application/json: schema: + type: object properties: - variant_id: - type: string - description: The ID of the deleted Product Variant. - object: - type: string - description: The type of the object that was deleted. - default: variant - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - product: - $ref: '#/components/schemas/product' + publishable_api_keys: + type: array + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13519,135 +14975,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostProductsProductVariantsVariant - summary: Update a Product Variant - description: Update a Product Variant. + '/publishable-api-keys/{id}': + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: variant_id - required: true - description: The ID of the Product Variant. + description: The ID of the PublishableApiKeys to delete. schema: type: string - requestBody: - content: - application/json: - schema: - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13659,59 +14999,94 @@ paths: // must be previously logged in or use api token - medusa.admin.products.updateVariant(product_id, variant_id, { - title: 'Color', - prices: [ - { - amount: 1000, - currency_code: "eur" - } - ], - options: [ - { - option_id, - value: 'S' - } - ], - inventory_quantity: 100 - }) + medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + format: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" - .then(({ product }) => { - console.log(product.id); - }); + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ - - --header 'Authorization: Bearer {api_token}' \ + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ - --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' - --data-raw '{ - "title": "Color", - "prices": [ - { - "amount": 1000, - "currency_code": "eur" - } - ] - }' + -d '{ "created_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13724,11 +15099,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /products/tag-usage: + '/publishable-api-keys/:id/sales-channels': get: - operationId: GetProductsTagUsage - summary: List Tags Usage Number - description: Retrieves a list of Product Tags with how many times each is used. + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels x-authenticated: true x-codeSamples: - lang: JavaScript @@ -13741,23 +15116,23 @@ paths: // must be previously logged in or use api token - medusa.admin.products.listTags() - - .then(({ tags }) => { - console.log(tags.length); - }); + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/products/tag-usage' \ + 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Product Tag + - PublishableApiKeySalesChannels responses: '200': description: OK @@ -13765,19 +15140,10 @@ paths: application/json: schema: properties: - tags: + sales_channels: type: array items: - properties: - id: - description: The ID of the tag. - type: string - usage_count: - description: The number of products that use this tag. - type: string - value: - description: The value of the tag. - type: string + $ref: '#/components/schemas/sales_channel' '400': $ref: '#/components/responses/400_error' '401': @@ -13790,12 +15156,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /products/types: - get: - deprecated: true - operationId: GetProductsTypes - summary: List Product Types - description: Retrieves a list of Product Types. + '/publishable-api-keys/{id}/revoke': + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string x-authenticated: true x-codeSamples: - lang: JavaScript @@ -13808,34 +15180,35 @@ paths: // must be previously logged in or use api token - medusa.admin.products.listTypes() - - .then(({ types }) => { - console.log(types.length); - }); + medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/types' \ + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' + \ --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123", "revoked_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - types: - type: array - items: - $ref: '#/components/schemas/product_type' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13848,32 +15221,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/metadata': + '/publishable-api-key/{id}': post: - operationId: PostProductsProductMetadata - summary: Set Product Metadata - description: Set metadata key/value pair for Product + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product. + description: The ID of the PublishableApiKey. schema: type: string requestBody: content: application/json: schema: - required: - - key - - value + type: object properties: - key: - description: The metadata key - type: string - value: - description: The metadata value + title: + description: A title to update for the key. type: string x-codeSamples: - lang: JavaScript @@ -13886,43 +15254,40 @@ paths: // must be previously logged in or use api token - medusa.admin.products.setMetadata(product_id, { - - key: 'test', - value: 'true' + medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" }) - - .then(({ product }) => { - console.log(product.id); - }); + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/metadata' \ + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "key": "test", - "value": "true" + "title": "updated title" }' security: - api_token: [] - cookie_auth: [] tags: - - Product + - PublishableApiKey responses: '200': description: OK content: application/json: schema: + type: object properties: - product: - $ref: '#/components/schemas/product' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -13952,6 +15317,7 @@ paths: content: application/json: schema: + type: object required: - country_code properties: @@ -14004,6 +15370,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14036,6 +15403,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14084,6 +15452,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14116,6 +15485,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14164,6 +15534,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14189,6 +15560,7 @@ paths: content: application/json: schema: + type: object required: - name - currency_code @@ -14302,6 +15674,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14395,6 +15768,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -14468,6 +15842,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -14538,6 +15913,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14569,6 +15945,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Region @@ -14667,6 +16044,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14729,6 +16107,7 @@ paths: content: application/json: schema: + type: object properties: fulfillment_options: type: array @@ -14812,6 +16191,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14881,6 +16261,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14950,6 +16331,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14975,6 +16357,7 @@ paths: content: application/json: schema: + type: object required: - label - value @@ -15042,6 +16425,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -15096,6 +16480,7 @@ paths: content: application/json: schema: + type: object properties: return_reasons: type: array @@ -15160,6 +16545,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -15230,6 +16616,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -15261,6 +16648,7 @@ paths: content: application/json: schema: + type: object properties: label: description: The label to display to the Customer. @@ -15320,6 +16708,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -15381,6 +16770,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -15448,6 +16838,7 @@ paths: content: application/json: schema: + type: object properties: returns: type: array @@ -15492,6 +16883,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -15564,6 +16956,7 @@ paths: content: application/json: schema: + type: object properties: return: $ref: '#/components/schemas/return' @@ -15596,6 +16989,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15660,6 +17054,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15691,6 +17086,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15755,6 +17151,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15780,6 +17177,7 @@ paths: content: application/json: schema: + type: object required: - name properties: @@ -15835,6 +17233,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16007,6 +17406,7 @@ paths: content: application/json: schema: + type: object properties: sales_channels: type: array @@ -16080,6 +17480,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16150,6 +17551,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16181,6 +17583,7 @@ paths: content: application/json: schema: + type: object properties: name: type: string @@ -16233,6 +17636,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16258,6 +17662,7 @@ paths: content: application/json: schema: + type: object required: - name - region_id @@ -16383,6 +17788,7 @@ paths: content: application/json: schema: + type: object properties: shipping_option: $ref: '#/components/schemas/shipping_option' @@ -16453,6 +17859,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -16520,6 +17927,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16590,6 +17998,7 @@ paths: content: application/json: schema: + type: object properties: shipping_option: $ref: '#/components/schemas/shipping_option' @@ -16621,6 +18030,7 @@ paths: content: application/json: schema: + type: object required: - requirements properties: @@ -16717,6 +18127,7 @@ paths: content: application/json: schema: + type: object properties: shipping_option: $ref: '#/components/schemas/shipping_option' @@ -16742,6 +18153,7 @@ paths: content: application/json: schema: + type: object required: - name properties: @@ -16790,6 +18202,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profile: $ref: '#/components/schemas/shipping_profile' @@ -16844,6 +18257,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profiles: type: array @@ -16908,6 +18322,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16978,6 +18393,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profile: $ref: '#/components/schemas/shipping_profile' @@ -17008,6 +18424,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Shipping Profile @@ -17054,6 +18471,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profile: $ref: '#/components/schemas/shipping_profile' @@ -17119,6 +18537,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17183,6 +18602,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17236,6 +18656,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17260,6 +18681,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Store @@ -17337,6 +18759,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17356,129 +18779,8 @@ paths: get: operationId: GetStorePaymentProviders summary: List Payment Providers - description: Retrieves the configured Payment Providers - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.listPaymentProviders() - - .then(({ payment_providers }) => { - console.log(payment_providers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/store/payment-providers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_providers: - type: array - items: - $ref: '#/components/schemas/payment_provider' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /store/tax-providers: - get: - operationId: GetStoreTaxProviders - summary: List Tax Providers - description: Retrieves the configured Tax Providers - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.listTaxProviders() - - .then(({ tax_providers }) => { - console.log(tax_providers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/store/tax-providers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - tax_providers: - type: array - items: - $ref: '#/components/schemas/tax_provider' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/swaps/{id}': - get: - operationId: GetSwapsSwap - summary: Get a Swap - description: Retrieves a Swap. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Swap. - schema: - type: string + description: Retrieves the configured Payment Providers + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -17490,32 +18792,35 @@ paths: // must be previously logged in or use api token - medusa.admin.swaps.retrieve(swap_id) + medusa.admin.store.listPaymentProviders() - .then(({ swap }) => { - console.log(swap.id); + .then(({ payment_providers }) => { + console.log(payment_providers.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/swaps/{id}' \ + 'https://medusa-url.com/admin/store/payment-providers' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Store responses: '200': description: OK content: application/json: schema: + type: object properties: - swap: - $ref: '#/components/schemas/swap' + payment_providers: + type: array + items: + $ref: '#/components/schemas/payment_provider' '400': $ref: '#/components/responses/400_error' '401': @@ -17528,24 +18833,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /swaps: + /store/tax-providers: get: - operationId: GetSwaps - summary: List Swaps - description: Retrieves a list of Swaps. - parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. - schema: - type: number - default: '0' + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers x-authenticated: true x-codeSamples: - lang: JavaScript @@ -17558,41 +18850,35 @@ paths: // must be previously logged in or use api token - medusa.admin.swaps.list() + medusa.admin.store.listTaxProviders() - .then(({ swaps }) => { - console.log(swaps.length); + .then(({ tax_providers }) => { + console.log(tax_providers.length); }); - lang: Shell label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/swaps' \ + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/tax-providers' \ + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Store responses: '200': description: OK content: application/json: schema: + type: object properties: - swaps: + tax_providers: type: array items: - $ref: '#/components/schemas/swap' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + $ref: '#/components/schemas/tax_provider' '400': $ref: '#/components/responses/400_error' '401': @@ -17640,6 +18926,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17696,6 +18983,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17745,6 +19033,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17801,6 +19090,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17851,6 +19141,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -17905,6 +19196,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17954,6 +19246,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -18010,6 +19303,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18060,6 +19354,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18117,6 +19412,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18166,6 +19462,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18223,6 +19520,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18267,6 +19565,7 @@ paths: content: application/json: schema: + type: object required: - code - name @@ -18349,6 +19648,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18477,6 +19777,7 @@ paths: content: application/json: schema: + type: object properties: tax_rates: type: array @@ -18550,6 +19851,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -18638,6 +19940,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18687,6 +19990,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -18761,6 +20065,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18776,6 +20081,147 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/swaps/{id}': + get: + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.swaps.retrieve(swap_id) + + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/swaps/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + swap: + $ref: '#/components/schemas/swap' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps: + get: + operationId: GetSwaps + summary: List Swaps + description: Retrieves a list of Swaps. + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.swaps.list() + + .then(({ swaps }) => { + console.log(swaps.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + swaps: + type: array + items: + $ref: '#/components/schemas/swap' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /uploads/protected: post: operationId: PostUploadsProtected @@ -18833,6 +20279,7 @@ paths: content: application/json: schema: + type: object properties: uploads: type: array @@ -18912,6 +20359,7 @@ paths: content: application/json: schema: + type: object properties: uploads: type: array @@ -18944,6 +20392,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -19013,6 +20462,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19065,6 +20515,7 @@ paths: content: application/json: schema: + type: object properties: users: type: array @@ -19129,6 +20580,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -19199,6 +20651,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19230,6 +20683,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The name of the User. @@ -19294,6 +20748,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19319,6 +20774,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -19391,6 +20847,7 @@ paths: content: application/json: schema: + type: object required: - token - password @@ -19450,6 +20907,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19597,6 +21055,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -19901,6 +21360,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -19955,6 +21415,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -20038,6 +21499,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -20180,6 +21642,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -20357,6 +21820,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -20400,6 +21864,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -20487,6 +21952,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -20608,6 +22074,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -20640,6 +22107,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -20694,6 +22162,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -20729,6 +22198,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -20787,6 +22257,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -20834,6 +22305,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -20851,7 +22323,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -20907,6 +22379,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -20942,6 +22415,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -20977,6 +22451,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -21012,6 +22487,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -21047,6 +22523,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -21082,6 +22559,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -21179,6 +22657,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -21246,6 +22725,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -21338,6 +22818,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -21412,6 +22893,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -21443,6 +22925,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -21466,6 +22949,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -21581,6 +23065,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -21627,6 +23112,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -21698,6 +23184,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -21752,6 +23239,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -21784,6 +23272,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -21835,6 +23324,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -21875,6 +23365,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -21925,6 +23416,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -22119,6 +23611,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -22202,6 +23695,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -22253,6 +23747,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -22275,6 +23770,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -22342,6 +23838,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -22405,6 +23902,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -22438,6 +23936,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -22566,6 +24065,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -22623,6 +24123,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -22901,6 +24402,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -22926,12 +24428,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -22941,12 +24438,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -22998,6 +24489,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -23022,6 +24514,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -23095,6 +24588,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -23192,6 +24686,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -23268,6 +24763,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -23317,6 +24813,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -23375,6 +24872,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -23422,6 +24920,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -23456,6 +24955,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -23493,6 +24993,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -23530,6 +25031,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -23566,6 +25068,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -23719,6 +25222,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -23762,6 +25266,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -23952,6 +25457,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -23959,6 +25520,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -24025,6 +25587,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -24129,6 +25692,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -24187,6 +25751,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -24241,6 +25806,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -24341,6 +25907,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -24376,6 +25943,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -24425,6 +25993,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -24509,6 +26078,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -24557,6 +26127,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -24663,6 +26234,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -24726,6 +26298,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -24761,6 +26334,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -24780,6 +26354,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -24847,6 +26422,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -24994,6 +26570,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -25031,6 +26608,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -25049,6 +26627,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -25132,6 +26711,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -25185,6 +26765,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -25228,6 +26809,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -25242,6 +26824,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/admin/code_samples/JavaScript/discounts/postundefined b/docs/api/admin/code_samples/JavaScript/discounts/postundefined index f1c7752ee9407..fdb9dae2a3641 100644 --- a/docs/api/admin/code_samples/JavaScript/discounts/postundefined +++ b/docs/api/admin/code_samples/JavaScript/discounts/postundefined @@ -9,6 +9,7 @@ medusa.admin.discounts.create({ value: 10, allocation: AllocationType.ITEM }, + regions: ['reg_XXXXXXXX'], is_dynamic: false, is_disabled: false }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined new file mode 100644 index 0000000000000..ea5b7cb00aaec --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined new file mode 100644 index 0000000000000..828a767d010bd --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined new file mode 100644 index 0000000000000..d91153b57c7a3 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" +}) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined new file mode 100644 index 0000000000000..e485af9bb759c --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined new file mode 100644 index 0000000000000..cad6523dccf56 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.payments.retrieve(payment_id) +.then(({ payment }) => { + console.log(payment.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined new file mode 100644 index 0000000000000..1fa9f7aac8835 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.payments.capturePayment(payment_id) +.then(({ payment }) => { + console.log(payment.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined new file mode 100644 index 0000000000000..ead604e8651dc --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined @@ -0,0 +1,11 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', +}) +.then(({ payment }) => { + console.log(payment.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined new file mode 100644 index 0000000000000..5559f00ea4dc6 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" +}) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined new file mode 100644 index 0000000000000..893936cf51ff7 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined new file mode 100644 index 0000000000000..7daeb2fc03d6f --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.create() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined new file mode 100644 index 0000000000000..b7039a418b5ea --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined new file mode 100644 index 0000000000000..1b290cbee8d54 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined new file mode 100644 index 0000000000000..875ac03a4b923 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined new file mode 100644 index 0000000000000..f3bd1513b77d5 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined new file mode 100644 index 0000000000000..84e874b3a2e74 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined @@ -0,0 +1,13 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] +}) +.then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined new file mode 100644 index 0000000000000..a74d1ede9f2a9 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined @@ -0,0 +1,13 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] +}) +.then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); +}); diff --git a/docs/api/admin/code_samples/Shell/discounts/postundefined b/docs/api/admin/code_samples/Shell/discounts/postundefined index acfcb88663b73..d0cb7fb00ce38 100644 --- a/docs/api/admin/code_samples/Shell/discounts/postundefined +++ b/docs/api/admin/code_samples/Shell/discounts/postundefined @@ -7,5 +7,6 @@ curl --location --request POST 'https://medusa-url.com/admin/discounts' \ "type": "fixed", "value": 10, "allocation": "item" - } + }, + "regions": ['reg_XXXXXXXX'] }' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined new file mode 100644 index 0000000000000..d3e5e0f82fbf0 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined @@ -0,0 +1,2 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined new file mode 100644 index 0000000000000..9aeebfd8fa67a --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/payment-collections/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined new file mode 100644 index 0000000000000..4428893266a90 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined @@ -0,0 +1,6 @@ +curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "description": "Description of payCol" +}' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined new file mode 100644 index 0000000000000..3fcd7013dc67f --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined @@ -0,0 +1,2 @@ +curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payments_{id}/getundefined b/docs/api/admin/code_samples/Shell/payments_{id}/getundefined new file mode 100644 index 0000000000000..4b52cbf845eae --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payments_{id}/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined b/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined new file mode 100644 index 0000000000000..a73c22dc9bd21 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined @@ -0,0 +1,2 @@ +curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined b/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined new file mode 100644 index 0000000000000..4667ba8b2590b --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined @@ -0,0 +1,8 @@ +curl --location --request POST 'https://medusa-url.com/admin/payments/pay_123/refund' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" +}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined new file mode 100644 index 0000000000000..c52824266e157 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined @@ -0,0 +1,6 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "title": "updated title" +}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined new file mode 100644 index 0000000000000..919cda1ff0fae --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined new file mode 100644 index 0000000000000..87b05f49be918 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined @@ -0,0 +1,3 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \ +--header 'Authorization: Bearer {api_token}' +-d '{ "created_by": "user_123" }' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined new file mode 100644 index 0000000000000..f3845038b67e0 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined new file mode 100644 index 0000000000000..41922603bee0f --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined @@ -0,0 +1,2 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined new file mode 100644 index 0000000000000..3a3f1a00ede7d --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined @@ -0,0 +1,3 @@ +curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ +--header 'Authorization: Bearer {api_token}' +-d '{ "created_by": "user_123" }' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined new file mode 100644 index 0000000000000..f742a92ad3261 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined @@ -0,0 +1,3 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' \ +--header 'Authorization: Bearer {api_token}' +-d '{ "created_by": "user_123", "revoked_by": "user_123" }' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined new file mode 100644 index 0000000000000..390c392a78546 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined @@ -0,0 +1,10 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] +}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined new file mode 100644 index 0000000000000..6c7fc9369f586 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined @@ -0,0 +1,10 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] +}' diff --git a/docs/api/admin/components/schemas/OAuth.yaml b/docs/api/admin/components/schemas/OAuth.yaml index a9afba0974fb4..6b6cb8b660290 100644 --- a/docs/api/admin/components/schemas/OAuth.yaml +++ b/docs/api/admin/components/schemas/OAuth.yaml @@ -1,6 +1,7 @@ title: OAuth description: Represent an OAuth app x-resourceId: OAuth +type: object required: - id - display_name diff --git a/docs/api/admin/components/schemas/address.yaml b/docs/api/admin/components/schemas/address.yaml index ff413792f1c9e..d39d1760ae183 100644 --- a/docs/api/admin/components/schemas/address.yaml +++ b/docs/api/admin/components/schemas/address.yaml @@ -1,6 +1,7 @@ title: Address description: An address. x-resourceId: address +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/address_fields.yaml b/docs/api/admin/components/schemas/address_fields.yaml index 110810299c65b..303b9d5ca9e36 100644 --- a/docs/api/admin/components/schemas/address_fields.yaml +++ b/docs/api/admin/components/schemas/address_fields.yaml @@ -1,6 +1,7 @@ title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address +type: object properties: company: type: string diff --git a/docs/api/admin/components/schemas/batch_job.yaml b/docs/api/admin/components/schemas/batch_job.yaml index dcb63d5f55f8d..c06c261ba5a24 100644 --- a/docs/api/admin/components/schemas/batch_job.yaml +++ b/docs/api/admin/components/schemas/batch_job.yaml @@ -1,6 +1,7 @@ title: Batch Job description: A Batch Job. x-resourceId: batch_job +type: object required: - type properties: diff --git a/docs/api/admin/components/schemas/cart.yaml b/docs/api/admin/components/schemas/cart.yaml index 0881621115781..de1d520a2dbfd 100644 --- a/docs/api/admin/components/schemas/cart.yaml +++ b/docs/api/admin/components/schemas/cart.yaml @@ -1,6 +1,7 @@ title: Cart description: Represents a user cart x-resourceId: cart +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/claim_image.yaml b/docs/api/admin/components/schemas/claim_image.yaml index 5b2d04e74b297..783d89c06d29b 100644 --- a/docs/api/admin/components/schemas/claim_image.yaml +++ b/docs/api/admin/components/schemas/claim_image.yaml @@ -1,6 +1,7 @@ title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image +type: object required: - claim_item_id - url diff --git a/docs/api/admin/components/schemas/claim_item.yaml b/docs/api/admin/components/schemas/claim_item.yaml index ccec3c8ebf1bf..cb7e85c9dde55 100644 --- a/docs/api/admin/components/schemas/claim_item.yaml +++ b/docs/api/admin/components/schemas/claim_item.yaml @@ -3,6 +3,7 @@ description: >- Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item +type: object required: - claim_order_id - item_id diff --git a/docs/api/admin/components/schemas/claim_order.yaml b/docs/api/admin/components/schemas/claim_order.yaml index 1d26758cec2d4..ed55db009d026 100644 --- a/docs/api/admin/components/schemas/claim_order.yaml +++ b/docs/api/admin/components/schemas/claim_order.yaml @@ -4,6 +4,7 @@ description: >- consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order +type: object required: - type - order_id diff --git a/docs/api/admin/components/schemas/claim_tag.yaml b/docs/api/admin/components/schemas/claim_tag.yaml index bf7b96a3dbaa4..46a23e4da852e 100644 --- a/docs/api/admin/components/schemas/claim_tag.yaml +++ b/docs/api/admin/components/schemas/claim_tag.yaml @@ -3,6 +3,7 @@ description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag +type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/country.yaml b/docs/api/admin/components/schemas/country.yaml index 8bd271c77cce6..d8a7a18e36056 100644 --- a/docs/api/admin/components/schemas/country.yaml +++ b/docs/api/admin/components/schemas/country.yaml @@ -1,6 +1,7 @@ title: Country description: Country details x-resourceId: country +type: object required: - iso_2 - iso_3 diff --git a/docs/api/admin/components/schemas/currency.yaml b/docs/api/admin/components/schemas/currency.yaml index acdf451c75d21..be164ffa9e15c 100644 --- a/docs/api/admin/components/schemas/currency.yaml +++ b/docs/api/admin/components/schemas/currency.yaml @@ -1,6 +1,7 @@ title: Currency description: Currency x-resourceId: currency +type: object required: - code - symbol diff --git a/docs/api/admin/components/schemas/custom_shipping_option.yaml b/docs/api/admin/components/schemas/custom_shipping_option.yaml index 9e9360607560c..40ff8c8229c63 100644 --- a/docs/api/admin/components/schemas/custom_shipping_option.yaml +++ b/docs/api/admin/components/schemas/custom_shipping_option.yaml @@ -4,6 +4,7 @@ description: >- attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option +type: object required: - price - shipping_option_id diff --git a/docs/api/admin/components/schemas/customer.yaml b/docs/api/admin/components/schemas/customer.yaml index e3df6d690bb3c..aa0e83a77cd71 100644 --- a/docs/api/admin/components/schemas/customer.yaml +++ b/docs/api/admin/components/schemas/customer.yaml @@ -1,6 +1,7 @@ title: Customer description: Represents a customer x-resourceId: customer +type: object required: - email properties: @@ -18,7 +19,7 @@ properties: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string diff --git a/docs/api/admin/components/schemas/customer_group.yaml b/docs/api/admin/components/schemas/customer_group.yaml index d99e3a5923cff..0d4769c7ad6fb 100644 --- a/docs/api/admin/components/schemas/customer_group.yaml +++ b/docs/api/admin/components/schemas/customer_group.yaml @@ -1,6 +1,7 @@ title: Customer Group description: Represents a customer group x-resourceId: customer_group +type: object required: - name properties: diff --git a/docs/api/admin/components/schemas/discount.yaml b/docs/api/admin/components/schemas/discount.yaml index 48f090532a3fe..1950a503cb0c5 100644 --- a/docs/api/admin/components/schemas/discount.yaml +++ b/docs/api/admin/components/schemas/discount.yaml @@ -1,6 +1,7 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount +type: object required: - code - is_dynamic diff --git a/docs/api/admin/components/schemas/discount_condition.yaml b/docs/api/admin/components/schemas/discount_condition.yaml index 57a0dea0b9833..794e839eb3eab 100644 --- a/docs/api/admin/components/schemas/discount_condition.yaml +++ b/docs/api/admin/components/schemas/discount_condition.yaml @@ -1,6 +1,7 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition +type: object required: - type - operator diff --git a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml b/docs/api/admin/components/schemas/discount_condition_customer_group.yaml index ad6527d260710..51867349ad72d 100644 --- a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/admin/components/schemas/discount_condition_customer_group.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group +type: object required: - customer_group_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product.yaml b/docs/api/admin/components/schemas/discount_condition_product.yaml index 77f4fa6b9edc5..b88eac53c27da 100644 --- a/docs/api/admin/components/schemas/discount_condition_product.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product.yaml @@ -1,6 +1,7 @@ title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product +type: object required: - product_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml b/docs/api/admin/components/schemas/discount_condition_product_collection.yaml index 43c7548e34b3e..bc0065ef9f060 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection +type: object required: - product_collection_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml b/docs/api/admin/components/schemas/discount_condition_product_tag.yaml index ed3a8b2e79ce2..d3ba121f43e6d 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag +type: object required: - product_tag_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product_type.yaml b/docs/api/admin/components/schemas/discount_condition_product_type.yaml index 3125b2119ccc3..03a6393c4463c 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product_type.yaml @@ -1,6 +1,7 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product +type: object required: - product_type_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_rule.yaml b/docs/api/admin/components/schemas/discount_rule.yaml index 328171368fcf4..ab6ab1a80e54a 100644 --- a/docs/api/admin/components/schemas/discount_rule.yaml +++ b/docs/api/admin/components/schemas/discount_rule.yaml @@ -3,6 +3,7 @@ description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule +type: object required: - type - value diff --git a/docs/api/admin/components/schemas/draft-order.yaml b/docs/api/admin/components/schemas/draft-order.yaml index 12152dc3e092d..1c96c22bc7b66 100644 --- a/docs/api/admin/components/schemas/draft-order.yaml +++ b/docs/api/admin/components/schemas/draft-order.yaml @@ -1,6 +1,7 @@ title: DraftOrder description: Represents a draft order x-resourceId: draft-order +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/error.yaml b/docs/api/admin/components/schemas/error.yaml index c8baa14163e45..cad9495918bdd 100644 --- a/docs/api/admin/components/schemas/error.yaml +++ b/docs/api/admin/components/schemas/error.yaml @@ -1,5 +1,6 @@ title: Response Error x-resourceId: error +type: object properties: code: type: string diff --git a/docs/api/admin/components/schemas/fulfillment.yaml b/docs/api/admin/components/schemas/fulfillment.yaml index 0ea09f97e51a8..d6ee5c69608ef 100644 --- a/docs/api/admin/components/schemas/fulfillment.yaml +++ b/docs/api/admin/components/schemas/fulfillment.yaml @@ -8,6 +8,7 @@ description: >- webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment +type: object required: - provider_id properties: diff --git a/docs/api/admin/components/schemas/fulfillment_item.yaml b/docs/api/admin/components/schemas/fulfillment_item.yaml index 29fe0f87b9711..f233f45f68873 100644 --- a/docs/api/admin/components/schemas/fulfillment_item.yaml +++ b/docs/api/admin/components/schemas/fulfillment_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item +type: object required: - fulfillment_id - item_id diff --git a/docs/api/admin/components/schemas/fulfillment_provider.yaml b/docs/api/admin/components/schemas/fulfillment_provider.yaml index d6fdd8ce64033..584c933111efe 100644 --- a/docs/api/admin/components/schemas/fulfillment_provider.yaml +++ b/docs/api/admin/components/schemas/fulfillment_provider.yaml @@ -1,6 +1,7 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider +type: object properties: id: description: The id of the fulfillment provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/gift_card.yaml b/docs/api/admin/components/schemas/gift_card.yaml index 713a2a39fcd82..054f93319f0bf 100644 --- a/docs/api/admin/components/schemas/gift_card.yaml +++ b/docs/api/admin/components/schemas/gift_card.yaml @@ -3,6 +3,7 @@ description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card +type: object required: - code - value diff --git a/docs/api/admin/components/schemas/gift_card_transaction.yaml b/docs/api/admin/components/schemas/gift_card_transaction.yaml index 0d923b36536cc..fb16341851868 100644 --- a/docs/api/admin/components/schemas/gift_card_transaction.yaml +++ b/docs/api/admin/components/schemas/gift_card_transaction.yaml @@ -3,6 +3,7 @@ description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction +type: object required: - gift_card_id - amount diff --git a/docs/api/admin/components/schemas/idempotency_key.yaml b/docs/api/admin/components/schemas/idempotency_key.yaml index ac4f6b63b7510..9bff9c0f90d72 100644 --- a/docs/api/admin/components/schemas/idempotency_key.yaml +++ b/docs/api/admin/components/schemas/idempotency_key.yaml @@ -3,6 +3,7 @@ description: >- Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key +type: object required: - idempotency_key properties: diff --git a/docs/api/admin/components/schemas/image.yaml b/docs/api/admin/components/schemas/image.yaml index 24bf973e75c9b..61bc475c32085 100644 --- a/docs/api/admin/components/schemas/image.yaml +++ b/docs/api/admin/components/schemas/image.yaml @@ -1,6 +1,7 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image +type: object required: - url properties: diff --git a/docs/api/admin/components/schemas/invite.yaml b/docs/api/admin/components/schemas/invite.yaml index 492a71eeb22e0..aac3ce0b7fb92 100644 --- a/docs/api/admin/components/schemas/invite.yaml +++ b/docs/api/admin/components/schemas/invite.yaml @@ -1,6 +1,7 @@ title: Invite description: Represents an invite x-resourceId: invite +type: object required: - user_email properties: diff --git a/docs/api/admin/components/schemas/line_item.yaml b/docs/api/admin/components/schemas/line_item.yaml index cdb06694a9a7c..ae9ed1eaa08f4 100644 --- a/docs/api/admin/components/schemas/line_item.yaml +++ b/docs/api/admin/components/schemas/line_item.yaml @@ -5,6 +5,7 @@ description: >- order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item +type: object required: - title - unit_price diff --git a/docs/api/admin/components/schemas/line_item_adjustment.yaml b/docs/api/admin/components/schemas/line_item_adjustment.yaml index 8ae889c8dcc18..677f69388a33c 100644 --- a/docs/api/admin/components/schemas/line_item_adjustment.yaml +++ b/docs/api/admin/components/schemas/line_item_adjustment.yaml @@ -1,6 +1,7 @@ title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment +type: object required: - item_id - description diff --git a/docs/api/admin/components/schemas/line_item_tax_line.yaml b/docs/api/admin/components/schemas/line_item_tax_line.yaml index 9320de67e36db..b149f62d42ef5 100644 --- a/docs/api/admin/components/schemas/line_item_tax_line.yaml +++ b/docs/api/admin/components/schemas/line_item_tax_line.yaml @@ -1,6 +1,7 @@ title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line +type: object required: - item_id - rate diff --git a/docs/api/admin/components/schemas/money_amount.yaml b/docs/api/admin/components/schemas/money_amount.yaml index f54d7e4a7a7fb..929194a759c52 100644 --- a/docs/api/admin/components/schemas/money_amount.yaml +++ b/docs/api/admin/components/schemas/money_amount.yaml @@ -6,6 +6,7 @@ description: >- pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount +type: object required: - currency_code - amount diff --git a/docs/api/admin/components/schemas/multiple_errors.yaml b/docs/api/admin/components/schemas/multiple_errors.yaml index 579282df2fcc1..0327c94e70382 100644 --- a/docs/api/admin/components/schemas/multiple_errors.yaml +++ b/docs/api/admin/components/schemas/multiple_errors.yaml @@ -1,5 +1,6 @@ title: Multiple Errors x-resourceId: multiple_errors +type: object properties: errors: type: array diff --git a/docs/api/admin/components/schemas/note.yaml b/docs/api/admin/components/schemas/note.yaml index 9333e49472b3f..16f1e9fe50972 100644 --- a/docs/api/admin/components/schemas/note.yaml +++ b/docs/api/admin/components/schemas/note.yaml @@ -3,6 +3,7 @@ description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. x-resourceId: note +type: object required: - value - resource_type diff --git a/docs/api/admin/components/schemas/notification.yaml b/docs/api/admin/components/schemas/notification.yaml index 559d58d79ab0c..9db10fe27aaa5 100644 --- a/docs/api/admin/components/schemas/notification.yaml +++ b/docs/api/admin/components/schemas/notification.yaml @@ -5,6 +5,7 @@ description: >- chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification +type: object required: - resource_type - resource_id diff --git a/docs/api/admin/components/schemas/notification_provider.yaml b/docs/api/admin/components/schemas/notification_provider.yaml index 6ac490109fb3d..dacf80d1896e1 100644 --- a/docs/api/admin/components/schemas/notification_provider.yaml +++ b/docs/api/admin/components/schemas/notification_provider.yaml @@ -1,6 +1,7 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider +type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/notification_resend.yaml b/docs/api/admin/components/schemas/notification_resend.yaml index c5cfe4431fdc4..2b15999aa62cb 100644 --- a/docs/api/admin/components/schemas/notification_resend.yaml +++ b/docs/api/admin/components/schemas/notification_resend.yaml @@ -1,6 +1,7 @@ title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend +type: object properties: id: description: The notification resend's ID diff --git a/docs/api/admin/components/schemas/order.yaml b/docs/api/admin/components/schemas/order.yaml index 7371e85df96b7..464edc17fb019 100644 --- a/docs/api/admin/components/schemas/order.yaml +++ b/docs/api/admin/components/schemas/order.yaml @@ -1,6 +1,7 @@ title: Order description: Represents an order x-resourceId: order +type: object required: - customer_id - email diff --git a/docs/api/admin/components/schemas/order_edit.yaml b/docs/api/admin/components/schemas/order_edit.yaml index 44e4a3f779334..5574c2b6f2ab3 100644 --- a/docs/api/admin/components/schemas/order_edit.yaml +++ b/docs/api/admin/components/schemas/order_edit.yaml @@ -1,6 +1,7 @@ title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit +type: object required: - order_id - order diff --git a/docs/api/admin/components/schemas/order_item_change.yaml b/docs/api/admin/components/schemas/order_item_change.yaml index 70d61c83c390e..9bc3b3a8263d5 100644 --- a/docs/api/admin/components/schemas/order_item_change.yaml +++ b/docs/api/admin/components/schemas/order_item_change.yaml @@ -1,6 +1,7 @@ title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change +type: object required: - type - order_edit_id diff --git a/docs/api/admin/components/schemas/payment.yaml b/docs/api/admin/components/schemas/payment.yaml index 92294bd2e6ec1..384e04b16c4e3 100644 --- a/docs/api/admin/components/schemas/payment.yaml +++ b/docs/api/admin/components/schemas/payment.yaml @@ -3,6 +3,7 @@ description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment +type: object required: - amount - currency_code diff --git a/docs/api/admin/components/schemas/payment_collection.yaml b/docs/api/admin/components/schemas/payment_collection.yaml index 315c62b47533f..3f5663b39aab5 100644 --- a/docs/api/admin/components/schemas/payment_collection.yaml +++ b/docs/api/admin/components/schemas/payment_collection.yaml @@ -1,6 +1,7 @@ title: Payment Collection description: Payment Collection x-resourceId: payment_collection +type: object required: - type - status @@ -26,12 +27,7 @@ properties: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -41,12 +37,6 @@ properties: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID diff --git a/docs/api/admin/components/schemas/payment_provider.yaml b/docs/api/admin/components/schemas/payment_provider.yaml index 7f39ed6355c47..081a6b74628dd 100644 --- a/docs/api/admin/components/schemas/payment_provider.yaml +++ b/docs/api/admin/components/schemas/payment_provider.yaml @@ -1,6 +1,7 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider +type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/payment_session.yaml b/docs/api/admin/components/schemas/payment_session.yaml index c9f52a749b755..ca8c513a262d6 100644 --- a/docs/api/admin/components/schemas/payment_session.yaml +++ b/docs/api/admin/components/schemas/payment_session.yaml @@ -7,6 +7,7 @@ description: >- get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session +type: object required: - cart_id - provider_id diff --git a/docs/api/admin/components/schemas/price_list.yaml b/docs/api/admin/components/schemas/price_list.yaml index bae4d3936ae57..b774028314fab 100644 --- a/docs/api/admin/components/schemas/price_list.yaml +++ b/docs/api/admin/components/schemas/price_list.yaml @@ -3,6 +3,7 @@ description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list +type: object required: - name - description diff --git a/docs/api/admin/components/schemas/product.yaml b/docs/api/admin/components/schemas/product.yaml index 41bf53f444969..e0116cc51d006 100644 --- a/docs/api/admin/components/schemas/product.yaml +++ b/docs/api/admin/components/schemas/product.yaml @@ -4,6 +4,7 @@ description: >- as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product +type: object required: - title - profile_id diff --git a/docs/api/admin/components/schemas/product_collection.yaml b/docs/api/admin/components/schemas/product_collection.yaml index 711acc6c10a09..a3fd98cefb2aa 100644 --- a/docs/api/admin/components/schemas/product_collection.yaml +++ b/docs/api/admin/components/schemas/product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection +type: object required: - title properties: diff --git a/docs/api/admin/components/schemas/product_option.yaml b/docs/api/admin/components/schemas/product_option.yaml index 66fd46f4fda64..aaaf0d58c1250 100644 --- a/docs/api/admin/components/schemas/product_option.yaml +++ b/docs/api/admin/components/schemas/product_option.yaml @@ -4,6 +4,7 @@ description: >- a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option +type: object required: - title - product_id diff --git a/docs/api/admin/components/schemas/product_option_value.yaml b/docs/api/admin/components/schemas/product_option_value.yaml index 3b8606ea53cb7..407e69a53670a 100644 --- a/docs/api/admin/components/schemas/product_option_value.yaml +++ b/docs/api/admin/components/schemas/product_option_value.yaml @@ -3,6 +3,7 @@ description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value +type: object required: - value - option_id diff --git a/docs/api/admin/components/schemas/product_tag.yaml b/docs/api/admin/components/schemas/product_tag.yaml index cdfa21d4ad3e7..8240386ddf7b9 100644 --- a/docs/api/admin/components/schemas/product_tag.yaml +++ b/docs/api/admin/components/schemas/product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag +type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/product_tax_rate.yaml b/docs/api/admin/components/schemas/product_tax_rate.yaml index f72e8896a8308..db175e899dc26 100644 --- a/docs/api/admin/components/schemas/product_tax_rate.yaml +++ b/docs/api/admin/components/schemas/product_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate +type: object required: - product_id - rate_id diff --git a/docs/api/admin/components/schemas/product_type.yaml b/docs/api/admin/components/schemas/product_type.yaml index e2be2bf9204f9..b6e06d4190b78 100644 --- a/docs/api/admin/components/schemas/product_type.yaml +++ b/docs/api/admin/components/schemas/product_type.yaml @@ -1,6 +1,7 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type +type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/product_type_tax_rate.yaml b/docs/api/admin/components/schemas/product_type_tax_rate.yaml index 5bc7d5c30265b..48445a6b80e60 100644 --- a/docs/api/admin/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/admin/components/schemas/product_type_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate +type: object required: - product_type_id - rate_id diff --git a/docs/api/admin/components/schemas/product_variant.yaml b/docs/api/admin/components/schemas/product_variant.yaml index aa7386d615925..a0cb2eacc9f1e 100644 --- a/docs/api/admin/components/schemas/product_variant.yaml +++ b/docs/api/admin/components/schemas/product_variant.yaml @@ -4,6 +4,7 @@ description: >- configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant +type: object required: - title - product_id diff --git a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml b/docs/api/admin/components/schemas/product_variant_prices_fields.yaml index aefca848a032e..aee46598283ea 100644 --- a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/admin/components/schemas/product_variant_prices_fields.yaml @@ -1,6 +1,7 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields +type: object properties: original_price: type: number diff --git a/docs/api/admin/components/schemas/publishable_api_key.yaml b/docs/api/admin/components/schemas/publishable_api_key.yaml new file mode 100644 index 0000000000000..061b34b8c8af9 --- /dev/null +++ b/docs/api/admin/components/schemas/publishable_api_key.yaml @@ -0,0 +1,37 @@ +title: Publishable API key +description: >- + Publishable API key defines scopes (i.e. resources) that are available within + a request. +x-resourceId: publishable_api_key +type: object +properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: A user object. Available if the relation `revoked_by_user` is expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time diff --git a/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml new file mode 100644 index 0000000000000..d0ab55c29ae4f --- /dev/null +++ b/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml @@ -0,0 +1,13 @@ +title: Publishable API key sales channel +description: Holds mapping between Publishable API keys and Sales Channels +x-resourceId: publishable_api_key_sales_channel +type: object +properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 diff --git a/docs/api/admin/components/schemas/refund.yaml b/docs/api/admin/components/schemas/refund.yaml index c1fc4cfc0f57c..fae6a881f3a01 100644 --- a/docs/api/admin/components/schemas/refund.yaml +++ b/docs/api/admin/components/schemas/refund.yaml @@ -4,6 +4,7 @@ description: >- given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund +type: object required: - order_id - amount diff --git a/docs/api/admin/components/schemas/region.yaml b/docs/api/admin/components/schemas/region.yaml index a2561dc89203f..15b245b4702e4 100644 --- a/docs/api/admin/components/schemas/region.yaml +++ b/docs/api/admin/components/schemas/region.yaml @@ -5,6 +5,7 @@ description: >- consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region +type: object required: - name - currency_code diff --git a/docs/api/admin/components/schemas/return.yaml b/docs/api/admin/components/schemas/return.yaml index a47590010680d..7ba545dcdc4a2 100644 --- a/docs/api/admin/components/schemas/return.yaml +++ b/docs/api/admin/components/schemas/return.yaml @@ -4,6 +4,7 @@ description: >- back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return +type: object required: - refund_amount properties: diff --git a/docs/api/admin/components/schemas/return_item.yaml b/docs/api/admin/components/schemas/return_item.yaml index 3c45a35003ad8..4ecc64bc8dc52 100644 --- a/docs/api/admin/components/schemas/return_item.yaml +++ b/docs/api/admin/components/schemas/return_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item +type: object required: - return_id - item_id diff --git a/docs/api/admin/components/schemas/return_reason.yaml b/docs/api/admin/components/schemas/return_reason.yaml index 7873cfc3f2f03..2e4d4d83ef8e3 100644 --- a/docs/api/admin/components/schemas/return_reason.yaml +++ b/docs/api/admin/components/schemas/return_reason.yaml @@ -3,6 +3,7 @@ description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason +type: object required: - value - label diff --git a/docs/api/admin/components/schemas/sales_channel.yaml b/docs/api/admin/components/schemas/sales_channel.yaml index 0523299105261..7c4e1f2920219 100644 --- a/docs/api/admin/components/schemas/sales_channel.yaml +++ b/docs/api/admin/components/schemas/sales_channel.yaml @@ -1,6 +1,7 @@ title: Sales Channel description: A Sales Channel x-resourceId: sales_channel +type: object required: - name properties: diff --git a/docs/api/admin/components/schemas/shipping_method.yaml b/docs/api/admin/components/schemas/shipping_method.yaml index d6a96012773b1..4ac18c8e93d5a 100644 --- a/docs/api/admin/components/schemas/shipping_method.yaml +++ b/docs/api/admin/components/schemas/shipping_method.yaml @@ -5,6 +5,7 @@ description: >- details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method +type: object required: - shipping_option_id - price diff --git a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml b/docs/api/admin/components/schemas/shipping_method_tax_line.yaml index cce7e8fddf16c..3387bfbfe2599 100644 --- a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/admin/components/schemas/shipping_method_tax_line.yaml @@ -1,6 +1,7 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line +type: object required: - shipping_method_id - rate diff --git a/docs/api/admin/components/schemas/shipping_option.yaml b/docs/api/admin/components/schemas/shipping_option.yaml index 108dbc5f145db..a0e1c6538a7d1 100644 --- a/docs/api/admin/components/schemas/shipping_option.yaml +++ b/docs/api/admin/components/schemas/shipping_option.yaml @@ -7,6 +7,7 @@ description: >- distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option +type: object required: - name - region_id diff --git a/docs/api/admin/components/schemas/shipping_option_requirement.yaml b/docs/api/admin/components/schemas/shipping_option_requirement.yaml index 559d21de4488c..57d97193122ef 100644 --- a/docs/api/admin/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/admin/components/schemas/shipping_option_requirement.yaml @@ -3,6 +3,7 @@ description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement +type: object required: - shipping_option_id - type diff --git a/docs/api/admin/components/schemas/shipping_profile.yaml b/docs/api/admin/components/schemas/shipping_profile.yaml index cb55e4f1342ae..ba479ece923cb 100644 --- a/docs/api/admin/components/schemas/shipping_profile.yaml +++ b/docs/api/admin/components/schemas/shipping_profile.yaml @@ -3,6 +3,7 @@ description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile +type: object required: - name - type diff --git a/docs/api/admin/components/schemas/shipping_tax_rate.yaml b/docs/api/admin/components/schemas/shipping_tax_rate.yaml index ddf13f172a4fe..30058a09afb86 100644 --- a/docs/api/admin/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/admin/components/schemas/shipping_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate +type: object required: - shipping_option_id - rate_id diff --git a/docs/api/admin/components/schemas/staged_job.yaml b/docs/api/admin/components/schemas/staged_job.yaml index 95fd6aaf34428..055ceaee0e1de 100644 --- a/docs/api/admin/components/schemas/staged_job.yaml +++ b/docs/api/admin/components/schemas/staged_job.yaml @@ -1,6 +1,7 @@ title: Staged Job description: A staged job resource x-resourceId: staged_job +type: object required: - event_name properties: diff --git a/docs/api/admin/components/schemas/store.yaml b/docs/api/admin/components/schemas/store.yaml index 09844ff155c5a..98b90e81f4612 100644 --- a/docs/api/admin/components/schemas/store.yaml +++ b/docs/api/admin/components/schemas/store.yaml @@ -1,6 +1,7 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. x-resourceId: store +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/swap.yaml b/docs/api/admin/components/schemas/swap.yaml index e9f0397f646ad..31694ff199f34 100644 --- a/docs/api/admin/components/schemas/swap.yaml +++ b/docs/api/admin/components/schemas/swap.yaml @@ -8,6 +8,7 @@ description: >- amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap +type: object required: - fulfillment_status - payment_status diff --git a/docs/api/admin/components/schemas/tax_line.yaml b/docs/api/admin/components/schemas/tax_line.yaml index 491a7e0c0066f..3faaf02eb7e0f 100644 --- a/docs/api/admin/components/schemas/tax_line.yaml +++ b/docs/api/admin/components/schemas/tax_line.yaml @@ -1,6 +1,7 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line +type: object required: - rate - name diff --git a/docs/api/admin/components/schemas/tax_provider.yaml b/docs/api/admin/components/schemas/tax_provider.yaml index 267d162eae49f..7f53c424a5c6a 100644 --- a/docs/api/admin/components/schemas/tax_provider.yaml +++ b/docs/api/admin/components/schemas/tax_provider.yaml @@ -1,6 +1,7 @@ title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider +type: object properties: id: description: The id of the tax provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/tax_rate.yaml b/docs/api/admin/components/schemas/tax_rate.yaml index 29f7e0e0a977b..cbe718652e9b2 100644 --- a/docs/api/admin/components/schemas/tax_rate.yaml +++ b/docs/api/admin/components/schemas/tax_rate.yaml @@ -3,6 +3,7 @@ description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item +type: object required: - name - region_id diff --git a/docs/api/admin/components/schemas/tracking_link.yaml b/docs/api/admin/components/schemas/tracking_link.yaml index 2a79689722dbe..25867d8a97f30 100644 --- a/docs/api/admin/components/schemas/tracking_link.yaml +++ b/docs/api/admin/components/schemas/tracking_link.yaml @@ -4,6 +4,7 @@ description: >- Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link +type: object required: - tracking_number - fulfillment_id diff --git a/docs/api/admin/components/schemas/user.yaml b/docs/api/admin/components/schemas/user.yaml index 5083be44de892..042cd46cb260b 100644 --- a/docs/api/admin/components/schemas/user.yaml +++ b/docs/api/admin/components/schemas/user.yaml @@ -1,6 +1,7 @@ title: User description: Represents a User who can manage store settings. x-resourceId: user +type: object required: - email properties: diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index 380a1c21d2818..bbafc38b93757 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -208,6 +208,10 @@ paths: $ref: paths/apps.yaml /auth: $ref: paths/auth.yaml + /currencies: + $ref: paths/currencies.yaml + /currencies/{code}: + $ref: paths/currencies_{code}.yaml /batch-jobs/{id}/cancel: $ref: paths/batch-jobs_{id}_cancel.yaml /batch-jobs/{id}/confirm: @@ -216,16 +220,6 @@ paths: $ref: paths/batch-jobs.yaml /batch-jobs/{id}: $ref: paths/batch-jobs_{id}.yaml - /collections/{id}/products/batch: - $ref: paths/collections_{id}_products_batch.yaml - /collections: - $ref: paths/collections.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /currencies: - $ref: paths/currencies.yaml - /currencies/{code}: - $ref: paths/currencies_{code}.yaml /customer-groups/{id}/customers/batch: $ref: paths/customer-groups_{id}_customers_batch.yaml /customer-groups: @@ -234,6 +228,12 @@ paths: $ref: paths/customer-groups_{id}.yaml /customer-groups/{id}/customers: $ref: paths/customer-groups_{id}_customers.yaml + /collections/{id}/products/batch: + $ref: paths/collections_{id}_products_batch.yaml + /collections: + $ref: paths/collections.yaml + /collections/{id}: + $ref: paths/collections_{id}.yaml /customers: $ref: paths/customers.yaml /customers/{id}: @@ -354,6 +354,16 @@ paths: $ref: paths/orders_{id}_return.yaml /order/{id}/claims/{claim_id}: $ref: paths/order_{id}_claims_{claim_id}.yaml + /payment-collections/{id}: + $ref: paths/payment-collections_{id}.yaml + /payment-collections/{id}/authorize: + $ref: paths/payment-collections_{id}_authorize.yaml + /payments/{id}/capture: + $ref: paths/payments_{id}_capture.yaml + /payments/{id}: + $ref: paths/payments_{id}.yaml + /payments/{id}/refund: + $ref: paths/payments_{id}_refund.yaml /price-lists/{id}/prices/batch: $ref: paths/price-lists_{id}_prices_batch.yaml /price-lists: @@ -388,6 +398,18 @@ paths: $ref: paths/products_types.yaml /products/{id}/metadata: $ref: paths/products_{id}_metadata.yaml + /publishable-api-keys/{id}/sales-channels/batch: + $ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml + /publishable-api-keys: + $ref: paths/publishable-api-keys.yaml + /publishable-api-keys/{id}: + $ref: paths/publishable-api-keys_{id}.yaml + /publishable-api-keys/:id/sales-channels: + $ref: paths/publishable-api-keys_:id_sales-channels.yaml + /publishable-api-keys/{id}/revoke: + $ref: paths/publishable-api-keys_{id}_revoke.yaml + /publishable-api-key/{id}: + $ref: paths/publishable-api-key_{id}.yaml /regions/{id}/countries: $ref: paths/regions_{id}_countries.yaml /regions/{id}/fulfillment-providers: @@ -438,10 +460,6 @@ paths: $ref: paths/store_payment-providers.yaml /store/tax-providers: $ref: paths/store_tax-providers.yaml - /swaps/{id}: - $ref: paths/swaps_{id}.yaml - /swaps: - $ref: paths/swaps.yaml /tax-rates/{id}/product-types/batch: $ref: paths/tax-rates_{id}_product-types_batch.yaml /tax-rates/{id}/products/batch: @@ -452,6 +470,10 @@ paths: $ref: paths/tax-rates.yaml /tax-rates/{id}: $ref: paths/tax-rates_{id}.yaml + /swaps/{id}: + $ref: paths/swaps_{id}.yaml + /swaps: + $ref: paths/swaps.yaml /uploads/protected: $ref: paths/uploads_protected.yaml /uploads: diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index fdf0874807e38..09630a97d9510 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object properties: region_id: type: string @@ -78,6 +79,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/apps.yaml b/docs/api/admin/paths/apps.yaml index e4e1cf78dbf7e..a2ae6505300de 100644 --- a/docs/api/admin/paths/apps.yaml +++ b/docs/api/admin/paths/apps.yaml @@ -19,6 +19,7 @@ get: content: application/json: schema: + type: object properties: apps: type: array diff --git a/docs/api/admin/paths/apps_authorizations.yaml b/docs/api/admin/paths/apps_authorizations.yaml index b5b1f1772b850..083b1c4d48319 100644 --- a/docs/api/admin/paths/apps_authorizations.yaml +++ b/docs/api/admin/paths/apps_authorizations.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - application_name - state @@ -37,6 +38,7 @@ post: content: application/json: schema: + type: object properties: apps: $ref: ../components/schemas/OAuth.yaml diff --git a/docs/api/admin/paths/auth.yaml b/docs/api/admin/paths/auth.yaml index 1229c1a738a44..d9eb880401cf6 100644 --- a/docs/api/admin/paths/auth.yaml +++ b/docs/api/admin/paths/auth.yaml @@ -36,6 +36,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml @@ -110,6 +111,7 @@ get: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml diff --git a/docs/api/admin/paths/batch-jobs.yaml b/docs/api/admin/paths/batch-jobs.yaml index 83c55f8e0dcd1..fb7b06064c190 100644 --- a/docs/api/admin/paths/batch-jobs.yaml +++ b/docs/api/admin/paths/batch-jobs.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - type - context @@ -62,6 +63,7 @@ post: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml @@ -338,6 +340,7 @@ get: content: application/json: schema: + type: object properties: batch_jobs: type: array diff --git a/docs/api/admin/paths/batch-jobs_{id}.yaml b/docs/api/admin/paths/batch-jobs_{id}.yaml index 242cce28b2bae..2278e04dfbcd2 100644 --- a/docs/api/admin/paths/batch-jobs_{id}.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml diff --git a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml index c926de3499d39..cddbde3b9e654 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml diff --git a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml index 901b48f0fc433..ed31dff4feffe 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/collections.yaml index fea044f02c391..3dd991bf7c0f2 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/collections.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -43,6 +44,7 @@ post: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml @@ -182,6 +184,7 @@ get: content: application/json: schema: + type: object properties: collections: type: array diff --git a/docs/api/admin/paths/collections_{id}.yaml b/docs/api/admin/paths/collections_{id}.yaml index b451c8f195e11..2b75a31ee1afa 100644 --- a/docs/api/admin/paths/collections_{id}.yaml +++ b/docs/api/admin/paths/collections_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: title: type: string @@ -151,6 +154,7 @@ post: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml diff --git a/docs/api/admin/paths/collections_{id}_products_batch.yaml b/docs/api/admin/paths/collections_{id}_products_batch.yaml index fb60ca2adadb9..50cda5b52bf01 100644 --- a/docs/api/admin/paths/collections_{id}_products_batch.yaml +++ b/docs/api/admin/paths/collections_{id}_products_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - product_ids properties: @@ -39,6 +40,7 @@ post: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml @@ -70,6 +72,7 @@ delete: content: application/json: schema: + type: object required: - product_ids properties: @@ -95,6 +98,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/currencies.yaml index 340ac8d4230f0..b707270a89abf 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/currencies.yaml @@ -48,6 +48,7 @@ get: content: application/json: schema: + type: object properties: currencies: type: array diff --git a/docs/api/admin/paths/currencies_{code}.yaml b/docs/api/admin/paths/currencies_{code}.yaml index 73e2a1c5ef83a..70d8229a93e3d 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/currencies_{code}.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object properties: includes_tax: type: boolean @@ -35,6 +36,7 @@ post: content: application/json: schema: + type: object properties: currency: $ref: ../components/schemas/currency.yaml diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/customer-groups.yaml index decf0c12e785b..9d9787b29cd9f 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/customer-groups.yaml @@ -24,6 +24,7 @@ post: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml @@ -195,6 +196,7 @@ get: content: application/json: schema: + type: object properties: customer_groups: type: array diff --git a/docs/api/admin/paths/customer-groups_{id}.yaml b/docs/api/admin/paths/customer-groups_{id}.yaml index 85994c41a89e9..2d0b5c1fca3f3 100644 --- a/docs/api/admin/paths/customer-groups_{id}.yaml +++ b/docs/api/admin/paths/customer-groups_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -96,6 +97,7 @@ get: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml @@ -127,6 +129,7 @@ post: content: application/json: schema: + type: object properties: name: description: Name of the customer group @@ -154,6 +157,7 @@ post: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml diff --git a/docs/api/admin/paths/customer-groups_{id}_customers.yaml b/docs/api/admin/paths/customer-groups_{id}_customers.yaml index 73bc73eeec6d0..602adf0ae9774 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: customers: type: array diff --git a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml index 7ca164800d664..a45e2794354a1 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - customer_ids properties: @@ -49,6 +50,7 @@ post: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml @@ -80,6 +82,7 @@ delete: content: application/json: schema: + type: object required: - customer_ids properties: @@ -115,6 +118,7 @@ delete: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml diff --git a/docs/api/admin/paths/customers.yaml b/docs/api/admin/paths/customers.yaml index f1b84cdc12e23..0b67b4bc8e529 100644 --- a/docs/api/admin/paths/customers.yaml +++ b/docs/api/admin/paths/customers.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email - first_name @@ -55,6 +56,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -118,6 +120,7 @@ get: content: application/json: schema: + type: object properties: customers: type: array diff --git a/docs/api/admin/paths/customers_{id}.yaml b/docs/api/admin/paths/customers_{id}.yaml index 8548c8c2d88b6..4b729d7f9fca0 100644 --- a/docs/api/admin/paths/customers_{id}.yaml +++ b/docs/api/admin/paths/customers_{id}.yaml @@ -40,6 +40,7 @@ get: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -81,6 +82,7 @@ post: content: application/json: schema: + type: object properties: email: type: string @@ -134,6 +136,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/admin/paths/discounts.yaml b/docs/api/admin/paths/discounts.yaml index 7736ff86a0613..da81dcaf2e8ac 100644 --- a/docs/api/admin/paths/discounts.yaml +++ b/docs/api/admin/paths/discounts.yaml @@ -20,9 +20,11 @@ post: content: application/json: schema: + type: object required: - code - rule + - regions properties: code: type: string @@ -173,6 +175,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -270,6 +273,7 @@ get: content: application/json: schema: + type: object properties: discounts: type: array diff --git a/docs/api/admin/paths/discounts_code_{code}.yaml b/docs/api/admin/paths/discounts_code_{code}.yaml index fef2a953ae884..b290e9417a717 100644 --- a/docs/api/admin/paths/discounts_code_{code}.yaml +++ b/docs/api/admin/paths/discounts_code_{code}.yaml @@ -40,6 +40,7 @@ get: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml index 0ae38f9b4c324..377c96c7057e9 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml @@ -31,6 +31,7 @@ post: content: application/json: schema: + type: object required: - operator properties: @@ -94,6 +95,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml index 42d750029e814..af581bd4e3d9e 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml @@ -48,6 +48,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -127,6 +128,7 @@ get: content: application/json: schema: + type: object properties: discount_condition: $ref: ../components/schemas/discount_condition.yaml @@ -181,6 +183,7 @@ post: content: application/json: schema: + type: object properties: products: type: array @@ -237,6 +240,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml index a59cec2e0614a..dcfb03cc4c9ce 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -34,6 +34,7 @@ post: content: application/json: schema: + type: object required: - resources properties: @@ -69,6 +70,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -120,6 +122,7 @@ delete: content: application/json: schema: + type: object required: - resources properties: @@ -155,6 +158,7 @@ delete: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}.yaml b/docs/api/admin/paths/discounts_{id}.yaml index fbc5fc8706659..571033e59eca0 100644 --- a/docs/api/admin/paths/discounts_{id}.yaml +++ b/docs/api/admin/paths/discounts_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -96,6 +97,7 @@ get: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -143,6 +145,7 @@ post: content: application/json: schema: + type: object properties: code: type: string @@ -276,6 +279,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml index 8db1733a2a2d8..4b1fccd709cc7 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml index 8bdab1285440f..a6203c39971f5 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml index 947a646e7de04..85dc282dc2267 100644 --- a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml +++ b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml @@ -37,6 +37,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -92,6 +93,7 @@ delete: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/draft-orders.yaml index cc40a8a99f845..b15bf56296053 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/draft-orders.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email - items @@ -126,6 +127,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml @@ -186,6 +188,7 @@ get: content: application/json: schema: + type: object properties: draft_orders: type: array diff --git a/docs/api/admin/paths/draft-orders_{id}.yaml b/docs/api/admin/paths/draft-orders_{id}.yaml index 2f718cf6374d5..76c2c7d7fe405 100644 --- a/docs/api/admin/paths/draft-orders_{id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml index 2707975fbf80a..e0bbd3de00e98 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - quantity properties: @@ -55,6 +56,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml index 7b2fc095b4a3e..d91330afa71ee 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml @@ -75,6 +76,7 @@ post: content: application/json: schema: + type: object properties: unit_price: description: The potential custom price of the item. @@ -112,6 +114,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_pay.yaml b/docs/api/admin/paths/draft-orders_{id}_pay.yaml index 1f3bc92499a79..9865df7c71ef6 100644 --- a/docs/api/admin/paths/draft-orders_{id}_pay.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_pay.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/gift-cards.yaml b/docs/api/admin/paths/gift-cards.yaml index 57a3bd6bd5b87..9b7b83be5e422 100644 --- a/docs/api/admin/paths/gift-cards.yaml +++ b/docs/api/admin/paths/gift-cards.yaml @@ -9,6 +9,7 @@ post: content: application/json: schema: + type: object required: - region_id properties: @@ -52,6 +53,7 @@ post: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml @@ -110,6 +112,7 @@ get: content: application/json: schema: + type: object properties: gift_cards: type: array diff --git a/docs/api/admin/paths/gift-cards_{id}.yaml b/docs/api/admin/paths/gift-cards_{id}.yaml index 9e62fdd10bec5..f607e44f740e0 100644 --- a/docs/api/admin/paths/gift-cards_{id}.yaml +++ b/docs/api/admin/paths/gift-cards_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml @@ -119,6 +121,7 @@ post: content: application/json: schema: + type: object properties: balance: type: integer @@ -160,6 +163,7 @@ post: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml diff --git a/docs/api/admin/paths/invites.yaml b/docs/api/admin/paths/invites.yaml index 6fdabbd5a6b51..ef4a2f844939b 100644 --- a/docs/api/admin/paths/invites.yaml +++ b/docs/api/admin/paths/invites.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - user - role @@ -76,6 +77,7 @@ get: content: application/json: schema: + type: object properties: invites: type: array diff --git a/docs/api/admin/paths/invites_accept.yaml b/docs/api/admin/paths/invites_accept.yaml index 96aed875ed3a7..ec434b2eac8fb 100644 --- a/docs/api/admin/paths/invites_accept.yaml +++ b/docs/api/admin/paths/invites_accept.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - token - user diff --git a/docs/api/admin/paths/invites_{invite_id}.yaml b/docs/api/admin/paths/invites_{invite_id}.yaml index a94acd41ca3d3..3c05c78304f51 100644 --- a/docs/api/admin/paths/invites_{invite_id}.yaml +++ b/docs/api/admin/paths/invites_{invite_id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string diff --git a/docs/api/admin/paths/notes.yaml b/docs/api/admin/paths/notes.yaml index 9e6a5a63d15e9..38e4dfed12cbf 100644 --- a/docs/api/admin/paths/notes.yaml +++ b/docs/api/admin/paths/notes.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - resource_id - resource_type @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: note: $ref: ../components/schemas/note.yaml @@ -99,6 +101,7 @@ get: content: application/json: schema: + type: object properties: notes: type: array diff --git a/docs/api/admin/paths/notes_{id}.yaml b/docs/api/admin/paths/notes_{id}.yaml index f3796469a5e0c..6df867754a6f2 100644 --- a/docs/api/admin/paths/notes_{id}.yaml +++ b/docs/api/admin/paths/notes_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: note: $ref: ../components/schemas/note.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object required: - value properties: @@ -143,6 +146,7 @@ post: content: application/json: schema: + type: object properties: note: $ref: ../components/schemas/note.yaml diff --git a/docs/api/admin/paths/notifications.yaml b/docs/api/admin/paths/notifications.yaml index 222f094118615..5eef45e2809f5 100644 --- a/docs/api/admin/paths/notifications.yaml +++ b/docs/api/admin/paths/notifications.yaml @@ -77,6 +77,7 @@ get: content: application/json: schema: + type: object properties: notifications: type: array diff --git a/docs/api/admin/paths/notifications_{id}_resend.yaml b/docs/api/admin/paths/notifications_{id}_resend.yaml index 5f01ec27a8a03..1a782230efc69 100644 --- a/docs/api/admin/paths/notifications_{id}_resend.yaml +++ b/docs/api/admin/paths/notifications_{id}_resend.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object properties: to: description: >- @@ -42,6 +43,7 @@ post: content: application/json: schema: + type: object properties: notification: $ref: ../components/schemas/notification.yaml diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/order-edits.yaml index f4d402d052b4c..d0fd4c5836564 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/order-edits.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - order_id properties: @@ -36,6 +37,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml @@ -53,8 +55,8 @@ post: $ref: ../components/responses/500_error.yaml get: operationId: GetOrderEdits - summary: List an OrderEdit - description: List a OrderEdit. + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true parameters: - in: query @@ -109,6 +111,7 @@ get: content: application/json: schema: + type: object properties: order_edits: type: array diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/order-edits_{id}.yaml index 9c2972214b403..5c4b92f53e79c 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: internal_note: description: An optional note to create or update for the order edit. @@ -141,6 +144,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_cancel.yaml b/docs/api/admin/paths/order-edits_{id}_cancel.yaml index f69e665d76df7..ac8584dc542f0 100644 --- a/docs/api/admin/paths/order-edits_{id}_cancel.yaml +++ b/docs/api/admin/paths/order-edits_{id}_cancel.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml index 4baa154fbd3cf..a564f649b3840 100644 --- a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string diff --git a/docs/api/admin/paths/order-edits_{id}_confirm.yaml b/docs/api/admin/paths/order-edits_{id}_confirm.yaml index fad1889432581..5614450bda4d7 100644 --- a/docs/api/admin/paths/order-edits_{id}_confirm.yaml +++ b/docs/api/admin/paths/order-edits_{id}_confirm.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/order-edits_{id}_items.yaml index a97910d3ce3bc..aa105f7af6550 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items.yaml @@ -13,6 +13,7 @@ post: content: application/json: schema: + type: object required: - variant_id - quantity @@ -49,6 +50,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml index 41ec464d8e8d8..4cc271b53b30b 100644 --- a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml @@ -37,6 +37,7 @@ delete: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml @@ -74,6 +75,7 @@ post: content: application/json: schema: + type: object required: - quantity properties: @@ -101,6 +103,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_request.yaml b/docs/api/admin/paths/order-edits_{id}_request.yaml index 0b3d55e61dda6..145cc617b6e4d 100644 --- a/docs/api/admin/paths/order-edits_{id}_request.yaml +++ b/docs/api/admin/paths/order-edits_{id}_request.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/order_{id}_claims.yaml index b79ed91b77dda..b337301ed5c3a 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/order_{id}_claims.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - type - claim_items @@ -151,6 +152,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml index 4758acdbca54b..4378a9fcc91c3 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object properties: claim_items: description: The Claim Items that the Claim will consist of. @@ -127,6 +128,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/order_{id}_swaps.yaml index 804e1246e6016..01dcb5f09e07b 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/order_{id}_swaps.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - return_items properties: @@ -114,6 +115,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders.yaml b/docs/api/admin/paths/orders.yaml index ac44f54eac452..435a893e15671 100644 --- a/docs/api/admin/paths/orders.yaml +++ b/docs/api/admin/paths/orders.yaml @@ -237,6 +237,7 @@ get: content: application/json: schema: + type: object properties: orders: type: array diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/orders_{id}.yaml index 2747c4513991e..98e4b6e24e178 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/orders_{id}.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml @@ -61,6 +62,7 @@ post: content: application/json: schema: + type: object properties: email: description: the email for the order @@ -145,6 +147,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/orders_{id}_archive.yaml index d7db746b47565..0975e579316cc 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/orders_{id}_archive.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_cancel.yaml index 9ea8b6874f82a..edb1c6636c29d 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_cancel.yaml @@ -33,6 +33,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/orders_{id}_capture.yaml index c0d6b1bfdd49e..a9ced207e1f8b 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/orders_{id}_capture.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml index b068c03eec7fe..2016427c17128 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml @@ -38,6 +38,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml index f21eb987704a3..99c746a51d060 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object properties: metadata: description: >- @@ -53,6 +54,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml index da5e1c7c39a2e..af476dc33a1b4 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -44,6 +44,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml index 0f9956d11bd47..41690eaf23cf7 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -53,6 +54,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/orders_{id}_complete.yaml index 20e28f29779a4..b5b778944f83e 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/orders_{id}_complete.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/orders_{id}_fulfillment.yaml index 78e29e7bbd34a..79a007905cb0e 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillment.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - items properties: @@ -63,6 +64,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index e99f295435cfc..af2e69f609095 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -38,6 +38,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/orders_{id}_refund.yaml index 36123185eee2d..78cc3ae1fc51d 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/orders_{id}_refund.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - amount - reason @@ -52,6 +53,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_return.yaml b/docs/api/admin/paths/orders_{id}_return.yaml index 1ba5cc3679788..cc705d9908615 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/orders_{id}_return.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - items properties: @@ -89,6 +90,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/orders_{id}_shipment.yaml index 90765fd1d3391..30c6c49b3b57e 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/orders_{id}_shipment.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -50,6 +51,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml index 9cb4847881949..5383f21bb6ee3 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml index 811f4aab28904..4df3ddca51a0c 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml @@ -37,6 +37,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml index e5e138769a74d..5fa53506cbc6c 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object properties: metadata: description: >- @@ -53,6 +54,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml index 6c29cfdaea8d6..1e2101fa3c2c9 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -44,6 +44,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml index 4196fd1332e94..2124ae886c369 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml @@ -41,6 +41,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml index 119e94fe6fab5..302533759c6fd 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -58,6 +59,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/payment-collections_{id}.yaml b/docs/api/admin/paths/payment-collections_{id}.yaml new file mode 100644 index 0000000000000..23ef45ecb09cc --- /dev/null +++ b/docs/api/admin/paths/payment-collections_{id}.yaml @@ -0,0 +1,171 @@ +delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Delete a Payment Collection + description: Deletes a Payment Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/deleteundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml +get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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: PostPaymentCollectionsPaymentCollection + summary: Updates a PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + description: + description: >- + An optional description to create or update the payment + collection. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 diff --git a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml new file mode 100644 index 0000000000000..f70e0629ef30f --- /dev/null +++ b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml @@ -0,0 +1,49 @@ +post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Set the status of PaymentCollection as Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_authorize/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}_authorize/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 diff --git a/docs/api/admin/paths/payments_{id}.yaml b/docs/api/admin/paths/payments_{id}.yaml new file mode 100644 index 0000000000000..298c23a4ddf1d --- /dev/null +++ b/docs/api/admin/paths/payments_{id}.yaml @@ -0,0 +1,48 @@ +get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payments_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payments_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: ../components/schemas/payment.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 diff --git a/docs/api/admin/paths/payments_{id}_capture.yaml b/docs/api/admin/paths/payments_{id}_capture.yaml new file mode 100644 index 0000000000000..1a2f9a6ffda12 --- /dev/null +++ b/docs/api/admin/paths/payments_{id}_capture.yaml @@ -0,0 +1,48 @@ +post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payments_{id}_capture/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payments_{id}_capture/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: ../components/schemas/payment.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 diff --git a/docs/api/admin/paths/payments_{id}_refund.yaml b/docs/api/admin/paths/payments_{id}_refund.yaml new file mode 100644 index 0000000000000..c25d1eef1e958 --- /dev/null +++ b/docs/api/admin/paths/payments_{id}_refund.yaml @@ -0,0 +1,66 @@ +post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payments_{id}_refund/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payments_{id}_refund/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + refund: + $ref: ../components/schemas/refund.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 diff --git a/docs/api/admin/paths/price-lists.yaml b/docs/api/admin/paths/price-lists.yaml index a5391de1b3668..6d69d0c6b53ae 100644 --- a/docs/api/admin/paths/price-lists.yaml +++ b/docs/api/admin/paths/price-lists.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name - description @@ -105,6 +106,7 @@ post: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml @@ -286,6 +288,7 @@ get: content: application/json: schema: + type: object properties: price_lists: type: array diff --git a/docs/api/admin/paths/price-lists_{id}.yaml b/docs/api/admin/paths/price-lists_{id}.yaml index 4ebe281cba2d1..e5d440d8a7a9d 100644 --- a/docs/api/admin/paths/price-lists_{id}.yaml +++ b/docs/api/admin/paths/price-lists_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Price List @@ -213,6 +216,7 @@ post: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml diff --git a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml index ec179e95eabf9..8cd6653167531 100644 --- a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml +++ b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object properties: prices: description: The prices to update or add. @@ -76,6 +77,7 @@ post: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml @@ -109,6 +111,7 @@ delete: content: application/json: schema: + type: object properties: price_ids: description: The price id's of the Money Amounts to delete. @@ -136,6 +139,7 @@ delete: content: application/json: schema: + type: object properties: ids: type: array diff --git a/docs/api/admin/paths/price-lists_{id}_products.yaml b/docs/api/admin/paths/price-lists_{id}_products.yaml index ffe4f413fb2b6..8ab10beb00590 100644 --- a/docs/api/admin/paths/price-lists_{id}_products.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products.yaml @@ -196,6 +196,7 @@ get: content: application/json: schema: + type: object properties: products: type: array diff --git a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml b/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml index 564f03dce60cd..84dd0b1799e56 100644 --- a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml @@ -40,6 +40,7 @@ delete: content: application/json: schema: + type: object properties: ids: type: array diff --git a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml b/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml index 91e4102a218d1..a4420e961fbbc 100644 --- a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml +++ b/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml @@ -40,6 +40,7 @@ delete: content: application/json: schema: + type: object properties: ids: type: array diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/product-tags.yaml index fcc8bcad35ca7..af33fea80e180 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/product-tags.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: product_tags: $ref: ../components/schemas/product_tag.yaml diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 8de545f6f4cec..00a5779158f6f 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: product_types: $ref: ../components/schemas/product_type.yaml diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/products.yaml index cc2ad51a46145..9501af2435d39 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/products.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -261,6 +262,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml @@ -498,6 +500,7 @@ get: content: application/json: schema: + type: object properties: products: type: array diff --git a/docs/api/admin/paths/products_tag-usage.yaml b/docs/api/admin/paths/products_tag-usage.yaml index 26a83cf4ce541..19e7537a295e5 100644 --- a/docs/api/admin/paths/products_tag-usage.yaml +++ b/docs/api/admin/paths/products_tag-usage.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: tags: type: array diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/products_types.yaml index 9aa1316d58bb1..0e668660335f5 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/products_types.yaml @@ -24,6 +24,7 @@ get: content: application/json: schema: + type: object properties: types: type: array diff --git a/docs/api/admin/paths/products_{id}.yaml b/docs/api/admin/paths/products_{id}.yaml index 78f4c9ba05c53..8f5a1fb944f76 100644 --- a/docs/api/admin/paths/products_{id}.yaml +++ b/docs/api/admin/paths/products_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: title: description: The title of the Product @@ -352,6 +355,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_metadata.yaml b/docs/api/admin/paths/products_{id}_metadata.yaml index fe651b87fdb1f..a12924da0efe7 100644 --- a/docs/api/admin/paths/products_{id}_metadata.yaml +++ b/docs/api/admin/paths/products_{id}_metadata.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - key - value @@ -44,6 +45,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_options.yaml b/docs/api/admin/paths/products_{id}_options.yaml index 8d0b52ad5e056..1759a58c75688 100644 --- a/docs/api/admin/paths/products_{id}_options.yaml +++ b/docs/api/admin/paths/products_{id}_options.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -40,6 +41,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml index 55147cbb1cff5..f508f113c0793 100644 --- a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml +++ b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml @@ -41,6 +41,7 @@ delete: content: application/json: schema: + type: object properties: option_id: type: string @@ -89,6 +90,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -116,6 +118,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_variants.yaml b/docs/api/admin/paths/products_{id}_variants.yaml index 86c6a29dc430f..63efd59531ca0 100644 --- a/docs/api/admin/paths/products_{id}_variants.yaml +++ b/docs/api/admin/paths/products_{id}_variants.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - title - prices @@ -139,6 +140,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml @@ -204,6 +206,7 @@ get: content: application/json: schema: + type: object properties: variants: type: array diff --git a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml index 8757dcb49f198..e72e74992bc27 100644 --- a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml +++ b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: variant_id: type: string @@ -86,6 +87,7 @@ post: content: application/json: schema: + type: object required: - prices properties: @@ -208,6 +210,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/publishable-api-key_{id}.yaml b/docs/api/admin/paths/publishable-api-key_{id}.yaml new file mode 100644 index 0000000000000..970817600073a --- /dev/null +++ b/docs/api/admin/paths/publishable-api-key_{id}.yaml @@ -0,0 +1,57 @@ +post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + description: A title to update for the key. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-key_{id}/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-key_{id}/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 diff --git a/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/publishable-api-keys.yaml new file mode 100644 index 0000000000000..c99c88912ce16 --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys.yaml @@ -0,0 +1,122 @@ +post: + operationId: PostPublishableApiKeys + summary: Create a PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 +get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeys + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_keys: + type: array + $ref: ../components/schemas/publishable_api_key.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 diff --git a/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml b/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml new file mode 100644 index 0000000000000..669ea97dc5fda --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml @@ -0,0 +1,44 @@ +get: + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeySalesChannels + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + sales_channels: + type: array + items: + $ref: ../components/schemas/sales_channel.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 diff --git a/docs/api/admin/paths/publishable-api-keys_{id}.yaml b/docs/api/admin/paths/publishable-api-keys_{id}.yaml new file mode 100644 index 0000000000000..d4352511a27b7 --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_{id}.yaml @@ -0,0 +1,95 @@ +delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys_{id}/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + format: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + '400': + $ref: ../components/responses/400_error.yaml +get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml new file mode 100644 index 0000000000000..f97a61a77a748 --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml @@ -0,0 +1,49 @@ +post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml new file mode 100644 index 0000000000000..15a34f324deec --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml @@ -0,0 +1,136 @@ +post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add sales channel to a publishable api key scope + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to add to the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Remove sales channel from a publishable api key scope + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to delete from the publishable api + key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 diff --git a/docs/api/admin/paths/regions.yaml b/docs/api/admin/paths/regions.yaml index ba35a4e700567..08eb2548f9355 100644 --- a/docs/api/admin/paths/regions.yaml +++ b/docs/api/admin/paths/regions.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name - currency_code @@ -76,6 +77,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml @@ -155,6 +157,7 @@ get: content: application/json: schema: + type: object properties: regions: type: array diff --git a/docs/api/admin/paths/regions_{id}.yaml b/docs/api/admin/paths/regions_{id}.yaml index a9c29b02a3929..a029d709ab5db 100644 --- a/docs/api/admin/paths/regions_{id}.yaml +++ b/docs/api/admin/paths/regions_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Region @@ -193,6 +196,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_countries.yaml b/docs/api/admin/paths/regions_{id}_countries.yaml index b2404bfd9e1c0..a319e402105e9 100644 --- a/docs/api/admin/paths/regions_{id}_countries.yaml +++ b/docs/api/admin/paths/regions_{id}_countries.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - country_code properties: @@ -44,6 +45,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml index c6da1963bc31f..95ea1544cb64d 100644 --- a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml +++ b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml @@ -41,6 +41,7 @@ delete: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml index 0ce08fc6fc011..04966fcc7714f 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml @@ -31,6 +31,7 @@ get: content: application/json: schema: + type: object properties: fulfillment_options: type: array diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml index 129611bdcf010..805220e108542 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - provider_id properties: @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml index 57446c4ae7acc..45bc96c7bf814 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_payment-providers.yaml b/docs/api/admin/paths/regions_{id}_payment-providers.yaml index 44b68388af812..04fbd3e38065f 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - provider_id properties: @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml index 4f56d83cb1bb5..c9f71b3f23bf8 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/return-reasons.yaml b/docs/api/admin/paths/return-reasons.yaml index ca2841f809d81..3174ac131782f 100644 --- a/docs/api/admin/paths/return-reasons.yaml +++ b/docs/api/admin/paths/return-reasons.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - label - value @@ -48,6 +49,7 @@ post: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml @@ -88,6 +90,7 @@ get: content: application/json: schema: + type: object properties: return_reasons: type: array diff --git a/docs/api/admin/paths/return-reasons_{id}.yaml b/docs/api/admin/paths/return-reasons_{id}.yaml index 8852d9e2bd124..14657da2d4b0f 100644 --- a/docs/api/admin/paths/return-reasons_{id}.yaml +++ b/docs/api/admin/paths/return-reasons_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: label: description: The label to display to the Customer. @@ -152,6 +155,7 @@ post: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml diff --git a/docs/api/admin/paths/returns.yaml b/docs/api/admin/paths/returns.yaml index c77387d735f45..f290bd7af54e7 100644 --- a/docs/api/admin/paths/returns.yaml +++ b/docs/api/admin/paths/returns.yaml @@ -35,6 +35,7 @@ get: content: application/json: schema: + type: object properties: returns: type: array diff --git a/docs/api/admin/paths/returns_{id}_cancel.yaml b/docs/api/admin/paths/returns_{id}_cancel.yaml index 0ca536a9a7495..5960e6833297b 100644 --- a/docs/api/admin/paths/returns_{id}_cancel.yaml +++ b/docs/api/admin/paths/returns_{id}_cancel.yaml @@ -29,6 +29,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/returns_{id}_receive.yaml b/docs/api/admin/paths/returns_{id}_receive.yaml index 0c6986d3f1a65..10e260fbeda27 100644 --- a/docs/api/admin/paths/returns_{id}_receive.yaml +++ b/docs/api/admin/paths/returns_{id}_receive.yaml @@ -15,6 +15,7 @@ post: content: application/json: schema: + type: object required: - items properties: @@ -55,6 +56,7 @@ post: content: application/json: schema: + type: object properties: return: $ref: ../components/schemas/return.yaml diff --git a/docs/api/admin/paths/sales-channels.yaml b/docs/api/admin/paths/sales-channels.yaml index 63108a06187ef..a3f067eb41b5f 100644 --- a/docs/api/admin/paths/sales-channels.yaml +++ b/docs/api/admin/paths/sales-channels.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name properties: @@ -39,6 +40,7 @@ post: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml @@ -197,6 +199,7 @@ get: content: application/json: schema: + type: object properties: sales_channels: type: array diff --git a/docs/api/admin/paths/sales-channels_{id}.yaml b/docs/api/admin/paths/sales-channels_{id}.yaml index e5e5b9d514439..f4f09ece87a63 100644 --- a/docs/api/admin/paths/sales-channels_{id}.yaml +++ b/docs/api/admin/paths/sales-channels_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: name: type: string @@ -147,6 +150,7 @@ post: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml diff --git a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml index 46e364527f584..c703ac2dc5712 100644 --- a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml +++ b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - product_ids properties: @@ -49,6 +50,7 @@ post: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml @@ -80,6 +82,7 @@ delete: content: application/json: schema: + type: object required: - product_ids properties: @@ -116,6 +119,7 @@ delete: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml diff --git a/docs/api/admin/paths/shipping-options.yaml b/docs/api/admin/paths/shipping-options.yaml index 46d0c773df690..e8b543375abc7 100644 --- a/docs/api/admin/paths/shipping-options.yaml +++ b/docs/api/admin/paths/shipping-options.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name - region_id @@ -97,6 +98,7 @@ post: content: application/json: schema: + type: object properties: shipping_option: $ref: ../components/schemas/shipping_option.yaml @@ -153,6 +155,7 @@ get: content: application/json: schema: + type: object properties: shipping_options: type: array diff --git a/docs/api/admin/paths/shipping-options_{id}.yaml b/docs/api/admin/paths/shipping-options_{id}.yaml index b744a44e860ed..71b96823384ed 100644 --- a/docs/api/admin/paths/shipping-options_{id}.yaml +++ b/docs/api/admin/paths/shipping-options_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: shipping_option: $ref: ../components/schemas/shipping_option.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object required: - requirements properties: @@ -177,6 +180,7 @@ post: content: application/json: schema: + type: object properties: shipping_option: $ref: ../components/schemas/shipping_option.yaml diff --git a/docs/api/admin/paths/shipping-profiles.yaml b/docs/api/admin/paths/shipping-profiles.yaml index e55229bf45c19..4352be2379e13 100644 --- a/docs/api/admin/paths/shipping-profiles.yaml +++ b/docs/api/admin/paths/shipping-profiles.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name properties: @@ -33,6 +34,7 @@ post: content: application/json: schema: + type: object properties: shipping_profile: $ref: ../components/schemas/shipping_profile.yaml @@ -73,6 +75,7 @@ get: content: application/json: schema: + type: object properties: shipping_profiles: type: array diff --git a/docs/api/admin/paths/shipping-profiles_{id}.yaml b/docs/api/admin/paths/shipping-profiles_{id}.yaml index 4777f1df22c40..319dae965b8ff 100644 --- a/docs/api/admin/paths/shipping-profiles_{id}.yaml +++ b/docs/api/admin/paths/shipping-profiles_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: shipping_profile: $ref: ../components/schemas/shipping_profile.yaml @@ -116,6 +118,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Shipping Profile @@ -140,6 +143,7 @@ post: content: application/json: schema: + type: object properties: shipping_profile: $ref: ../components/schemas/shipping_profile.yaml diff --git a/docs/api/admin/paths/store.yaml b/docs/api/admin/paths/store.yaml index 149a3c728486b..73000bd2ef1b2 100644 --- a/docs/api/admin/paths/store.yaml +++ b/docs/api/admin/paths/store.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml @@ -47,6 +48,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Store @@ -100,6 +102,7 @@ post: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml diff --git a/docs/api/admin/paths/store_currencies_{code}.yaml b/docs/api/admin/paths/store_currencies_{code}.yaml index 721be4211e796..5d7f1b006c4cc 100644 --- a/docs/api/admin/paths/store_currencies_{code}.yaml +++ b/docs/api/admin/paths/store_currencies_{code}.yaml @@ -33,6 +33,7 @@ post: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml @@ -83,6 +84,7 @@ delete: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml diff --git a/docs/api/admin/paths/store_payment-providers.yaml b/docs/api/admin/paths/store_payment-providers.yaml index afd483d40c0df..f44208295c860 100644 --- a/docs/api/admin/paths/store_payment-providers.yaml +++ b/docs/api/admin/paths/store_payment-providers.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: payment_providers: type: array diff --git a/docs/api/admin/paths/store_tax-providers.yaml b/docs/api/admin/paths/store_tax-providers.yaml index b4fda4e5b47ce..1dc2ca93469ac 100644 --- a/docs/api/admin/paths/store_tax-providers.yaml +++ b/docs/api/admin/paths/store_tax-providers.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: tax_providers: type: array diff --git a/docs/api/admin/paths/swaps.yaml b/docs/api/admin/paths/swaps.yaml index 9b3112d57798b..eef8025b2e880 100644 --- a/docs/api/admin/paths/swaps.yaml +++ b/docs/api/admin/paths/swaps.yaml @@ -36,6 +36,7 @@ get: content: application/json: schema: + type: object properties: swaps: type: array diff --git a/docs/api/admin/paths/swaps_{id}.yaml b/docs/api/admin/paths/swaps_{id}.yaml index 699120057deaa..ce9c635afb010 100644 --- a/docs/api/admin/paths/swaps_{id}.yaml +++ b/docs/api/admin/paths/swaps_{id}.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: swap: $ref: ../components/schemas/swap.yaml diff --git a/docs/api/admin/paths/tax-rates.yaml b/docs/api/admin/paths/tax-rates.yaml index f0ebc9d6eba53..089b0007dfe8c 100644 --- a/docs/api/admin/paths/tax-rates.yaml +++ b/docs/api/admin/paths/tax-rates.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object required: - code - name @@ -78,6 +79,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -192,6 +194,7 @@ get: content: application/json: schema: + type: object properties: tax_rates: type: array diff --git a/docs/api/admin/paths/tax-rates_{id}.yaml b/docs/api/admin/paths/tax-rates_{id}.yaml index 0e5410eb63dd5..ad00d6371a783 100644 --- a/docs/api/admin/paths/tax-rates_{id}.yaml +++ b/docs/api/admin/paths/tax-rates_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -104,6 +105,7 @@ get: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -153,6 +155,7 @@ post: content: application/json: schema: + type: object properties: code: type: string @@ -201,6 +204,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml index 23b9f1294ecc8..29b787caf5fbd 100644 --- a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object required: - product_types properties: @@ -61,6 +62,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -110,6 +112,7 @@ delete: content: application/json: schema: + type: object required: - product_types properties: @@ -142,6 +145,7 @@ delete: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml index 8a15b2f072171..db4f16f995419 100644 --- a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object required: - products properties: @@ -60,6 +61,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -109,6 +111,7 @@ delete: content: application/json: schema: + type: object required: - products properties: @@ -138,6 +141,7 @@ delete: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml index fd37d0577b64e..5cbe03173b542 100644 --- a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object required: - shipping_options properties: @@ -62,6 +63,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -111,6 +113,7 @@ delete: content: application/json: schema: + type: object required: - shipping_options properties: @@ -143,6 +146,7 @@ delete: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/uploads.yaml b/docs/api/admin/paths/uploads.yaml index 56e781fdf8602..a9266807357eb 100644 --- a/docs/api/admin/paths/uploads.yaml +++ b/docs/api/admin/paths/uploads.yaml @@ -34,6 +34,7 @@ post: content: application/json: schema: + type: object properties: uploads: type: array diff --git a/docs/api/admin/paths/uploads_protected.yaml b/docs/api/admin/paths/uploads_protected.yaml index 5099c3e215b62..15a1bc164ca61 100644 --- a/docs/api/admin/paths/uploads_protected.yaml +++ b/docs/api/admin/paths/uploads_protected.yaml @@ -34,6 +34,7 @@ post: content: application/json: schema: + type: object properties: uploads: type: array diff --git a/docs/api/admin/paths/users.yaml b/docs/api/admin/paths/users.yaml index 51b9dd2694af3..71a4ce1f42256 100644 --- a/docs/api/admin/paths/users.yaml +++ b/docs/api/admin/paths/users.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email - password @@ -52,6 +53,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml @@ -92,6 +94,7 @@ get: content: application/json: schema: + type: object properties: users: type: array diff --git a/docs/api/admin/paths/users_password-token.yaml b/docs/api/admin/paths/users_password-token.yaml index 6b438d3770391..d1f0912af2ea7 100644 --- a/docs/api/admin/paths/users_password-token.yaml +++ b/docs/api/admin/paths/users_password-token.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email properties: diff --git a/docs/api/admin/paths/users_reset-password.yaml b/docs/api/admin/paths/users_reset-password.yaml index 28cc8b68e442c..ac2a00085cf78 100644 --- a/docs/api/admin/paths/users_reset-password.yaml +++ b/docs/api/admin/paths/users_reset-password.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - token - password @@ -42,6 +43,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml diff --git a/docs/api/admin/paths/users_{id}.yaml b/docs/api/admin/paths/users_{id}.yaml index 29896f57476e2..c702e5d767b4d 100644 --- a/docs/api/admin/paths/users_{id}.yaml +++ b/docs/api/admin/paths/users_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: first_name: description: The name of the User. @@ -157,6 +160,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/variants.yaml index 0eb69611a8151..82985adaf91cc 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/variants.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: variants: type: array diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 7433eef331513..3e72e4310e68d 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -187,6 +187,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -285,6 +286,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -338,6 +340,7 @@ paths: content: application/json: schema: + type: object properties: exists: type: boolean @@ -399,6 +402,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -458,6 +462,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -520,6 +525,7 @@ paths: content: application/json: schema: + type: object properties: type: type: string @@ -579,6 +585,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -648,6 +655,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -661,92 +669,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items': - 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 - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.create(cart_id, { - variant_id, - quantity: 1 - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "variant_id": "{variant_id}", - "quantity": 1 - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. '/carts/{id}/payment-sessions': post: operationId: PostCartsCartPaymentSessions @@ -788,6 +710,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -846,6 +769,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -904,6 +828,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -969,6 +894,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1042,6 +968,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1108,6 +1035,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1171,6 +1099,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1199,6 +1128,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -1295,6 +1225,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1357,6 +1288,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1419,6 +1351,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1443,16 +1376,16 @@ paths: provider_id: type: string description: The ID of the Payment Provider. - '/collections/{id}': + '/gift-cards/{code}': get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. parameters: - in: path - name: id + name: code required: true - description: The id of the Product Collection + description: The unique Gift Card code. schema: type: string x-codeSamples: @@ -1464,142 +1397,28 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.collections.retrieve(collection_id) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/collections/{id}' - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /collections: - get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. - parameters: - - in: query - name: offset - description: >- - The number of collections to skip before starting to collect the - collections set - schema: - type: integer - default: 0 - - in: query - name: limit - description: The number of collections to return - schema: - type: integer - default: 10 - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - 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: Date comparison for when resulting collections were updated. - 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: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.collections.list() + medusa.giftCards.retrieve(code) - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/collections' + 'https://medusa-url.com/store/gift-cards/{code}' tags: - - Collection + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' '404': @@ -1620,6 +1439,7 @@ paths: content: application/json: schema: + type: object required: - address properties: @@ -1695,6 +1515,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1719,6 +1540,7 @@ paths: content: application/json: schema: + type: object required: - first_name - last_name @@ -1783,6 +1605,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1797,6 +1620,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -1861,6 +1685,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1935,6 +1760,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1991,6 +1817,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2015,6 +1842,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The Customer's first name. @@ -2082,6 +1910,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2139,6 +1968,7 @@ paths: content: application/json: schema: + type: object properties: payment_methods: type: array @@ -2370,6 +2200,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -2408,6 +2239,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -2474,6 +2306,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -2529,6 +2362,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2544,68 +2378,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + '/order-edits/{id}/complete': + post: + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. parameters: - in: path - name: code + name: id required: true - description: The unique Gift Card code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/complete': - post: - operationId: PostOrderEditsOrderEditComplete - summary: Completes an OrderEdit - description: Completes an OrderEdit. - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit. + description: The ID of the Order Edit. schema: type: string x-codeSamples: @@ -2634,6 +2416,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2661,6 +2444,7 @@ paths: content: application/json: schema: + type: object properties: declined_reason: type: string @@ -2691,6 +2475,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2741,6 +2526,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2756,6 +2542,76 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.confirmRequest( + token, + ) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/orders/customer/confirm' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/orders/cart/{cart_id}': get: operationId: GetOrdersOrderCartId @@ -2767,9 +2623,665 @@ paths: - in: path name: cart_id required: true - description: The ID of Cart. + description: The ID of Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieveByCartId(cart_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/cart/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieve(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: Look up an order using filters. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: email + style: form + explode: false + description: The email associated with this order. + required: true + schema: + type: string + format: email + - in: query + name: shipping_address + style: form + explode: false + description: The shipping address associated with this order. + schema: + type: object + properties: + postal_code: + type: string + description: The postal code of the shipping address + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.lookupOrder({ + display_id: 1, + email: 'user@example.com' + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account + description: >- + Sends an email to emails registered to orders provided with link to + transfer order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.claimOrders({ + display_ids, + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/collections/{id}': + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/collections/{id}' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + parameters: + - in: query + name: offset + description: >- + The number of collections to skip before starting to collect the + collections set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return + schema: + type: integer + default: 10 + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + 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: Date comparison for when resulting collections were updated. + 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: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/collections' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collections: + type: array + items: + $ref: '#/components/schemas/product_collection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch/authorize': + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes 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: + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}/authorize': + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch': + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + 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: + properties: + sessions: + description: >- + An array of payment sessions related to the Payment + Collection. If the session_id is not provided, existing + sessions not present will be deleted and the provided ones + will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. x-codeSamples: - lang: JavaScript label: JS Client @@ -2779,18 +3291,50 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.retrieveByCartId(cart_id) + // must be previously logged in or use api token - .then(({ order }) => { - console.log(order.id); + // Total amount = 10000 + + // Adding two new sessions + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/orders/cart/{id}' + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] tags: - - Order + - Payment responses: '200': description: OK @@ -2798,10 +3342,12 @@ paths: application/json: schema: properties: - order: - $ref: '#/components/schemas/order' + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2810,18 +3356,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}': - get: - operationId: GetOrdersOrder - summary: Get an Order - description: Retrieves an Order + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false parameters: - in: path name: id required: true - description: The id of the Order. + description: The ID of the Payment Collection. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. x-codeSamples: - lang: JavaScript label: JS Client @@ -2831,18 +3388,28 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.retrieve(order_id) + // must be previously logged in or use api token - .then(({ order }) => { - console.log(order.id); + // Total amount = 10000 + + // Adding a payment session + + medusa.paymentCollections.managePaymentSession(payment_id, { + provider_id: "stripe" }) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/orders/{id}' + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] tags: - - Order + - Payment responses: '200': description: OK @@ -2850,10 +3417,12 @@ paths: application/json: schema: properties: - order: - $ref: '#/components/schemas/order' + payment_collection: + $ref: '#/components/schemas/payment_collection' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2862,38 +3431,42 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /orders: - get: - operationId: GetOrders - summary: Look Up an Order - description: Look up an order using filters. + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the + Payment Collection. + x-authenticated: false parameters: - - in: query - name: display_id + - in: path + name: id required: true - description: The display id given to the Order. + description: The id of the PaymentCollection. schema: - type: number - - in: query - name: email - style: form - explode: false - description: The email associated with this order. + type: string + - in: path + name: session_id required: true + description: The id of the Payment Session to be refreshed. schema: type: string - format: email - - in: query - name: shipping_address - style: form - explode: false - description: The shipping address associated with this order. - schema: - type: object - properties: - postal_code: - type: string - description: The postal code of the shipping address + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - customer_id + properties: + provider_id: + description: The Payment Provider id. + type: string + customer_id: + description: The Customer id. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -2903,30 +3476,29 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.lookupOrder({ - display_id: 1, - email: 'user@example.com' - }) + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id, payload) - .then(({ order }) => { - console.log(order.id); + .then(({ payment_session }) => { + console.log(payment_session.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' tags: - - Order + - PaymentCollection responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + payment_session: + $ref: '#/components/schemas/payment_session' '400': $ref: '#/components/responses/400_error' '404': @@ -3067,6 +3639,7 @@ paths: content: application/json: schema: + type: object properties: product_types: $ref: '#/components/schemas/product_type' @@ -3154,6 +3727,7 @@ paths: content: application/json: schema: + type: object properties: product: allOf: @@ -3354,6 +3928,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -3441,6 +4016,7 @@ paths: content: application/json: schema: + type: object properties: hits: type: array @@ -3496,6 +4072,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -3597,6 +4174,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -3651,6 +4229,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -3696,6 +4275,7 @@ paths: content: application/json: schema: + type: object properties: return_reasons: type: array @@ -3720,6 +4300,7 @@ paths: content: application/json: schema: + type: object required: - order_id - items @@ -3808,6 +4389,7 @@ paths: content: application/json: schema: + type: object properties: return: $ref: '#/components/schemas/return' @@ -3871,6 +4453,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3925,6 +4508,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3951,6 +4535,7 @@ paths: content: application/json: schema: + type: object required: - order_id - return_items @@ -4057,6 +4642,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4109,6 +4695,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4168,6 +4755,7 @@ paths: content: application/json: schema: + type: object properties: variant: allOf: @@ -4264,6 +4852,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -4281,6 +4870,93 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/line-items': + 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 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: >- + The id of the Product Variant to generate the Line Item + from. + quantity: + type: integer + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the + Line Item. components: responses: default_error: @@ -4486,6 +5162,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -4540,6 +5217,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -4623,6 +5301,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -4765,6 +5444,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -4942,6 +5622,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -4985,6 +5666,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -5072,6 +5754,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -5193,6 +5876,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -5225,6 +5909,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -5279,6 +5964,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -5314,6 +6000,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -5372,6 +6059,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -5419,6 +6107,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -5436,7 +6125,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -5492,6 +6181,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -5527,6 +6217,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -5562,6 +6253,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -5597,6 +6289,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -5632,6 +6325,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -5667,6 +6361,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -5764,6 +6459,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -5831,6 +6527,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -5923,6 +6620,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -5997,6 +6695,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -6028,6 +6727,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -6051,6 +6751,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -6166,6 +6867,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -6212,6 +6914,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -6283,6 +6986,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -6337,6 +7041,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -6369,6 +7074,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -6420,6 +7126,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -6460,6 +7167,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -6510,6 +7218,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -6704,6 +7413,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -6787,6 +7497,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -6838,6 +7549,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -6860,6 +7572,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -6927,6 +7640,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -6990,6 +7704,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -7023,6 +7738,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -7151,6 +7867,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -7208,6 +7925,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -7486,6 +8204,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -7511,12 +8230,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -7526,12 +8240,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -7583,6 +8291,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -7607,6 +8316,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -7680,6 +8390,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -7777,6 +8488,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -7853,6 +8565,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -7902,6 +8615,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -7960,6 +8674,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -8007,6 +8722,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -8041,6 +8757,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -8078,6 +8795,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -8115,6 +8833,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -8151,6 +8870,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -8304,6 +9024,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -8347,6 +9068,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -8537,6 +9259,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -8544,6 +9322,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -8610,6 +9389,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -8714,6 +9494,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -8772,6 +9553,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -8826,6 +9608,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -8926,6 +9709,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -8961,6 +9745,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -9010,6 +9795,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -9094,6 +9880,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -9142,6 +9929,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -9248,6 +10036,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -9311,6 +10100,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -9346,6 +10136,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -9365,6 +10156,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -9432,6 +10224,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -9579,6 +10372,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -9616,6 +10410,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -9634,6 +10429,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -9717,6 +10513,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -9770,6 +10567,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -9813,6 +10611,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -9827,6 +10626,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 7433eef331513..44c93cf5228f7 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -145,213 +145,6 @@ tags: servers: - url: 'https://api.medusa-commerce.com/store' paths: - /auth: - post: - operationId: PostAuth - summary: Customer Login - description: >- - Logs a Customer in and authorizes them to view their details. Successful - authentication will set a session cookie in the Customer's browser. - parameters: [] - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.auth.authenticate({ - email: 'user@example.com', - password: 'user@example.com' - }) - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/auth' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "email": "user@example.com", - "password": "supersecret" - }' - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/incorrect_credentials' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. - delete: - operationId: DeleteAuth - summary: Customer Log out - description: Destroys a Customer's authenticated session. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request DELETE 'https://medusa-url.com/store/auth' - \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Auth - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetAuth - summary: Get Current Customer - description: Gets the currently logged in Customer. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.auth.getSession() - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/store/auth' \ - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/auth/{email}': - get: - operationId: GetAuthEmail - summary: Check if email exists - description: Checks if a Customer with the given email has signed up. - parameters: - - in: path - name: email - schema: - type: string - format: email - required: true - description: The email to check if exists. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.auth.exists('user@example.com') - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/auth/user@example.com' \ - - --header 'Cookie: connect.sid={sid}' - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - exists: - type: boolean - description: Whether email exists or not. - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' '/carts/{id}/shipping-methods': post: operationId: PostCartsCartShippingMethod @@ -399,6 +192,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -458,6 +252,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -520,6 +315,7 @@ paths: content: application/json: schema: + type: object properties: type: type: string @@ -579,6 +375,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -648,6 +445,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -661,18 +459,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items': + '/carts/{id}/payment-sessions': post: - operationId: PostCartsCartLineItems - summary: Add a Line Item + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions description: >- - Generates a Line Item with a given Product Variant and adds it to the - Cart + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. parameters: - in: path name: id required: true - description: The id of the Cart to add the Line Item to. + description: The id of the Cart. schema: type: string x-codeSamples: @@ -684,10 +482,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.lineItems.create(cart_id, { - variant_id, - quantity: 1 - }) + medusa.carts.createPaymentSessions(cart_id) .then(({ cart }) => { console.log(cart.id); @@ -696,90 +491,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "variant_id": "{variant_id}", - "quantity": 1 - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.createPaymentSessions(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' + 'https://medusa-url.com/store/carts/{id}/payment-sessions' tags: - Cart responses: @@ -788,6 +500,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -846,6 +559,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -904,6 +618,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -969,6 +684,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1042,6 +758,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1108,6 +825,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1171,6 +889,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1199,6 +918,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -1295,6 +1015,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1357,6 +1078,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1419,6 +1141,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1443,6 +1166,59 @@ paths: provider_id: type: string description: The ID of the Payment Provider. + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.giftCards.retrieve(code) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/gift-cards/{code}' + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + gift_card: + $ref: '#/components/schemas/gift_card' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/collections/{id}': get: operationId: GetCollectionsCollection @@ -1482,6 +1258,7 @@ paths: content: application/json: schema: + type: object properties: collection: $ref: '#/components/schemas/product_collection' @@ -1586,6 +1363,7 @@ paths: content: application/json: schema: + type: object properties: collections: type: array @@ -1620,6 +1398,7 @@ paths: content: application/json: schema: + type: object required: - address properties: @@ -1695,6 +1474,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1719,6 +1499,7 @@ paths: content: application/json: schema: + type: object required: - first_name - last_name @@ -1783,6 +1564,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1797,6 +1579,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -1861,6 +1644,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1935,6 +1719,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1991,6 +1776,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2015,6 +1801,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The Customer's first name. @@ -2082,6 +1869,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2139,6 +1927,7 @@ paths: content: application/json: schema: + type: object properties: payment_methods: type: array @@ -2370,6 +2159,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -2408,6 +2198,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -2474,6 +2265,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -2529,6 +2321,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2544,58 +2337,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. - parameters: - - in: path - name: code - required: true - description: The unique Gift Card code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' '/order-edits/{id}/complete': post: operationId: PostOrderEditsOrderEditComplete @@ -2634,6 +2375,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2661,6 +2403,7 @@ paths: content: application/json: schema: + type: object properties: declined_reason: type: string @@ -2691,6 +2434,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2741,6 +2485,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2756,6 +2501,76 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.confirmRequest( + token, + ) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/orders/customer/confirm' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/orders/cart/{cart_id}': get: operationId: GetOrdersOrderCartId @@ -2771,37 +2586,816 @@ paths: schema: type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.orders.retrieveByCartId(cart_id) - - .then(({ order }) => { - console.log(order.id); - }); + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieveByCartId(cart_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/cart/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieve(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: Look up an order using filters. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: email + style: form + explode: false + description: The email associated with this order. + required: true + schema: + type: string + format: email + - in: query + name: shipping_address + style: form + explode: false + description: The shipping address associated with this order. + schema: + type: object + properties: + postal_code: + type: string + description: The postal code of the shipping address + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.lookupOrder({ + display_id: 1, + email: 'user@example.com' + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account + description: >- + Sends an email to emails registered to orders provided with link to + transfer order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.claimOrders({ + display_ids, + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch/authorize': + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes 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: + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}/authorize': + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch': + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + 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: + properties: + sessions: + description: >- + An array of payment sessions related to the Payment + Collection. If the session_id is not provided, existing + sessions not present will be deleted and the provided ones + will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding two new sessions + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + 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: + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding a payment session + + medusa.paymentCollections.managePaymentSession(payment_id, { + provider_id: "stripe" }) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session 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 + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - customer_id + properties: + provider_id: + description: The Payment Provider id. + type: string + customer_id: + description: The Customer id. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id, payload) + + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /auth: + post: + operationId: PostAuth + summary: Customer Login + description: >- + Logs a Customer in and authorizes them to view their details. Successful + authentication will set a session cookie in the Customer's browser. + parameters: [] + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.auth.authenticate({ + email: 'user@example.com', + password: 'user@example.com' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + delete: + operationId: DeleteAuth + summary: Customer Log out + description: Destroys a Customer's authenticated session. + x-authenticated: true + x-codeSamples: - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/orders/cart/{id}' + curl --location --request DELETE 'https://medusa-url.com/store/auth' + \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Order + - Auth responses: '200': description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2810,18 +3404,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}': get: - operationId: GetOrdersOrder - summary: Get an Order - description: Retrieves an Order - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -2831,29 +3418,36 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.retrieve(order_id) + // must be previously logged - .then(({ order }) => { - console.log(order.id); + medusa.auth.getSession() + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/orders/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Order + - Auth responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2862,38 +3456,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /orders: + '/auth/{email}': get: - operationId: GetOrders - summary: Look Up an Order - description: Look up an order using filters. + operationId: GetAuthEmail + summary: Check if email exists + description: Checks if a Customer with the given email has signed up. parameters: - - in: query - name: display_id - required: true - description: The display id given to the Order. - schema: - type: number - - in: query + - in: path name: email - style: form - explode: false - description: The email associated with this order. - required: true schema: type: string format: email - - in: query - name: shipping_address - style: form - explode: false - description: The shipping address associated with this order. - schema: - type: object - properties: - postal_code: - type: string - description: The postal code of the shipping address + required: true + description: The email to check if exists. x-codeSamples: - lang: JavaScript label: JS Client @@ -2903,30 +3478,27 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.lookupOrder({ - display_id: 1, - email: 'user@example.com' - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.auth.exists('user@example.com') - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + 'https://medusa-url.com/store/auth/user@example.com' \ + + --header 'Cookie: connect.sid={sid}' tags: - - Order + - Auth responses: '200': description: OK content: application/json: schema: + type: object properties: - order: - $ref: '#/components/schemas/order' + exists: + type: boolean + description: Whether email exists or not. '400': $ref: '#/components/responses/400_error' '404': @@ -3067,6 +3639,7 @@ paths: content: application/json: schema: + type: object properties: product_types: $ref: '#/components/schemas/product_type' @@ -3154,6 +3727,7 @@ paths: content: application/json: schema: + type: object properties: product: allOf: @@ -3354,6 +3928,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -3441,6 +4016,7 @@ paths: content: application/json: schema: + type: object properties: hits: type: array @@ -3496,6 +4072,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -3597,6 +4174,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -3651,6 +4229,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -3696,6 +4275,7 @@ paths: content: application/json: schema: + type: object properties: return_reasons: type: array @@ -3720,6 +4300,7 @@ paths: content: application/json: schema: + type: object required: - order_id - items @@ -3808,6 +4389,7 @@ paths: content: application/json: schema: + type: object properties: return: $ref: '#/components/schemas/return' @@ -3871,6 +4453,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3925,6 +4508,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3951,6 +4535,7 @@ paths: content: application/json: schema: + type: object required: - order_id - return_items @@ -4057,6 +4642,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4109,6 +4695,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4168,6 +4755,7 @@ paths: content: application/json: schema: + type: object properties: variant: allOf: @@ -4264,6 +4852,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -4281,6 +4870,93 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/line-items': + 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 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: >- + The id of the Product Variant to generate the Line Item + from. + quantity: + type: integer + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the + Line Item. components: responses: default_error: @@ -4486,6 +5162,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -4540,6 +5217,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -4623,6 +5301,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -4765,6 +5444,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -4942,6 +5622,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -4985,6 +5666,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -5072,6 +5754,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -5193,6 +5876,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -5225,6 +5909,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -5279,6 +5964,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -5314,6 +6000,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -5372,6 +6059,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -5419,6 +6107,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -5436,7 +6125,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -5492,6 +6181,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -5527,6 +6217,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -5562,6 +6253,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -5597,6 +6289,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -5632,6 +6325,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -5667,6 +6361,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -5764,6 +6459,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -5831,6 +6527,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -5923,6 +6620,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -5997,6 +6695,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -6028,6 +6727,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -6051,6 +6751,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -6166,6 +6867,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -6212,6 +6914,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -6283,6 +6986,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -6337,6 +7041,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -6369,6 +7074,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -6420,6 +7126,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -6460,6 +7167,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -6510,6 +7218,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -6704,6 +7413,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -6787,6 +7497,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -6838,6 +7549,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -6860,6 +7572,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -6927,6 +7640,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -6990,6 +7704,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -7023,6 +7738,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -7151,6 +7867,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -7208,6 +7925,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -7486,6 +8204,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -7511,12 +8230,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -7526,12 +8240,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -7583,6 +8291,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -7607,6 +8316,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -7680,6 +8390,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -7777,6 +8488,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -7853,6 +8565,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -7902,6 +8615,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -7960,6 +8674,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -8007,6 +8722,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -8041,6 +8757,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -8078,6 +8795,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -8115,6 +8833,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -8151,6 +8870,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -8304,6 +9024,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -8347,6 +9068,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -8537,6 +9259,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -8544,6 +9322,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -8610,6 +9389,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -8714,6 +9494,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -8772,6 +9553,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -8826,6 +9608,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -8926,6 +9709,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -8961,6 +9745,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -9010,6 +9795,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -9094,6 +9880,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -9142,6 +9929,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -9248,6 +10036,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -9311,6 +10100,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -9346,6 +10136,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -9365,6 +10156,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -9432,6 +10224,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -9579,6 +10372,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -9616,6 +10410,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -9634,6 +10429,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -9717,6 +10513,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -9770,6 +10567,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -9813,6 +10611,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -9827,6 +10626,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined b/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined new file mode 100644 index 0000000000000..72554acc41484 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined @@ -0,0 +1,12 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.orders.claimOrders({ + display_ids, +}) +.then(() => { + // successful +}) +.catch(() => { + // an error occurred +}); diff --git a/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined b/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined new file mode 100644 index 0000000000000..10c39a00a1b6f --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined @@ -0,0 +1,12 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.orders.confirmRequest( + token, +) +.then(() => { + // successful +}) +.catch(() => { + // an error occurred +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined new file mode 100644 index 0000000000000..8a6b6889425a1 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined new file mode 100644 index 0000000000000..3205e03ec79dd --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +// Total amount = 10000 +// Adding a payment session +medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined new file mode 100644 index 0000000000000..fdc8f51a65ac7 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined @@ -0,0 +1,29 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +// Total amount = 10000 +// Adding two new sessions +medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, +]) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); +// Updating one session and removing the other +medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, +]) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined new file mode 100644 index 0000000000000..07a13c56a90a5 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.paymentCollections.authorize(payment_id) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined new file mode 100644 index 0000000000000..f160bb1dda6ac --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined @@ -0,0 +1,6 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id, payload) +.then(({ payment_session }) => { + console.log(payment_session.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined new file mode 100644 index 0000000000000..6ded159b96f5a --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.paymentCollections.authorize(payment_id, session_id) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined b/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined new file mode 100644 index 0000000000000..21521c3ef5459 --- /dev/null +++ b/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined @@ -0,0 +1,5 @@ +curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "display_ids": ["id"], +}' diff --git a/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined b/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined new file mode 100644 index 0000000000000..2439ee98c353b --- /dev/null +++ b/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined @@ -0,0 +1,5 @@ +curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "token": "{token}", +}' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined new file mode 100644 index 0000000000000..8901cffbad233 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined @@ -0,0 +1 @@ +curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined new file mode 100644 index 0000000000000..1d15f4300e82a --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined new file mode 100644 index 0000000000000..4c5bcbc44bcb2 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined new file mode 100644 index 0000000000000..33206c8c19cc1 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined new file mode 100644 index 0000000000000..c307160781303 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined new file mode 100644 index 0000000000000..ece1417b0cce6 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' diff --git a/docs/api/store/components/schemas/OAuth.yaml b/docs/api/store/components/schemas/OAuth.yaml index a9afba0974fb4..6b6cb8b660290 100644 --- a/docs/api/store/components/schemas/OAuth.yaml +++ b/docs/api/store/components/schemas/OAuth.yaml @@ -1,6 +1,7 @@ title: OAuth description: Represent an OAuth app x-resourceId: OAuth +type: object required: - id - display_name diff --git a/docs/api/store/components/schemas/address.yaml b/docs/api/store/components/schemas/address.yaml index ff413792f1c9e..d39d1760ae183 100644 --- a/docs/api/store/components/schemas/address.yaml +++ b/docs/api/store/components/schemas/address.yaml @@ -1,6 +1,7 @@ title: Address description: An address. x-resourceId: address +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/address_fields.yaml b/docs/api/store/components/schemas/address_fields.yaml index 110810299c65b..303b9d5ca9e36 100644 --- a/docs/api/store/components/schemas/address_fields.yaml +++ b/docs/api/store/components/schemas/address_fields.yaml @@ -1,6 +1,7 @@ title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address +type: object properties: company: type: string diff --git a/docs/api/store/components/schemas/batch_job.yaml b/docs/api/store/components/schemas/batch_job.yaml index dcb63d5f55f8d..c06c261ba5a24 100644 --- a/docs/api/store/components/schemas/batch_job.yaml +++ b/docs/api/store/components/schemas/batch_job.yaml @@ -1,6 +1,7 @@ title: Batch Job description: A Batch Job. x-resourceId: batch_job +type: object required: - type properties: diff --git a/docs/api/store/components/schemas/cart.yaml b/docs/api/store/components/schemas/cart.yaml index 0881621115781..de1d520a2dbfd 100644 --- a/docs/api/store/components/schemas/cart.yaml +++ b/docs/api/store/components/schemas/cart.yaml @@ -1,6 +1,7 @@ title: Cart description: Represents a user cart x-resourceId: cart +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/claim_image.yaml b/docs/api/store/components/schemas/claim_image.yaml index 5b2d04e74b297..783d89c06d29b 100644 --- a/docs/api/store/components/schemas/claim_image.yaml +++ b/docs/api/store/components/schemas/claim_image.yaml @@ -1,6 +1,7 @@ title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image +type: object required: - claim_item_id - url diff --git a/docs/api/store/components/schemas/claim_item.yaml b/docs/api/store/components/schemas/claim_item.yaml index ccec3c8ebf1bf..cb7e85c9dde55 100644 --- a/docs/api/store/components/schemas/claim_item.yaml +++ b/docs/api/store/components/schemas/claim_item.yaml @@ -3,6 +3,7 @@ description: >- Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item +type: object required: - claim_order_id - item_id diff --git a/docs/api/store/components/schemas/claim_order.yaml b/docs/api/store/components/schemas/claim_order.yaml index 1d26758cec2d4..ed55db009d026 100644 --- a/docs/api/store/components/schemas/claim_order.yaml +++ b/docs/api/store/components/schemas/claim_order.yaml @@ -4,6 +4,7 @@ description: >- consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order +type: object required: - type - order_id diff --git a/docs/api/store/components/schemas/claim_tag.yaml b/docs/api/store/components/schemas/claim_tag.yaml index bf7b96a3dbaa4..46a23e4da852e 100644 --- a/docs/api/store/components/schemas/claim_tag.yaml +++ b/docs/api/store/components/schemas/claim_tag.yaml @@ -3,6 +3,7 @@ description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag +type: object required: - value properties: diff --git a/docs/api/store/components/schemas/country.yaml b/docs/api/store/components/schemas/country.yaml index 8bd271c77cce6..d8a7a18e36056 100644 --- a/docs/api/store/components/schemas/country.yaml +++ b/docs/api/store/components/schemas/country.yaml @@ -1,6 +1,7 @@ title: Country description: Country details x-resourceId: country +type: object required: - iso_2 - iso_3 diff --git a/docs/api/store/components/schemas/currency.yaml b/docs/api/store/components/schemas/currency.yaml index acdf451c75d21..be164ffa9e15c 100644 --- a/docs/api/store/components/schemas/currency.yaml +++ b/docs/api/store/components/schemas/currency.yaml @@ -1,6 +1,7 @@ title: Currency description: Currency x-resourceId: currency +type: object required: - code - symbol diff --git a/docs/api/store/components/schemas/custom_shipping_option.yaml b/docs/api/store/components/schemas/custom_shipping_option.yaml index 9e9360607560c..40ff8c8229c63 100644 --- a/docs/api/store/components/schemas/custom_shipping_option.yaml +++ b/docs/api/store/components/schemas/custom_shipping_option.yaml @@ -4,6 +4,7 @@ description: >- attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option +type: object required: - price - shipping_option_id diff --git a/docs/api/store/components/schemas/customer.yaml b/docs/api/store/components/schemas/customer.yaml index e3df6d690bb3c..aa0e83a77cd71 100644 --- a/docs/api/store/components/schemas/customer.yaml +++ b/docs/api/store/components/schemas/customer.yaml @@ -1,6 +1,7 @@ title: Customer description: Represents a customer x-resourceId: customer +type: object required: - email properties: @@ -18,7 +19,7 @@ properties: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string diff --git a/docs/api/store/components/schemas/customer_group.yaml b/docs/api/store/components/schemas/customer_group.yaml index d99e3a5923cff..0d4769c7ad6fb 100644 --- a/docs/api/store/components/schemas/customer_group.yaml +++ b/docs/api/store/components/schemas/customer_group.yaml @@ -1,6 +1,7 @@ title: Customer Group description: Represents a customer group x-resourceId: customer_group +type: object required: - name properties: diff --git a/docs/api/store/components/schemas/discount.yaml b/docs/api/store/components/schemas/discount.yaml index 48f090532a3fe..1950a503cb0c5 100644 --- a/docs/api/store/components/schemas/discount.yaml +++ b/docs/api/store/components/schemas/discount.yaml @@ -1,6 +1,7 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount +type: object required: - code - is_dynamic diff --git a/docs/api/store/components/schemas/discount_condition.yaml b/docs/api/store/components/schemas/discount_condition.yaml index 57a0dea0b9833..794e839eb3eab 100644 --- a/docs/api/store/components/schemas/discount_condition.yaml +++ b/docs/api/store/components/schemas/discount_condition.yaml @@ -1,6 +1,7 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition +type: object required: - type - operator diff --git a/docs/api/store/components/schemas/discount_condition_customer_group.yaml b/docs/api/store/components/schemas/discount_condition_customer_group.yaml index ad6527d260710..51867349ad72d 100644 --- a/docs/api/store/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/store/components/schemas/discount_condition_customer_group.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group +type: object required: - customer_group_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product.yaml b/docs/api/store/components/schemas/discount_condition_product.yaml index 77f4fa6b9edc5..b88eac53c27da 100644 --- a/docs/api/store/components/schemas/discount_condition_product.yaml +++ b/docs/api/store/components/schemas/discount_condition_product.yaml @@ -1,6 +1,7 @@ title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product +type: object required: - product_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product_collection.yaml b/docs/api/store/components/schemas/discount_condition_product_collection.yaml index 43c7548e34b3e..bc0065ef9f060 100644 --- a/docs/api/store/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/store/components/schemas/discount_condition_product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection +type: object required: - product_collection_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product_tag.yaml b/docs/api/store/components/schemas/discount_condition_product_tag.yaml index ed3a8b2e79ce2..d3ba121f43e6d 100644 --- a/docs/api/store/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/store/components/schemas/discount_condition_product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag +type: object required: - product_tag_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product_type.yaml b/docs/api/store/components/schemas/discount_condition_product_type.yaml index 3125b2119ccc3..03a6393c4463c 100644 --- a/docs/api/store/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/store/components/schemas/discount_condition_product_type.yaml @@ -1,6 +1,7 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product +type: object required: - product_type_id - condition_id diff --git a/docs/api/store/components/schemas/discount_rule.yaml b/docs/api/store/components/schemas/discount_rule.yaml index 328171368fcf4..ab6ab1a80e54a 100644 --- a/docs/api/store/components/schemas/discount_rule.yaml +++ b/docs/api/store/components/schemas/discount_rule.yaml @@ -3,6 +3,7 @@ description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule +type: object required: - type - value diff --git a/docs/api/store/components/schemas/draft-order.yaml b/docs/api/store/components/schemas/draft-order.yaml index 12152dc3e092d..1c96c22bc7b66 100644 --- a/docs/api/store/components/schemas/draft-order.yaml +++ b/docs/api/store/components/schemas/draft-order.yaml @@ -1,6 +1,7 @@ title: DraftOrder description: Represents a draft order x-resourceId: draft-order +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/error.yaml b/docs/api/store/components/schemas/error.yaml index c8baa14163e45..cad9495918bdd 100644 --- a/docs/api/store/components/schemas/error.yaml +++ b/docs/api/store/components/schemas/error.yaml @@ -1,5 +1,6 @@ title: Response Error x-resourceId: error +type: object properties: code: type: string diff --git a/docs/api/store/components/schemas/fulfillment.yaml b/docs/api/store/components/schemas/fulfillment.yaml index 0ea09f97e51a8..d6ee5c69608ef 100644 --- a/docs/api/store/components/schemas/fulfillment.yaml +++ b/docs/api/store/components/schemas/fulfillment.yaml @@ -8,6 +8,7 @@ description: >- webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment +type: object required: - provider_id properties: diff --git a/docs/api/store/components/schemas/fulfillment_item.yaml b/docs/api/store/components/schemas/fulfillment_item.yaml index 29fe0f87b9711..f233f45f68873 100644 --- a/docs/api/store/components/schemas/fulfillment_item.yaml +++ b/docs/api/store/components/schemas/fulfillment_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item +type: object required: - fulfillment_id - item_id diff --git a/docs/api/store/components/schemas/fulfillment_provider.yaml b/docs/api/store/components/schemas/fulfillment_provider.yaml index d6fdd8ce64033..584c933111efe 100644 --- a/docs/api/store/components/schemas/fulfillment_provider.yaml +++ b/docs/api/store/components/schemas/fulfillment_provider.yaml @@ -1,6 +1,7 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider +type: object properties: id: description: The id of the fulfillment provider as given by the plugin. diff --git a/docs/api/store/components/schemas/gift_card.yaml b/docs/api/store/components/schemas/gift_card.yaml index 713a2a39fcd82..054f93319f0bf 100644 --- a/docs/api/store/components/schemas/gift_card.yaml +++ b/docs/api/store/components/schemas/gift_card.yaml @@ -3,6 +3,7 @@ description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card +type: object required: - code - value diff --git a/docs/api/store/components/schemas/gift_card_transaction.yaml b/docs/api/store/components/schemas/gift_card_transaction.yaml index 0d923b36536cc..fb16341851868 100644 --- a/docs/api/store/components/schemas/gift_card_transaction.yaml +++ b/docs/api/store/components/schemas/gift_card_transaction.yaml @@ -3,6 +3,7 @@ description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction +type: object required: - gift_card_id - amount diff --git a/docs/api/store/components/schemas/idempotency_key.yaml b/docs/api/store/components/schemas/idempotency_key.yaml index ac4f6b63b7510..9bff9c0f90d72 100644 --- a/docs/api/store/components/schemas/idempotency_key.yaml +++ b/docs/api/store/components/schemas/idempotency_key.yaml @@ -3,6 +3,7 @@ description: >- Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key +type: object required: - idempotency_key properties: diff --git a/docs/api/store/components/schemas/image.yaml b/docs/api/store/components/schemas/image.yaml index 24bf973e75c9b..61bc475c32085 100644 --- a/docs/api/store/components/schemas/image.yaml +++ b/docs/api/store/components/schemas/image.yaml @@ -1,6 +1,7 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image +type: object required: - url properties: diff --git a/docs/api/store/components/schemas/invite.yaml b/docs/api/store/components/schemas/invite.yaml index 492a71eeb22e0..aac3ce0b7fb92 100644 --- a/docs/api/store/components/schemas/invite.yaml +++ b/docs/api/store/components/schemas/invite.yaml @@ -1,6 +1,7 @@ title: Invite description: Represents an invite x-resourceId: invite +type: object required: - user_email properties: diff --git a/docs/api/store/components/schemas/line_item.yaml b/docs/api/store/components/schemas/line_item.yaml index cdb06694a9a7c..ae9ed1eaa08f4 100644 --- a/docs/api/store/components/schemas/line_item.yaml +++ b/docs/api/store/components/schemas/line_item.yaml @@ -5,6 +5,7 @@ description: >- order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item +type: object required: - title - unit_price diff --git a/docs/api/store/components/schemas/line_item_adjustment.yaml b/docs/api/store/components/schemas/line_item_adjustment.yaml index 8ae889c8dcc18..677f69388a33c 100644 --- a/docs/api/store/components/schemas/line_item_adjustment.yaml +++ b/docs/api/store/components/schemas/line_item_adjustment.yaml @@ -1,6 +1,7 @@ title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment +type: object required: - item_id - description diff --git a/docs/api/store/components/schemas/line_item_tax_line.yaml b/docs/api/store/components/schemas/line_item_tax_line.yaml index 9320de67e36db..b149f62d42ef5 100644 --- a/docs/api/store/components/schemas/line_item_tax_line.yaml +++ b/docs/api/store/components/schemas/line_item_tax_line.yaml @@ -1,6 +1,7 @@ title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line +type: object required: - item_id - rate diff --git a/docs/api/store/components/schemas/money_amount.yaml b/docs/api/store/components/schemas/money_amount.yaml index f54d7e4a7a7fb..929194a759c52 100644 --- a/docs/api/store/components/schemas/money_amount.yaml +++ b/docs/api/store/components/schemas/money_amount.yaml @@ -6,6 +6,7 @@ description: >- pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount +type: object required: - currency_code - amount diff --git a/docs/api/store/components/schemas/multiple_errors.yaml b/docs/api/store/components/schemas/multiple_errors.yaml index 579282df2fcc1..0327c94e70382 100644 --- a/docs/api/store/components/schemas/multiple_errors.yaml +++ b/docs/api/store/components/schemas/multiple_errors.yaml @@ -1,5 +1,6 @@ title: Multiple Errors x-resourceId: multiple_errors +type: object properties: errors: type: array diff --git a/docs/api/store/components/schemas/note.yaml b/docs/api/store/components/schemas/note.yaml index 9333e49472b3f..16f1e9fe50972 100644 --- a/docs/api/store/components/schemas/note.yaml +++ b/docs/api/store/components/schemas/note.yaml @@ -3,6 +3,7 @@ description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. x-resourceId: note +type: object required: - value - resource_type diff --git a/docs/api/store/components/schemas/notification.yaml b/docs/api/store/components/schemas/notification.yaml index 559d58d79ab0c..9db10fe27aaa5 100644 --- a/docs/api/store/components/schemas/notification.yaml +++ b/docs/api/store/components/schemas/notification.yaml @@ -5,6 +5,7 @@ description: >- chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification +type: object required: - resource_type - resource_id diff --git a/docs/api/store/components/schemas/notification_provider.yaml b/docs/api/store/components/schemas/notification_provider.yaml index 6ac490109fb3d..dacf80d1896e1 100644 --- a/docs/api/store/components/schemas/notification_provider.yaml +++ b/docs/api/store/components/schemas/notification_provider.yaml @@ -1,6 +1,7 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider +type: object required: - id properties: diff --git a/docs/api/store/components/schemas/notification_resend.yaml b/docs/api/store/components/schemas/notification_resend.yaml index c5cfe4431fdc4..2b15999aa62cb 100644 --- a/docs/api/store/components/schemas/notification_resend.yaml +++ b/docs/api/store/components/schemas/notification_resend.yaml @@ -1,6 +1,7 @@ title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend +type: object properties: id: description: The notification resend's ID diff --git a/docs/api/store/components/schemas/order.yaml b/docs/api/store/components/schemas/order.yaml index 7371e85df96b7..464edc17fb019 100644 --- a/docs/api/store/components/schemas/order.yaml +++ b/docs/api/store/components/schemas/order.yaml @@ -1,6 +1,7 @@ title: Order description: Represents an order x-resourceId: order +type: object required: - customer_id - email diff --git a/docs/api/store/components/schemas/order_edit.yaml b/docs/api/store/components/schemas/order_edit.yaml index 44e4a3f779334..5574c2b6f2ab3 100644 --- a/docs/api/store/components/schemas/order_edit.yaml +++ b/docs/api/store/components/schemas/order_edit.yaml @@ -1,6 +1,7 @@ title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit +type: object required: - order_id - order diff --git a/docs/api/store/components/schemas/order_item_change.yaml b/docs/api/store/components/schemas/order_item_change.yaml index 70d61c83c390e..9bc3b3a8263d5 100644 --- a/docs/api/store/components/schemas/order_item_change.yaml +++ b/docs/api/store/components/schemas/order_item_change.yaml @@ -1,6 +1,7 @@ title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change +type: object required: - type - order_edit_id diff --git a/docs/api/store/components/schemas/payment.yaml b/docs/api/store/components/schemas/payment.yaml index 92294bd2e6ec1..384e04b16c4e3 100644 --- a/docs/api/store/components/schemas/payment.yaml +++ b/docs/api/store/components/schemas/payment.yaml @@ -3,6 +3,7 @@ description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment +type: object required: - amount - currency_code diff --git a/docs/api/store/components/schemas/payment_collection.yaml b/docs/api/store/components/schemas/payment_collection.yaml index 315c62b47533f..3f5663b39aab5 100644 --- a/docs/api/store/components/schemas/payment_collection.yaml +++ b/docs/api/store/components/schemas/payment_collection.yaml @@ -1,6 +1,7 @@ title: Payment Collection description: Payment Collection x-resourceId: payment_collection +type: object required: - type - status @@ -26,12 +27,7 @@ properties: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -41,12 +37,6 @@ properties: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID diff --git a/docs/api/store/components/schemas/payment_provider.yaml b/docs/api/store/components/schemas/payment_provider.yaml index 7f39ed6355c47..081a6b74628dd 100644 --- a/docs/api/store/components/schemas/payment_provider.yaml +++ b/docs/api/store/components/schemas/payment_provider.yaml @@ -1,6 +1,7 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider +type: object required: - id properties: diff --git a/docs/api/store/components/schemas/payment_session.yaml b/docs/api/store/components/schemas/payment_session.yaml index c9f52a749b755..ca8c513a262d6 100644 --- a/docs/api/store/components/schemas/payment_session.yaml +++ b/docs/api/store/components/schemas/payment_session.yaml @@ -7,6 +7,7 @@ description: >- get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session +type: object required: - cart_id - provider_id diff --git a/docs/api/store/components/schemas/price_list.yaml b/docs/api/store/components/schemas/price_list.yaml index bae4d3936ae57..b774028314fab 100644 --- a/docs/api/store/components/schemas/price_list.yaml +++ b/docs/api/store/components/schemas/price_list.yaml @@ -3,6 +3,7 @@ description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list +type: object required: - name - description diff --git a/docs/api/store/components/schemas/product.yaml b/docs/api/store/components/schemas/product.yaml index 41bf53f444969..e0116cc51d006 100644 --- a/docs/api/store/components/schemas/product.yaml +++ b/docs/api/store/components/schemas/product.yaml @@ -4,6 +4,7 @@ description: >- as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product +type: object required: - title - profile_id diff --git a/docs/api/store/components/schemas/product_collection.yaml b/docs/api/store/components/schemas/product_collection.yaml index 711acc6c10a09..a3fd98cefb2aa 100644 --- a/docs/api/store/components/schemas/product_collection.yaml +++ b/docs/api/store/components/schemas/product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection +type: object required: - title properties: diff --git a/docs/api/store/components/schemas/product_option.yaml b/docs/api/store/components/schemas/product_option.yaml index 66fd46f4fda64..aaaf0d58c1250 100644 --- a/docs/api/store/components/schemas/product_option.yaml +++ b/docs/api/store/components/schemas/product_option.yaml @@ -4,6 +4,7 @@ description: >- a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option +type: object required: - title - product_id diff --git a/docs/api/store/components/schemas/product_option_value.yaml b/docs/api/store/components/schemas/product_option_value.yaml index 3b8606ea53cb7..407e69a53670a 100644 --- a/docs/api/store/components/schemas/product_option_value.yaml +++ b/docs/api/store/components/schemas/product_option_value.yaml @@ -3,6 +3,7 @@ description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value +type: object required: - value - option_id diff --git a/docs/api/store/components/schemas/product_tag.yaml b/docs/api/store/components/schemas/product_tag.yaml index cdfa21d4ad3e7..8240386ddf7b9 100644 --- a/docs/api/store/components/schemas/product_tag.yaml +++ b/docs/api/store/components/schemas/product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag +type: object required: - value properties: diff --git a/docs/api/store/components/schemas/product_tax_rate.yaml b/docs/api/store/components/schemas/product_tax_rate.yaml index f72e8896a8308..db175e899dc26 100644 --- a/docs/api/store/components/schemas/product_tax_rate.yaml +++ b/docs/api/store/components/schemas/product_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate +type: object required: - product_id - rate_id diff --git a/docs/api/store/components/schemas/product_type.yaml b/docs/api/store/components/schemas/product_type.yaml index e2be2bf9204f9..b6e06d4190b78 100644 --- a/docs/api/store/components/schemas/product_type.yaml +++ b/docs/api/store/components/schemas/product_type.yaml @@ -1,6 +1,7 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type +type: object required: - value properties: diff --git a/docs/api/store/components/schemas/product_type_tax_rate.yaml b/docs/api/store/components/schemas/product_type_tax_rate.yaml index 5bc7d5c30265b..48445a6b80e60 100644 --- a/docs/api/store/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/store/components/schemas/product_type_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate +type: object required: - product_type_id - rate_id diff --git a/docs/api/store/components/schemas/product_variant.yaml b/docs/api/store/components/schemas/product_variant.yaml index aa7386d615925..a0cb2eacc9f1e 100644 --- a/docs/api/store/components/schemas/product_variant.yaml +++ b/docs/api/store/components/schemas/product_variant.yaml @@ -4,6 +4,7 @@ description: >- configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant +type: object required: - title - product_id diff --git a/docs/api/store/components/schemas/product_variant_prices_fields.yaml b/docs/api/store/components/schemas/product_variant_prices_fields.yaml index aefca848a032e..aee46598283ea 100644 --- a/docs/api/store/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/store/components/schemas/product_variant_prices_fields.yaml @@ -1,6 +1,7 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields +type: object properties: original_price: type: number diff --git a/docs/api/store/components/schemas/publishable_api_key.yaml b/docs/api/store/components/schemas/publishable_api_key.yaml new file mode 100644 index 0000000000000..061b34b8c8af9 --- /dev/null +++ b/docs/api/store/components/schemas/publishable_api_key.yaml @@ -0,0 +1,37 @@ +title: Publishable API key +description: >- + Publishable API key defines scopes (i.e. resources) that are available within + a request. +x-resourceId: publishable_api_key +type: object +properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: A user object. Available if the relation `revoked_by_user` is expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time diff --git a/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml new file mode 100644 index 0000000000000..d0ab55c29ae4f --- /dev/null +++ b/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml @@ -0,0 +1,13 @@ +title: Publishable API key sales channel +description: Holds mapping between Publishable API keys and Sales Channels +x-resourceId: publishable_api_key_sales_channel +type: object +properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 diff --git a/docs/api/store/components/schemas/refund.yaml b/docs/api/store/components/schemas/refund.yaml index c1fc4cfc0f57c..fae6a881f3a01 100644 --- a/docs/api/store/components/schemas/refund.yaml +++ b/docs/api/store/components/schemas/refund.yaml @@ -4,6 +4,7 @@ description: >- given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund +type: object required: - order_id - amount diff --git a/docs/api/store/components/schemas/region.yaml b/docs/api/store/components/schemas/region.yaml index a2561dc89203f..15b245b4702e4 100644 --- a/docs/api/store/components/schemas/region.yaml +++ b/docs/api/store/components/schemas/region.yaml @@ -5,6 +5,7 @@ description: >- consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region +type: object required: - name - currency_code diff --git a/docs/api/store/components/schemas/return.yaml b/docs/api/store/components/schemas/return.yaml index a47590010680d..7ba545dcdc4a2 100644 --- a/docs/api/store/components/schemas/return.yaml +++ b/docs/api/store/components/schemas/return.yaml @@ -4,6 +4,7 @@ description: >- back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return +type: object required: - refund_amount properties: diff --git a/docs/api/store/components/schemas/return_item.yaml b/docs/api/store/components/schemas/return_item.yaml index 3c45a35003ad8..4ecc64bc8dc52 100644 --- a/docs/api/store/components/schemas/return_item.yaml +++ b/docs/api/store/components/schemas/return_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item +type: object required: - return_id - item_id diff --git a/docs/api/store/components/schemas/return_reason.yaml b/docs/api/store/components/schemas/return_reason.yaml index 7873cfc3f2f03..2e4d4d83ef8e3 100644 --- a/docs/api/store/components/schemas/return_reason.yaml +++ b/docs/api/store/components/schemas/return_reason.yaml @@ -3,6 +3,7 @@ description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason +type: object required: - value - label diff --git a/docs/api/store/components/schemas/sales_channel.yaml b/docs/api/store/components/schemas/sales_channel.yaml index 0523299105261..7c4e1f2920219 100644 --- a/docs/api/store/components/schemas/sales_channel.yaml +++ b/docs/api/store/components/schemas/sales_channel.yaml @@ -1,6 +1,7 @@ title: Sales Channel description: A Sales Channel x-resourceId: sales_channel +type: object required: - name properties: diff --git a/docs/api/store/components/schemas/shipping_method.yaml b/docs/api/store/components/schemas/shipping_method.yaml index d6a96012773b1..4ac18c8e93d5a 100644 --- a/docs/api/store/components/schemas/shipping_method.yaml +++ b/docs/api/store/components/schemas/shipping_method.yaml @@ -5,6 +5,7 @@ description: >- details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method +type: object required: - shipping_option_id - price diff --git a/docs/api/store/components/schemas/shipping_method_tax_line.yaml b/docs/api/store/components/schemas/shipping_method_tax_line.yaml index cce7e8fddf16c..3387bfbfe2599 100644 --- a/docs/api/store/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/store/components/schemas/shipping_method_tax_line.yaml @@ -1,6 +1,7 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line +type: object required: - shipping_method_id - rate diff --git a/docs/api/store/components/schemas/shipping_option.yaml b/docs/api/store/components/schemas/shipping_option.yaml index 108dbc5f145db..a0e1c6538a7d1 100644 --- a/docs/api/store/components/schemas/shipping_option.yaml +++ b/docs/api/store/components/schemas/shipping_option.yaml @@ -7,6 +7,7 @@ description: >- distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option +type: object required: - name - region_id diff --git a/docs/api/store/components/schemas/shipping_option_requirement.yaml b/docs/api/store/components/schemas/shipping_option_requirement.yaml index 559d21de4488c..57d97193122ef 100644 --- a/docs/api/store/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/store/components/schemas/shipping_option_requirement.yaml @@ -3,6 +3,7 @@ description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement +type: object required: - shipping_option_id - type diff --git a/docs/api/store/components/schemas/shipping_profile.yaml b/docs/api/store/components/schemas/shipping_profile.yaml index cb55e4f1342ae..ba479ece923cb 100644 --- a/docs/api/store/components/schemas/shipping_profile.yaml +++ b/docs/api/store/components/schemas/shipping_profile.yaml @@ -3,6 +3,7 @@ description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile +type: object required: - name - type diff --git a/docs/api/store/components/schemas/shipping_tax_rate.yaml b/docs/api/store/components/schemas/shipping_tax_rate.yaml index ddf13f172a4fe..30058a09afb86 100644 --- a/docs/api/store/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/store/components/schemas/shipping_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate +type: object required: - shipping_option_id - rate_id diff --git a/docs/api/store/components/schemas/staged_job.yaml b/docs/api/store/components/schemas/staged_job.yaml index 95fd6aaf34428..055ceaee0e1de 100644 --- a/docs/api/store/components/schemas/staged_job.yaml +++ b/docs/api/store/components/schemas/staged_job.yaml @@ -1,6 +1,7 @@ title: Staged Job description: A staged job resource x-resourceId: staged_job +type: object required: - event_name properties: diff --git a/docs/api/store/components/schemas/store.yaml b/docs/api/store/components/schemas/store.yaml index 09844ff155c5a..98b90e81f4612 100644 --- a/docs/api/store/components/schemas/store.yaml +++ b/docs/api/store/components/schemas/store.yaml @@ -1,6 +1,7 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. x-resourceId: store +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/swap.yaml b/docs/api/store/components/schemas/swap.yaml index e9f0397f646ad..31694ff199f34 100644 --- a/docs/api/store/components/schemas/swap.yaml +++ b/docs/api/store/components/schemas/swap.yaml @@ -8,6 +8,7 @@ description: >- amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap +type: object required: - fulfillment_status - payment_status diff --git a/docs/api/store/components/schemas/tax_line.yaml b/docs/api/store/components/schemas/tax_line.yaml index 491a7e0c0066f..3faaf02eb7e0f 100644 --- a/docs/api/store/components/schemas/tax_line.yaml +++ b/docs/api/store/components/schemas/tax_line.yaml @@ -1,6 +1,7 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line +type: object required: - rate - name diff --git a/docs/api/store/components/schemas/tax_provider.yaml b/docs/api/store/components/schemas/tax_provider.yaml index 267d162eae49f..7f53c424a5c6a 100644 --- a/docs/api/store/components/schemas/tax_provider.yaml +++ b/docs/api/store/components/schemas/tax_provider.yaml @@ -1,6 +1,7 @@ title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider +type: object properties: id: description: The id of the tax provider as given by the plugin. diff --git a/docs/api/store/components/schemas/tax_rate.yaml b/docs/api/store/components/schemas/tax_rate.yaml index 29f7e0e0a977b..cbe718652e9b2 100644 --- a/docs/api/store/components/schemas/tax_rate.yaml +++ b/docs/api/store/components/schemas/tax_rate.yaml @@ -3,6 +3,7 @@ description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item +type: object required: - name - region_id diff --git a/docs/api/store/components/schemas/tracking_link.yaml b/docs/api/store/components/schemas/tracking_link.yaml index 2a79689722dbe..25867d8a97f30 100644 --- a/docs/api/store/components/schemas/tracking_link.yaml +++ b/docs/api/store/components/schemas/tracking_link.yaml @@ -4,6 +4,7 @@ description: >- Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link +type: object required: - tracking_number - fulfillment_id diff --git a/docs/api/store/components/schemas/user.yaml b/docs/api/store/components/schemas/user.yaml index 5083be44de892..042cd46cb260b 100644 --- a/docs/api/store/components/schemas/user.yaml +++ b/docs/api/store/components/schemas/user.yaml @@ -1,6 +1,7 @@ title: User description: Represents a User who can manage store settings. x-resourceId: user +type: object required: - email properties: diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 399b57e9e868f..e379327bc364f 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -145,10 +145,6 @@ tags: servers: - url: https://api.medusa-commerce.com/store paths: - /auth: - $ref: paths/auth.yaml - /auth/{email}: - $ref: paths/auth_{email}.yaml /carts/{id}/shipping-methods: $ref: paths/carts_{id}_shipping-methods.yaml /carts/{id}/taxes: @@ -157,8 +153,6 @@ paths: $ref: paths/carts_{id}_complete.yaml /carts: $ref: paths/carts.yaml - /carts/{id}/line-items: - $ref: paths/carts_{id}_line-items.yaml /carts/{id}/payment-sessions: $ref: paths/carts_{id}_payment-sessions.yaml /carts/{id}/discounts/{code}: @@ -173,6 +167,8 @@ paths: $ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml /carts/{id}/payment-session: $ref: paths/carts_{id}_payment-session.yaml + /gift-cards/{code}: + $ref: paths/gift-cards_{code}.yaml /collections/{id}: $ref: paths/collections_{id}.yaml /collections: @@ -193,20 +189,38 @@ paths: $ref: paths/customers_password-token.yaml /customers/password-reset: $ref: paths/customers_password-reset.yaml - /gift-cards/{code}: - $ref: paths/gift-cards_{code}.yaml /order-edits/{id}/complete: $ref: paths/order-edits_{id}_complete.yaml /order-edits/{id}/decline: $ref: paths/order-edits_{id}_decline.yaml /order-edits/{id}: $ref: paths/order-edits_{id}.yaml + /orders/customer/confirm: + $ref: paths/orders_customer_confirm.yaml /orders/cart/{cart_id}: $ref: paths/orders_cart_{cart_id}.yaml /orders/{id}: $ref: paths/orders_{id}.yaml /orders: $ref: paths/orders.yaml + /orders/batch/customer/token: + $ref: paths/orders_batch_customer_token.yaml + /payment-collections/{id}/sessions/batch/authorize: + $ref: paths/payment-collections_{id}_sessions_batch_authorize.yaml + /payment-collections/{id}/sessions/{session_id}/authorize: + $ref: paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml + /payment-collections/{id}: + $ref: paths/payment-collections_{id}.yaml + /payment-collections/{id}/sessions/batch: + $ref: paths/payment-collections_{id}_sessions_batch.yaml + /payment-collections/{id}/sessions: + $ref: paths/payment-collections_{id}_sessions.yaml + /payment-collections/{id}/sessions/{session_id}: + $ref: paths/payment-collections_{id}_sessions_{session_id}.yaml + /auth: + $ref: paths/auth.yaml + /auth/{email}: + $ref: paths/auth_{email}.yaml /product-types: $ref: paths/product-types.yaml /products/{id}: @@ -237,6 +251,8 @@ paths: $ref: paths/variants_{variant_id}.yaml /variants: $ref: paths/variants.yaml + /carts/{id}/line-items: + $ref: paths/carts_{id}_line-items.yaml components: securitySchemes: cookie_auth: diff --git a/docs/api/store/paths/auth.yaml b/docs/api/store/paths/auth.yaml index 952a6f08891b7..7b6fdd2ea1373 100644 --- a/docs/api/store/paths/auth.yaml +++ b/docs/api/store/paths/auth.yaml @@ -22,6 +22,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -105,6 +106,7 @@ get: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/auth_{email}.yaml b/docs/api/store/paths/auth_{email}.yaml index 3878176db8e4e..ad5684422dea3 100644 --- a/docs/api/store/paths/auth_{email}.yaml +++ b/docs/api/store/paths/auth_{email}.yaml @@ -27,6 +27,7 @@ get: content: application/json: schema: + type: object properties: exists: type: boolean diff --git a/docs/api/store/paths/carts.yaml b/docs/api/store/paths/carts.yaml index a8c7080251e23..b11e8871e8a0b 100644 --- a/docs/api/store/paths/carts.yaml +++ b/docs/api/store/paths/carts.yaml @@ -10,6 +10,7 @@ post: content: application/json: schema: + type: object properties: region_id: type: string @@ -69,6 +70,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}.yaml b/docs/api/store/paths/carts_{id}.yaml index abb581574e260..760c22fda0bf8 100644 --- a/docs/api/store/paths/carts_{id}.yaml +++ b/docs/api/store/paths/carts_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml @@ -54,6 +55,7 @@ post: content: application/json: schema: + type: object properties: region_id: type: string @@ -132,6 +134,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_complete.yaml b/docs/api/store/paths/carts_{id}_complete.yaml index 66d7d45c11650..4baa7467eec2a 100644 --- a/docs/api/store/paths/carts_{id}_complete.yaml +++ b/docs/api/store/paths/carts_{id}_complete.yaml @@ -36,6 +36,7 @@ post: content: application/json: schema: + type: object properties: type: type: string diff --git a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml index cef60541087fe..2dd270334acaa 100644 --- a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml +++ b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml @@ -32,6 +32,7 @@ delete: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_line-items.yaml b/docs/api/store/paths/carts_{id}_line-items.yaml index ea30d1c05e0bc..4bee2a8f96edd 100644 --- a/docs/api/store/paths/carts_{id}_line-items.yaml +++ b/docs/api/store/paths/carts_{id}_line-items.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml index c5b99c0a8fdb9..f33aaa5f89539 100644 --- a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml +++ b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml @@ -33,6 +33,7 @@ delete: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml @@ -81,6 +82,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-session.yaml b/docs/api/store/paths/carts_{id}_payment-session.yaml index da3d34bb0faa1..f9d6a4167ac25 100644 --- a/docs/api/store/paths/carts_{id}_payment-session.yaml +++ b/docs/api/store/paths/carts_{id}_payment-session.yaml @@ -28,6 +28,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-sessions.yaml b/docs/api/store/paths/carts_{id}_payment-sessions.yaml index 628eb3f95ead2..6a6aa6dd63276 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions.yaml @@ -28,6 +28,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml index 2f1050b1aa9c7..393b320eed026 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml @@ -36,6 +36,7 @@ delete: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml @@ -85,6 +86,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml index 4b78d36e4e9aa..cabc2984bc7e4 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml @@ -38,6 +38,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_shipping-methods.yaml b/docs/api/store/paths/carts_{id}_shipping-methods.yaml index ec9a204346c40..0ddffc8c5ab5a 100644 --- a/docs/api/store/paths/carts_{id}_shipping-methods.yaml +++ b/docs/api/store/paths/carts_{id}_shipping-methods.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_taxes.yaml b/docs/api/store/paths/carts_{id}_taxes.yaml index e732ff553457c..46a0cb4500212 100644 --- a/docs/api/store/paths/carts_{id}_taxes.yaml +++ b/docs/api/store/paths/carts_{id}_taxes.yaml @@ -24,6 +24,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/collections.yaml b/docs/api/store/paths/collections.yaml index 01c5399c9af92..19187417c3841 100644 --- a/docs/api/store/paths/collections.yaml +++ b/docs/api/store/paths/collections.yaml @@ -78,6 +78,7 @@ get: content: application/json: schema: + type: object properties: collections: type: array diff --git a/docs/api/store/paths/collections_{id}.yaml b/docs/api/store/paths/collections_{id}.yaml index 91c2025ce1a3d..ff523113e4aa6 100644 --- a/docs/api/store/paths/collections_{id}.yaml +++ b/docs/api/store/paths/collections_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml diff --git a/docs/api/store/paths/customers.yaml b/docs/api/store/paths/customers.yaml index ebdf37d9f1779..370c6e6928fe8 100644 --- a/docs/api/store/paths/customers.yaml +++ b/docs/api/store/paths/customers.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - first_name - last_name @@ -46,6 +47,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -60,6 +62,7 @@ post: content: application/json: schema: + type: object properties: code: type: string diff --git a/docs/api/store/paths/customers_me.yaml b/docs/api/store/paths/customers_me.yaml index cb815e3453961..5dfbcc2e8df07 100644 --- a/docs/api/store/paths/customers_me.yaml +++ b/docs/api/store/paths/customers_me.yaml @@ -24,6 +24,7 @@ get: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -48,6 +49,7 @@ post: content: application/json: schema: + type: object properties: first_name: description: The Customer's first name. @@ -93,6 +95,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_me_addresses.yaml b/docs/api/store/paths/customers_me_addresses.yaml index f9b39fdd01f17..e31fb66186e9e 100644 --- a/docs/api/store/paths/customers_me_addresses.yaml +++ b/docs/api/store/paths/customers_me_addresses.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - address properties: @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml index 763000bbe694b..0434b866da276 100644 --- a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml +++ b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml @@ -31,6 +31,7 @@ delete: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -85,6 +86,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_me_orders.yaml b/docs/api/store/paths/customers_me_orders.yaml index 9afb3808b9cb4..377bccbfa1cbd 100644 --- a/docs/api/store/paths/customers_me_orders.yaml +++ b/docs/api/store/paths/customers_me_orders.yaml @@ -187,6 +187,7 @@ get: content: application/json: schema: + type: object properties: orders: type: array diff --git a/docs/api/store/paths/customers_me_payment-methods.yaml b/docs/api/store/paths/customers_me_payment-methods.yaml index dee3d2d6d2e51..f038460c11a5b 100644 --- a/docs/api/store/paths/customers_me_payment-methods.yaml +++ b/docs/api/store/paths/customers_me_payment-methods.yaml @@ -25,6 +25,7 @@ get: content: application/json: schema: + type: object properties: payment_methods: type: array diff --git a/docs/api/store/paths/customers_password-reset.yaml b/docs/api/store/paths/customers_password-reset.yaml index b27edcaf26c81..bee027f4c8e6e 100644 --- a/docs/api/store/paths/customers_password-reset.yaml +++ b/docs/api/store/paths/customers_password-reset.yaml @@ -8,6 +8,7 @@ post: content: application/json: schema: + type: object required: - email - password @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_password-token.yaml b/docs/api/store/paths/customers_password-token.yaml index 7866611941c2d..2949cdd90f2d0 100644 --- a/docs/api/store/paths/customers_password-token.yaml +++ b/docs/api/store/paths/customers_password-token.yaml @@ -9,6 +9,7 @@ post: content: application/json: schema: + type: object required: - email properties: diff --git a/docs/api/store/paths/gift-cards_{code}.yaml b/docs/api/store/paths/gift-cards_{code}.yaml index 896eb67b277e1..ce5748cb97168 100644 --- a/docs/api/store/paths/gift-cards_{code}.yaml +++ b/docs/api/store/paths/gift-cards_{code}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml diff --git a/docs/api/store/paths/order-edits_{id}.yaml b/docs/api/store/paths/order-edits_{id}.yaml index e983c1a57553e..90bf87fb43d36 100644 --- a/docs/api/store/paths/order-edits_{id}.yaml +++ b/docs/api/store/paths/order-edits_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/store/paths/order-edits_{id}_complete.yaml b/docs/api/store/paths/order-edits_{id}_complete.yaml index 08c3a38bdbe04..1ff4cf22b8b4b 100644 --- a/docs/api/store/paths/order-edits_{id}_complete.yaml +++ b/docs/api/store/paths/order-edits_{id}_complete.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/store/paths/order-edits_{id}_decline.yaml b/docs/api/store/paths/order-edits_{id}_decline.yaml index 2cc3593a92994..ce8907e40bde9 100644 --- a/docs/api/store/paths/order-edits_{id}_decline.yaml +++ b/docs/api/store/paths/order-edits_{id}_decline.yaml @@ -13,6 +13,7 @@ post: content: application/json: schema: + type: object properties: declined_reason: type: string @@ -34,6 +35,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/store/paths/orders.yaml b/docs/api/store/paths/orders.yaml index c8149d9397574..325ddb75b0a1f 100644 --- a/docs/api/store/paths/orders.yaml +++ b/docs/api/store/paths/orders.yaml @@ -46,6 +46,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/store/paths/orders_batch_customer_token.yaml b/docs/api/store/paths/orders_batch_customer_token.yaml new file mode 100644 index 0000000000000..945eb8412fbb8 --- /dev/null +++ b/docs/api/store/paths/orders_batch_customer_token.yaml @@ -0,0 +1,47 @@ +post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account + description: >- + Sends an email to emails registered to orders provided with link to transfer + order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/orders_batch_customer_token/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/orders_batch_customer_token/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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 diff --git a/docs/api/store/paths/orders_cart_{cart_id}.yaml b/docs/api/store/paths/orders_cart_{cart_id}.yaml index f75d7ec5b5ec5..2250a041ceb59 100644 --- a/docs/api/store/paths/orders_cart_{cart_id}.yaml +++ b/docs/api/store/paths/orders_cart_{cart_id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/store/paths/orders_customer_confirm.yaml b/docs/api/store/paths/orders_customer_confirm.yaml new file mode 100644 index 0000000000000..d841d7f5a0bf7 --- /dev/null +++ b/docs/api/store/paths/orders_customer_confirm.yaml @@ -0,0 +1,45 @@ +post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/orders_customer_confirm/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/orders_customer_confirm/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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 diff --git a/docs/api/store/paths/orders_{id}.yaml b/docs/api/store/paths/orders_{id}.yaml index 7a325d5a76570..347273607a039 100644 --- a/docs/api/store/paths/orders_{id}.yaml +++ b/docs/api/store/paths/orders_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/store/paths/payment-collections_{id}.yaml b/docs/api/store/paths/payment-collections_{id}.yaml new file mode 100644 index 0000000000000..6876ea93eef5f --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}.yaml @@ -0,0 +1,58 @@ +get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 diff --git a/docs/api/store/paths/payment-collections_{id}_sessions.yaml b/docs/api/store/paths/payment-collections_{id}_sessions.yaml new file mode 100644 index 0000000000000..a18f5574f7547 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions.yaml @@ -0,0 +1,58 @@ +post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + 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: + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}_sessions/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml new file mode 100644 index 0000000000000..93c0ec459392d --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml @@ -0,0 +1,74 @@ +post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + 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: + properties: + sessions: + description: >- + An array of payment sessions related to the Payment Collection. + If the session_id is not provided, existing sessions not present + will be deleted and the provided ones will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml new file mode 100644 index 0000000000000..3442c8640a11b --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml @@ -0,0 +1,59 @@ +post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes 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: + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml new file mode 100644 index 0000000000000..460ad245e7202 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml @@ -0,0 +1,68 @@ +post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session 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 + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - customer_id + properties: + provider_id: + description: The Payment Provider id. + type: string + customer_id: + description: The Customer id. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: ../components/schemas/payment_session.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 diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml new file mode 100644 index 0000000000000..34e6dc23e1139 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml @@ -0,0 +1,55 @@ +post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes 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-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: ../components/schemas/payment_session.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 diff --git a/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/product-types.yaml index 8de545f6f4cec..00a5779158f6f 100644 --- a/docs/api/store/paths/product-types.yaml +++ b/docs/api/store/paths/product-types.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: product_types: $ref: ../components/schemas/product_type.yaml diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/products.yaml index 9ee4789003f27..9d542519be388 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/products.yaml @@ -164,6 +164,7 @@ get: content: application/json: schema: + type: object properties: products: type: array diff --git a/docs/api/store/paths/products_search.yaml b/docs/api/store/paths/products_search.yaml index 3510f063d90d4..4c3b865030b9b 100644 --- a/docs/api/store/paths/products_search.yaml +++ b/docs/api/store/paths/products_search.yaml @@ -36,6 +36,7 @@ post: content: application/json: schema: + type: object properties: hits: type: array diff --git a/docs/api/store/paths/products_{id}.yaml b/docs/api/store/paths/products_{id}.yaml index 5c84a67c8ddcb..f5f090d682c77 100644 --- a/docs/api/store/paths/products_{id}.yaml +++ b/docs/api/store/paths/products_{id}.yaml @@ -50,6 +50,7 @@ get: content: application/json: schema: + type: object properties: product: allOf: diff --git a/docs/api/store/paths/regions.yaml b/docs/api/store/paths/regions.yaml index 54a8b669c6bb6..aac1328eb4a95 100644 --- a/docs/api/store/paths/regions.yaml +++ b/docs/api/store/paths/regions.yaml @@ -76,6 +76,7 @@ get: content: application/json: schema: + type: object properties: regions: type: array diff --git a/docs/api/store/paths/regions_{id}.yaml b/docs/api/store/paths/regions_{id}.yaml index 6657ab427017b..1c3c016a5c42e 100644 --- a/docs/api/store/paths/regions_{id}.yaml +++ b/docs/api/store/paths/regions_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/store/paths/return-reasons.yaml b/docs/api/store/paths/return-reasons.yaml index b7e2f66cfda32..65109419c5cc8 100644 --- a/docs/api/store/paths/return-reasons.yaml +++ b/docs/api/store/paths/return-reasons.yaml @@ -19,6 +19,7 @@ get: content: application/json: schema: + type: object properties: return_reasons: type: array diff --git a/docs/api/store/paths/return-reasons_{id}.yaml b/docs/api/store/paths/return-reasons_{id}.yaml index 8553da42e8728..47ce85648e385 100644 --- a/docs/api/store/paths/return-reasons_{id}.yaml +++ b/docs/api/store/paths/return-reasons_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml diff --git a/docs/api/store/paths/returns.yaml b/docs/api/store/paths/returns.yaml index 1681832a2f238..448553452fbfc 100644 --- a/docs/api/store/paths/returns.yaml +++ b/docs/api/store/paths/returns.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - order_id - items @@ -64,6 +65,7 @@ post: content: application/json: schema: + type: object properties: return: $ref: ../components/schemas/return.yaml diff --git a/docs/api/store/paths/shipping-options.yaml b/docs/api/store/paths/shipping-options.yaml index 326921f80da8e..0f6cb8c9a64a7 100644 --- a/docs/api/store/paths/shipping-options.yaml +++ b/docs/api/store/paths/shipping-options.yaml @@ -37,6 +37,7 @@ get: content: application/json: schema: + type: object properties: shipping_options: type: array diff --git a/docs/api/store/paths/shipping-options_{cart_id}.yaml b/docs/api/store/paths/shipping-options_{cart_id}.yaml index 71efdfa01e173..409adecec60a6 100644 --- a/docs/api/store/paths/shipping-options_{cart_id}.yaml +++ b/docs/api/store/paths/shipping-options_{cart_id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: shipping_options: type: array diff --git a/docs/api/store/paths/swaps.yaml b/docs/api/store/paths/swaps.yaml index 39bbdd3fc5a72..a0f6784147d6b 100644 --- a/docs/api/store/paths/swaps.yaml +++ b/docs/api/store/paths/swaps.yaml @@ -8,6 +8,7 @@ post: content: application/json: schema: + type: object required: - order_id - return_items @@ -72,6 +73,7 @@ post: content: application/json: schema: + type: object properties: swap: $ref: ../components/schemas/swap.yaml diff --git a/docs/api/store/paths/swaps_{cart_id}.yaml b/docs/api/store/paths/swaps_{cart_id}.yaml index 0b8201608d53a..59611a4b0c19c 100644 --- a/docs/api/store/paths/swaps_{cart_id}.yaml +++ b/docs/api/store/paths/swaps_{cart_id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: swap: $ref: ../components/schemas/swap.yaml diff --git a/docs/api/store/paths/variants.yaml b/docs/api/store/paths/variants.yaml index f4f6f213d333d..968c25d3bdb2d 100644 --- a/docs/api/store/paths/variants.yaml +++ b/docs/api/store/paths/variants.yaml @@ -75,6 +75,7 @@ get: content: application/json: schema: + type: object properties: variants: type: array diff --git a/docs/api/store/paths/variants_{variant_id}.yaml b/docs/api/store/paths/variants_{variant_id}.yaml index 96115686902ee..b632807cee5f1 100644 --- a/docs/api/store/paths/variants_{variant_id}.yaml +++ b/docs/api/store/paths/variants_{variant_id}.yaml @@ -42,6 +42,7 @@ get: content: application/json: schema: + type: object properties: variant: allOf: From 0d788e73c423fc95cf34995525169f24734d0efc Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 13:22:05 +0200 Subject: [PATCH 09/18] chore: fix API ref generator to run on push to master (#2787) --- .github/workflows/generate-api-reference.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/generate-api-reference.yml b/.github/workflows/generate-api-reference.yml index 6e29c17cc887c..126fb24b0812d 100644 --- a/.github/workflows/generate-api-reference.yml +++ b/.github/workflows/generate-api-reference.yml @@ -1,5 +1,12 @@ name: Generate API Reference on: + push: + branches: + - "master" + paths: + - packages/medusa/src/api/routes/** + - '!packages/medusa/src/api/routes/**/index.ts' + - '!packages/medusa/src/api/routes/**/index.js' pull_request: types: - closed From 319bcc71b0deab3f21bec98a6b3ae407215b787e Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 18:14:53 +0200 Subject: [PATCH 10/18] docs: updated event reference (#2791) * docs: updated events reference * docs: added noCopy metadata option for code blocks --- .../backend/subscribers/events-list.md | 848 +++++++++++++++--- docs/content/contribution-guidelines.md | 14 +- www/docs/src/css/_docspage.css | 4 + .../src/theme/CodeBlock/Content/String.js | 17 +- www/docs/src/theme/CodeBlock/index.js | 4 +- 5 files changed, 776 insertions(+), 111 deletions(-) diff --git a/docs/content/advanced/backend/subscribers/events-list.md b/docs/content/advanced/backend/subscribers/events-list.md index d653339f625e1..883fc0d91fb2c 100644 --- a/docs/content/advanced/backend/subscribers/events-list.md +++ b/docs/content/advanced/backend/subscribers/events-list.md @@ -1,4 +1,4 @@ -# Events List +# Events Reference This document details all events in Medusa, when they are triggered, and what data your handler method will receive when the event is triggered. @@ -45,7 +45,7 @@ Triggered when a batch job is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -66,7 +66,7 @@ Triggered when a batch job is updated. Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -87,7 +87,7 @@ Triggered when a batch job is canceled. Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -110,7 +110,7 @@ Triggered after the `preProcessBatchJob` of a batch job stategy is done executin Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -133,7 +133,7 @@ Triggered after the batch job is done pre-processing and the batch job is not in Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -154,7 +154,7 @@ Triggered when a batch job starts processing after it's confirmed. Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -175,7 +175,7 @@ Triggered when a batch job is done processing and is completed. Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -196,7 +196,7 @@ Triggered when an error occurs while running a batch job and the batch job fails Object of the following format: -```js +```js noReport noCopy { id //string ID of batch job } @@ -254,7 +254,7 @@ Triggered when a cart is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of cart } @@ -319,7 +319,7 @@ Triggered when a claim is created. Object of the following format: -```js +```js noReport noCopy { id, //string ID of claim no_notification //boolean indicating whether a notification should be sent or not @@ -344,7 +344,7 @@ Triggered when a claim is updated. Object of the following format: -```js +```js noReport noCopy { id, //string ID of claim no_notification //boolean indicating whether a notification should be sent or not @@ -369,7 +369,7 @@ Triggered when a claim is canceled. Object of the following format: -```js +```js noReport noCopy { id, //string ID of claim no_notification //boolean indicating whether a notification should be sent or not @@ -394,7 +394,7 @@ Triggered when fulfillment is created for a claim. Object of the following format: -```js +```js noReport noCopy { id, //string ID of claim fulfillment_id, //string ID of the fulfillment created @@ -420,7 +420,7 @@ Triggered when a claim fulfillment is set as “shipped”. Object of the following format: -```js +```js noReport noCopy { id, //string ID of claim fulfillment_id, //string ID of the fulfillment created @@ -446,7 +446,7 @@ Triggered when a claim of type “refunded” has been refunded. Object of the following format: -```js +```js noReport noCopy { id, //string ID of claim no_notification //boolean indicating whether a notification should be sent or not @@ -493,7 +493,7 @@ Triggered when claim items are created and associated with a claim. This happens Object of the following format: -```js +```js noReport noCopy { id //string ID of claim item } @@ -517,7 +517,7 @@ Triggered when a claim item is updated. This happens when a claim is updated. Object of the following format: -```js +```js noReport noCopy { id //string ID of claim item } @@ -541,7 +541,7 @@ Triggered when a claim is canceled. Object of the following format: -```js +```js noReport noCopy { id //string ID of claim item } @@ -553,6 +553,52 @@ Object of the following format: +## Currency Events + +This section holds all events related to currencies. + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`currency.updated` + + + +Triggered when a currency is updated. + + + +Object of the following format: + +```js noReport noCopy +{ + code //string 3 character ISO code of the updated currency. +} +``` + +
+ ## Customer Events This section holds all events related to customers. @@ -623,7 +669,7 @@ Triggered when a customer requests to reset their password. Object of the following format: -```js +```js noReport noCopy { id, //string ID of customer email, //string email of the customer @@ -673,7 +719,7 @@ Triggered when a draft order is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of draft order } @@ -697,7 +743,7 @@ Triggered when a draft order and data associated with it (email, billing address Object of the following format: -```js +```js noReport noCopy { id //string ID of draft order } @@ -790,7 +836,7 @@ Triggered when an invite is created for a user to join the admin team. Object of the following format: -```js +```js noReport noCopy { id //string ID of invite token, //string token generated to validate the invited user @@ -837,7 +883,7 @@ Triggered when a note is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of note } @@ -861,7 +907,7 @@ Triggered when a note is updated. Object of the following format: -```js +```js noReport noCopy { id //string ID of note } @@ -885,7 +931,7 @@ Triggered when a note is deleted. Object of the following format: -```js +```js noReport noCopy { id //string ID of note } @@ -996,7 +1042,7 @@ Triggered when a new order is placed. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order no_notification //boolean indicating whether a notification should be sent or not @@ -1021,7 +1067,7 @@ Triggered when an order and data associated with it (shipping method, shipping a Object of the following format: -```js +```js noReport noCopy { id, //string ID of order no_notification //(optional) boolean indicating whether a notification should be sent or not @@ -1046,7 +1092,7 @@ Triggered when an order is canceled. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order no_notification //boolean indicating whether a notification should be sent or not @@ -1071,7 +1117,7 @@ Triggered when an order is completed. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order no_notification //boolean indicating whether a notification should be sent or not @@ -1084,6 +1130,30 @@ Object of the following format: +`order.orders_claimed` + + + + +Triggered when an order is claimed. + + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of order +} +``` + + + + + + + `order.gift_card_created` @@ -1096,7 +1166,7 @@ Triggered when a gift card in an order is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of order } @@ -1120,7 +1190,7 @@ Triggered when the payment of an order is captured. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order no_notification //boolean indicating whether a notification should be sent or not @@ -1145,7 +1215,7 @@ Triggered when capturing the payment of an order fails. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order payment_id, //string ID of Payment @@ -1172,7 +1242,7 @@ Triggered when fulfillment is created for an order. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order fulfillment_id, //string ID of fulfillment @@ -1198,7 +1268,7 @@ Triggered when a shipment is created for fulfillment and the fulfillment is regi Object of the following format: -```js +```js noReport noCopy { id, //string ID of order fulfillment_id, //string ID of fulfillment @@ -1224,7 +1294,7 @@ Triggered when fulfillment of an order is canceled. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order fulfillment_id, //string ID of fulfillment @@ -1250,7 +1320,7 @@ Triggered when a return of an order is requested. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order return_id, //string ID of return @@ -1276,7 +1346,7 @@ Triggered when the items of an order have been returned and the order has been r Object of the following format: -```js +```js noReport noCopy { id, //string ID of order return_id, //string ID of return @@ -1302,7 +1372,7 @@ Triggered when the order is being registered as “returned” but there are add Object of the following format: -```js +```js noReport noCopy { id, //string ID of order return_id, //string ID of return @@ -1328,7 +1398,7 @@ Triggered when the order’s payment is refunded. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order refund_id, //string ID of refund @@ -1354,7 +1424,7 @@ Triggered when the refund of the order’s payment fails. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order } @@ -1378,7 +1448,7 @@ Triggered when a swap for an order is created. Object of the following format: -```js +```js noReport noCopy { id, //string ID of order } @@ -1390,9 +1460,20 @@ Object of the following format: -## Product Events +## Order Edit Events -This section holds all events related to products. +This section holds all events related to order edits. + +:::note + +As of Medusa v1.3.9, Order Edits are available but guarded by a feature flag. To use Order Edits either: + +1. Enable the `MEDUSA_FF_ORDER_EDITING` environment variable; +2. Or enable the `order_editing` key in the Medusa server's settings. + +You can learn more about enabling it in the [feature flags](../feature-flags/toggle.md) documentation. + +::: @@ -1409,25 +1490,48 @@ Event Data Payload + + + + + + + + + + + + + + + + +
+ +`order-edit.created` + + + +Triggered when a order edit is created. + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of order edit +} +``` + +
-`product.created` +`order-edit.updated` -Triggered when a product is created. +Triggered when an order edit is updated. Object of the following format: -```js +```js noReport noCopy { - id //string ID of product + id, //string ID of order edit } ``` @@ -1437,24 +1541,45 @@ Object of the following format:
-`product.updated` +`order-edit.canceled` -Triggered when a product and data associated with it (options, variant orders, etc…) is updated. +Triggered when an order edit is canceled. + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of order edit +} +```
-The entire product passed as an object. You can refer to the [Product entity](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/models/product.ts) for an idea of what fields to expect. +`order-edit.declined` -In one case, when the `/admin/products/{id}` endpoint is used to update the product, the payload is an object of the following format: + + +Triggered when an order edit is declined. + + + +Object of the following format: -```js +```js noReport noCopy { - id, //id of product - fields //an array of field names that were updated + id, //string ID of order edit } ``` @@ -1464,21 +1589,45 @@ In one case, when the `/admin/products/{id}` endpoint is used to update the prod
-`product.deleted` +`order-edit.requested` -Triggered when a product is deleted. +Triggered when an order edit is requested. Object of the following format: -```js +```js noReport noCopy { - id //string ID of product + id //string ID of order edit +} +``` + +
+ +`order-edit.confirmed` + + + +Triggered when an order edit is confirmed. + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of order edit } ``` @@ -1488,9 +1637,20 @@ Object of the following format:
-## Product Variant Events +## Order Edit Item Changes Events -This section holds all events related to product variants. +This section holds all events related to order edit item changes. + +:::note + +As of Medusa v1.3.9, Order Edits are available but guarded by a feature flag. To use Order Edits either: + +1. Enable the `MEDUSA_FF_ORDER_EDITING` environment variable; +2. Or enable the `order_editing` key in the Medusa server's settings. + +You can learn more about enabling it in the [feature flags](../feature-flags/toggle.md) documentation. + +::: @@ -1510,48 +1670,150 @@ Event Data Payload + -```js + + + + + +
-`product-variant.created` +`order-edit-item-change.CREATED` -Triggered when a product variant is created. +Triggered when an order edit item change is created. -Object of the following format: +```js noReport noCopy +{ + id //string ID of item change +} +``` + +
+ +`order-edit-item-change.DELETED` + + + +Triggered when an order edit item change is deleted. + + + +```js noReport noCopy { - id, //string ID of variant - product_id //string ID of product + id //string ID of item change } ```
+ +## Payment Events + +This section holds all events related to payment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`payment.created` + + + +Triggered when a payment is created. + + + +The entire payment passed as an object. You can refer to the [Payment entity](../../../references/entities/classes/Payment.md) for an idea of what fields to expect. + +
-`product-variant.updated` +`payment.updated` -Triggered when a product variant is updated. +Triggered when a payment is updated. -Object of the following format: +The entire payment passed as an object. You can refer to the [Payment entity](../../../references/entities/classes/Payment.md) for an idea of what fields to expect. + +
+ +`payment.payment_captured` + + + +Triggered when a payment is captured. + + + +The entire payment passed as an object. You can refer to the [Payment entity](../../../references/entities/classes/Payment.md) for an idea of what fields to expect. + +
+ +`payment.payment_capture_failed` + + + +Triggered when the capturing of a payment fails. + + + +The entire payment passed as an object. You can refer to the [Payment entity](../../../references/entities/classes/Payment.md) for an idea of what fields to expect. -```js +In addition, an error object is passed within the same object as the Payment provider: + +```js noReport noCopy { - id, //string ID of variant - product_id, //string ID of product - fields //array of names of updated fields + id, //string ID of payment + //... other payment fields + error: { + name, //string + nessage, //string + stack, //(optional) string + } } ``` @@ -1561,23 +1823,407 @@ Object of the following format:
-`product-variant.deleted` +`payment.payment_refund_created` -Triggered when a product variant is deleted. +Triggered when a refund of a payment is created. -Object of the following format: +The entire refund passed as an object. You can refer to the [Refund entity](../../../references/entities/classes/Refund.md) for an idea of what fields to expect. -```js -{ - id, //string ID of variant - product_id, //string ID of product - metadata //object of the `metadata` field of the variant +
+ +`payment.payment_refund_failed` + + + +Triggered when a payment's refund fails. + + + +The entire payment passed as an object. You can refer to the [Payment entity](../../../references/entities/classes/Payment.md) for an idea of what fields to expect. + +
+ +## Payment Collection Events + +This section holds all events related to payment collections. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`payment-collection.created` + + + +Triggered when a payment collection is created. + + + +The entire payment collection passed as an object. You can refer to the [Payment Collection entity](../../../references/entities/classes/PaymentCollection.md) for an idea of what fields to expect. + +
+ +`payment-collection.updated` + + + +Triggered when a payment collection is update. + + + +The entire payment collection passed as an object. You can refer to the [Payment Collection entity](../../../references/entities/classes/PaymentCollection.md) for an idea of what fields to expect. + +
+ +`payment-collection.deleted` + + + +Triggered when a payment collection is deleted. + + + +The entire payment collection passed as an object. You can refer to the [Payment Collection entity](../../../references/entities/classes/PaymentCollection.md) for an idea of what fields to expect. + +
+ +`payment-collection.payment_authorized` + + + +Triggered when a payment collection is either marked authorized or its payment session is authorized. + + + +The entire payment collection passed as an object. You can refer to the [Payment Collection entity](../../../references/entities/classes/PaymentCollection.md) for an idea of what fields to expect. + +
+ +## Product Events + +This section holds all events related to products. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`product.created` + + + +Triggered when a product is created. + + + +Object of the following format: + +```js noReport noCopy +{ + id //string ID of product +} +``` + +
+ +`product.updated` + + + +Triggered when a product and data associated with it (options, variant orders, etc…) is updated. + + + +The entire product passed as an object. You can refer to the [Product entity](../../../references/entities/classes/Product.md) for an idea of what fields to expect. + +In one case, when the `/admin/products/{id}` endpoint is used to update the product, the payload is an object of the following format: + +```js noReport noCopy +{ + id, //id of product + fields //an array of field names that were updated +} +``` + +
+ +`product.deleted` + + + +Triggered when a product is deleted. + + + +Object of the following format: + +```js noReport noCopy +{ + id //string ID of product +} +``` + +
+ +## Product Variant Events + +This section holds all events related to product variants. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`product-variant.created` + + + +Triggered when a product variant is created. + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of variant + product_id //string ID of product +} +``` + +
+ +`product-variant.updated` + + + +Triggered when a product variant is updated. + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of variant + product_id, //string ID of product + fields //array of names of updated fields +} +``` + +
+ +`product-variant.deleted` + + + +Triggered when a product variant is deleted. + + + +Object of the following format: + +```js noReport noCopy +{ + id, //string ID of variant + product_id, //string ID of product + metadata //object of the `metadata` field of the variant +} +``` + +
+ +## Publishable API Key Events + +This section holds all events related to publishable API keys. + +:::note + +As of Medusa v1.6.3, Publishable API Keys are available but guarded by a feature flag. To use Publishable API Keys either: + +1. Enable the `MEDUSA_FF_PUBLISHABLE_API_KEYS` environment variable; +2. Or enable the `publishable_api_keys` key in the Medusa server's settings. + +You can learn more about enabling it in the [feature flags](../feature-flags/toggle.md) documentation. + +::: + + + + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`publishable_api_key.created` + + + +Triggered when a publishable API key is created. + + + +Object of the following format: + +```js noReport noCopy +{ + id //string ID of publishable API key +} +``` + +
+ +`publishable_api_key.revoked` + + + +Triggered when a publishable API key is revoked. + + + +Object of the following format: + +```js noReport noCopy +{ + id //string ID of publishable API key } ``` @@ -1621,7 +2267,7 @@ Triggered when a region is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of region } @@ -1645,7 +2291,7 @@ Triggered when a region or data associated with it (countries, fulfillment provi Object of the following format: -```js +```js noReport noCopy { id, //string ID of region fields //array of names of updated fields @@ -1670,7 +2316,7 @@ Triggered when a region is deleted. Object of the following format: -```js +```js noReport noCopy { id //string ID of region } @@ -1726,7 +2372,7 @@ Triggered when a sales channel is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of sales channel } @@ -1750,7 +2396,7 @@ Triggered when a sales channel is updated Object of the following format: -```js +```js noReport noCopy { id, //string ID of sales channel } @@ -1774,7 +2420,7 @@ Triggered when a sales channel is deleted. Object of the following format: -```js +```js noReport noCopy { id //string ID of sales channel } @@ -1819,7 +2465,7 @@ Triggered when a swap is created. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap no_notification //boolean indicating whether a notification should be sent or not @@ -1844,7 +2490,7 @@ Triggered when a swap is registered as received. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap order_id, //string ID of order @@ -1870,7 +2516,7 @@ Triggered when fulfillment is created for a swap. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap fulfillment_id, //string ID of fulfillment @@ -1896,7 +2542,7 @@ Triggered when a shipment is created for a swap and the fulfillment associated w Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap fulfillment_id, //string ID of fulfillment @@ -1922,7 +2568,7 @@ Triggered when payment is completed for a swap which happens when the cart assoc Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap no_notification //boolean indicating whether a notification should be sent or not @@ -1947,7 +2593,7 @@ Triggered when the payment is captured for a swap. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap no_notification //boolean indicating whether a notification should be sent or not @@ -1972,7 +2618,7 @@ Triggered when the capturing of the payment of a swap fails. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap no_notification //boolean indicating whether a notification should be sent or not @@ -1997,7 +2643,7 @@ Triggered when a swap’s amount difference is processed and refunded. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap no_notification //boolean indicating whether a notification should be sent or not @@ -2022,7 +2668,7 @@ Triggered when processing and refunding a swap’s amount difference fails. Object of the following format: -```js +```js noReport noCopy { id, //string ID of swap no_notification //boolean indicating whether a notification should be sent or not @@ -2069,7 +2715,7 @@ Triggered when a user is created. Object of the following format: -```js +```js noReport noCopy { id //string ID of user } @@ -2093,7 +2739,7 @@ Triggered when a user is updated. Object of the following format: -```js +```js noReport noCopy { id //string ID of user } @@ -2117,7 +2763,7 @@ Triggered when a user requests to reset their password. Object of the following format: -```js +```js noReport noCopy { email, //string email of user requesting to reset their password token //token create to reset the password @@ -2142,7 +2788,7 @@ Triggered when a user is deleted. Object of the following format: -```js +```js noReport noCopy { id //string ID of user } diff --git a/docs/content/contribution-guidelines.md b/docs/content/contribution-guidelines.md index a4966bb235d2a..644a48550c49e 100644 --- a/docs/content/contribution-guidelines.md +++ b/docs/content/contribution-guidelines.md @@ -152,7 +152,7 @@ console.log("hello") ``` ~~~ -### Remove Report Buttons +### Remove Report Button Some code block don't need a report button. To remove the report button, use the `noReport` metadata. @@ -164,6 +164,18 @@ medusa new my-medusa-store --seed ``` ~~~ +### Remove Copy Button + +Some code blocks don't need a copy button. To remove the copy button, use the `noCopy` metadata: + +For example: + +~~~md +```bash noCopy +medusa new my-medusa-store --seed +``` +~~~ + ## NPM and Yarn Code Blocks If you’re adding code blocks that use NPM and Yarn, you must use the [npm2yarn syntax](https://docusaurus.io/docs/markdown-features/code-blocks#npm2yarn-remark-plugin). diff --git a/www/docs/src/css/_docspage.css b/www/docs/src/css/_docspage.css index 4c553ecd8bcd2..7d93f33ea8097 100644 --- a/www/docs/src/css/_docspage.css +++ b/www/docs/src/css/_docspage.css @@ -30,6 +30,10 @@ details summary { width: 50%; } +.reference-table .tooltip-container code { + white-space: nowrap; +} + .reference-table .theme-code-block span { max-width: 100%; word-break: break-word; diff --git a/www/docs/src/theme/CodeBlock/Content/String.js b/www/docs/src/theme/CodeBlock/Content/String.js index a4a8dc2f5aa46..48e918776e22b 100644 --- a/www/docs/src/theme/CodeBlock/Content/String.js +++ b/www/docs/src/theme/CodeBlock/Content/String.js @@ -26,7 +26,8 @@ export default function CodeBlockString({ title: titleProp, showLineNumbers: showLineNumbersProp, language: languageProp, - noReport = false + noReport = false, + noCopy = false }) { const { prism: {defaultLanguage, magicComments}, @@ -101,12 +102,14 @@ export default function CodeBlockString({ )} - - - + {!noCopy && ( + + + + )} diff --git a/www/docs/src/theme/CodeBlock/index.js b/www/docs/src/theme/CodeBlock/index.js index 72149f2b70e8a..d24c7493d612b 100644 --- a/www/docs/src/theme/CodeBlock/index.js +++ b/www/docs/src/theme/CodeBlock/index.js @@ -17,7 +17,7 @@ function maybeStringifyChildren(children) { // The children is now guaranteed to be one/more plain strings return Array.isArray(children) ? children.join('') : children; } -export default function CodeBlock({children: rawChildren, noReport = false, ...props}) { +export default function CodeBlock({children: rawChildren, noReport = false, noCopy = false, ...props}) { // The Prism theme on SSR is always the default theme but the site theme can // be in a different mode. React hydration doesn't update DOM styles that come // from SSR. Hence force a re-render after mounting to apply the current @@ -37,7 +37,7 @@ export default function CodeBlock({children: rawChildren, noReport = false, ...p {title} )} - + {children} From 01d521ed40985b129cadbe961aeafbc3b9369afe Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Wed, 14 Dec 2022 09:37:20 +0100 Subject: [PATCH 11/18] chore(medusa-js): Version package + add missing changeset --- packages/medusa-js/CHANGELOG.md | 6 ++++++ packages/medusa-js/package.json | 6 ++++-- yarn.lock | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/medusa-js/CHANGELOG.md b/packages/medusa-js/CHANGELOG.md index 654a7e8090a2d..60528de4c4457 100644 --- a/packages/medusa-js/CHANGELOG.md +++ b/packages/medusa-js/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 1.3.4 + +### Patch Changes + +- Correct missing version bump + ## 1.3.3 ### Patch Changes diff --git a/packages/medusa-js/package.json b/packages/medusa-js/package.json index c47b8d1130205..eeb9e42a318bb 100644 --- a/packages/medusa-js/package.json +++ b/packages/medusa-js/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa-js", - "version": "1.3.3", + "version": "1.3.4", "description": "Client for Medusa Commerce Rest API", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -15,12 +15,14 @@ "author": "Oliver Juhl", "license": "MIT", "dependencies": { - "@medusajs/medusa": "^1.7.0", "axios": "^0.24.0", "form-data": "^4.0.0", "qs": "^6.10.3", "retry-axios": "^2.6.0" }, + "peerDependencies": { + "@medusajs/medusa": "^1.7.0" + }, "repository": { "type": "git", "url": "https://github.com/medusajs/medusa", diff --git a/yarn.lock b/yarn.lock index 13940c3c037b9..310a01f83c02f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4381,7 +4381,6 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/medusa-js@workspace:packages/medusa-js" dependencies: - "@medusajs/medusa": ^1.7.0 "@types/jest": ^26.0.19 axios: ^0.24.0 cross-env: ^7.0.3 @@ -4390,10 +4389,12 @@ __metadata: qs: ^6.10.3 retry-axios: ^2.6.0 typescript: ^4.1.3 + peerDependencies: + "@medusajs/medusa": ^1.7.0 languageName: unknown linkType: soft -"@medusajs/medusa@*, @medusajs/medusa@^1.3.3, @medusajs/medusa@^1.7.0, @medusajs/medusa@workspace:packages/medusa": +"@medusajs/medusa@*, @medusajs/medusa@^1.3.3, @medusajs/medusa@workspace:packages/medusa": version: 0.0.0-use.local resolution: "@medusajs/medusa@workspace:packages/medusa" dependencies: From e2b7f77ba979275ed47678424f8fdd4ceb7417ad Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 14 Dec 2022 11:54:31 +0200 Subject: [PATCH 12/18] docs: fix id used in endpoint path in OAS (#2795) * docs: fix id used in endpoint path in OAS * docs: small fixes to OAS comments * revert changes in core package * undo changes in core files --- docs/api/admin-spec3.json | 5361 +++++------ docs/api/admin-spec3.yaml | 8351 +++++++++-------- .../getundefined | 0 .../getundefined | 0 docs/api/admin/openapi.yaml | 100 +- .../api/admin/paths/publishable-api-keys.yaml | 2 +- ...ishable-api-keys_{id}_sales-channels.yaml} | 13 +- ...le-api-keys_{id}_sales-channels_batch.yaml | 4 +- docs/api/store-spec3.json | 2820 +++--- docs/api/store-spec3.yaml | 3414 +++---- docs/api/store/openapi.yaml | 48 +- 11 files changed, 10067 insertions(+), 10046 deletions(-) rename docs/api/admin/code_samples/JavaScript/{publishable-api-keys_:id_sales-channels => publishable-api-keys_{id}_sales-channels}/getundefined (100%) rename docs/api/admin/code_samples/Shell/{publishable-api-keys_:id_sales-channels => publishable-api-keys_{id}_sales-channels}/getundefined (100%) rename docs/api/admin/paths/{publishable-api-keys_:id_sales-channels.yaml => publishable-api-keys_{id}_sales-channels.yaml} (75%) diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index cd29c8bbce48f..891a86a516528 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -202,115 +202,6 @@ tags: servers: - url: 'https://api.medusa-commerce.com/admin' paths: - /apps/authorizations: - post: - operationId: PostApps - summary: Generate Token for App - description: Generates a token for an application. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - application_name - - state - - code - properties: - application_name: - type: string - description: Name of the application for the token to be generated for. - state: - type: string - description: State of the application. - code: - type: string - description: The code for the generated token. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "application_name": "example", - "state": "ready", - "code": "token" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps: - get: - operationId: GetApps - summary: List Applications - description: Retrieve a list of applications. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/apps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - type: array - items: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /auth: post: operationId: PostAuth @@ -478,54 +369,47 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': + '/batch-jobs/{id}/cancel': post: - operationId: PostProductsToCollection - summary: Update Products - description: Updates products associated with a Product Collection + operationId: PostBatchJobsBatchJobCancel + summary: Cancel a Batch Job + description: Marks a batch job as canceled x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the batch job. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.cancel(batch_job_id) + + .then(({ batch_job }) => { + console.log(batch_job.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Batch Job responses: '200': description: OK @@ -534,8 +418,8 @@ paths: schema: type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -548,55 +432,47 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteProductsFromCollection - summary: Remove Product - description: Removes products associated with a Product Collection + '/batch-jobs/{id}/confirm': + post: + operationId: PostBatchJobsBatchJobConfirmProcessing + summary: Confirm a Batch Job + description: Confirms that a previously requested batch job should be executed. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the batch job. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string x-codeSamples: - - lang: Shell - label: cURL + - lang: JavaScript + label: JS Client source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + import Medusa from "@medusajs/medusa-js" - --header 'Authorization: Bearer {api_token}' \ + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) - --header 'Content-Type: application/json' \ + // must be previously logged in or use api token - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' + medusa.admin.batchJobs.confirm(batch_job_id) + + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ + + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Batch Job responses: '200': description: OK @@ -605,19 +481,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -630,11 +495,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /collections: + /batch-jobs: post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. x-authenticated: true requestBody: content: @@ -642,21 +507,40 @@ paths: schema: type: object required: - - title + - type + - context properties: - title: - type: string - description: The title to identify the Collection by. - handle: + type: type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. + description: The type of batch job to start. + example: product-export + context: type: object + description: >- + Additional infomration regarding the batch to be used for + processing. + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + type: boolean + description: >- + Set a batch job in dry_run mode to get some information on + what will be done without applying any modifications. + default: false x-codeSamples: - lang: JavaScript label: JS Client @@ -668,41 +552,42 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.create({ - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); + medusa.admin.batchJobs.create({ + type: 'product-export', + context: {}, + dry_run: false + }).then((({ batch_job }) => { + console.log(batch_job.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' \ + 'https://medusa-url.com/admin/batch-jobs' \ --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' \ + --data-raw '{ - "title": "New Collection" + "type": "product-export", + "context": { } }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Batch Job responses: - '200': + '201': description: OK content: application/json: schema: type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -716,48 +601,104 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. + operationId: GetBatchJobs + summary: List Batch Jobs + description: Retrieve a list of Batch Jobs. x-authenticated: true parameters: - in: query name: limit - description: The number of collections to return. + description: The number of batch jobs to return. schema: type: integer default: 10 - in: query name: offset - description: The number of collections to skip before the results. + description: The number of batch jobs to skip before results. schema: type: integer default: 0 - in: query - name: title - description: The title of collections to return. + name: id + style: form + explode: false + description: Filter by the batch ID schema: - type: string + oneOf: + - type: string + description: batch job ID + - type: array + description: multiple batch job IDs + items: + type: string - in: query - name: handle - description: The handle of collections to return. + name: type + style: form + explode: false + description: Filter by the batch type schema: - type: string + type: array + items: + type: string - in: query - name: q - description: a search term to search titles and handles. + name: confirmed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was confirmed, i.e. + less than, greater than etc. schema: - type: string + 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: discount_condition_id + name: pre_processed_at + style: form + explode: false description: >- - The discount condition id on which to filter the product - collections. + Date comparison for when resulting collections was pre processed, + i.e. less than, greater than etc. schema: - type: string + 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: created_at - description: Date comparison for when resulting collections were created. + name: completed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was completed, i.e. + less than, greater than etc. schema: type: object properties: @@ -778,8 +719,12 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: updated_at - description: Date comparison for when resulting collections were updated. + name: failed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was failed, i.e. less + than, greater than etc. schema: type: object properties: @@ -800,8 +745,83 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: deleted_at - description: Date comparison for when resulting collections were deleted. + name: canceled_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was canceled, i.e. + less than, greater than etc. + 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: order + description: Field used to order retrieved batch jobs + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each order of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each order of + the result. + schema: + type: string + - in: query + name: created_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was created, i.e. + less than, greater than etc. + 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 + style: form + explode: false + description: >- + Date comparison for when resulting collections was updated, i.e. + less than, greater than etc. schema: type: object properties: @@ -832,23 +852,23 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.list() + medusa.admin.batchJobs.list() - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); + .then(({ batch_jobs, limit, offset, count }) => { + console.log(batch_jobs.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/collections' \ + 'https://medusa-url.com/admin/batch-jobs' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Batch Job responses: '200': description: OK @@ -857,10 +877,10 @@ paths: schema: type: object properties: - collections: + batch_jobs: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/batch_job' count: type: integer description: The total number of items available @@ -882,17 +902,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}': - delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. + '/batch-jobs/{id}': + get: + operationId: GetBatchJobsBatchJob + summary: Get a Batch Job + description: Retrieves a Batch Job. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the Batch Job schema: type: string x-codeSamples: @@ -906,23 +926,23 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.delete(collection_id) + medusa.admin.batchJobs.retrieve(batch_job_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ batch_job }) => { + console.log(batch_job.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ + curl --location --request GET + 'https://medusa-url.com/admin/batch-jobs/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Batch Job responses: '200': description: OK @@ -931,17 +951,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted Collection - object: - type: string - description: The type of the object that was deleted. - default: product-collection - deleted: - type: boolean - description: Whether the collection was deleted successfully or not. - default: true + batch_job: + $ref: '#/components/schemas/batch_job' '400': $ref: '#/components/responses/400_error' '401': @@ -954,41 +965,49 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + '/collections/{id}/products/batch': + post: + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product Collection + description: The ID of the Collection. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.retrieve(collection_id) - - .then(({ collection }) => { - console.log(collection.id); - }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' security: - api_token: [] - cookie_auth: [] @@ -1016,10 +1035,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostCollectionsCollection - summary: Update a Collection - description: Updates a Product Collection. + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection x-authenticated: true parameters: - in: path @@ -1033,6 +1052,84 @@ paths: application/json: schema: type: object + required: + - product_ids + properties: + product_ids: + description: >- + An array of Product IDs to remove from the Product + Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections: + post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - title properties: title: type: string @@ -1058,7 +1155,7 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.update(collection_id, { + medusa.admin.collections.create({ title: 'New Collection' }) @@ -1069,7 +1166,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' \ @@ -1105,65 +1202,140 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /currencies: get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. x-authenticated: true parameters: - in: query - name: code - description: Code of the currency to search for. + name: limit + description: The number of collections to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of collections to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: title + description: The title of collections to return. schema: type: string - in: query - name: includes_tax - description: Search for tax inclusive currencies. + name: handle + description: The handle of collections to return. schema: - type: boolean + type: string - in: query - name: order - description: order to retrieve products in. + name: q + description: a search term to search titles and handles. schema: type: string - in: query - name: offset - description: How many products to skip in the result. + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. schema: - type: number - default: '0' + type: string - in: query - name: limit - description: Limit the number of products returned. + name: created_at + description: Date comparison for when resulting collections were created. schema: - type: number - default: '20' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.list() - - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - - --header 'Authorization: Bearer {api_token}' + 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: Date comparison for when resulting collections were updated. + 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: deleted_at + description: Date comparison for when resulting collections were deleted. + 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: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] tags: - - Currency + - Collection responses: '200': description: OK @@ -1172,10 +1344,10 @@ paths: schema: type: object properties: - currencies: + collections: type: array items: - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/product_collection' count: type: integer description: The total number of items available @@ -1185,28 +1357,31 @@ paths: limit: type: integer description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/collections/{id}': + delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. x-authenticated: true parameters: - in: path - name: code + name: id required: true - description: The code of the Currency. + description: The ID of the Collection. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' x-codeSamples: - lang: JavaScript label: JS Client @@ -1218,28 +1393,23 @@ paths: // must be previously logged in or use api token - medusa.admin.currencies.update(code, { - includes_tax: true - }) + medusa.admin.collections.delete(collection_id) - .then(({ currency }) => { - console.log(currency.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}' \ - --data-raw '{ - "includes_tax": true - }' + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] tags: - - Currency + - Collection responses: '200': description: OK @@ -1248,39 +1418,41 @@ paths: schema: type: object properties: - currency: - $ref: '#/components/schemas/currency' - '/customer-groups/{id}/customers/batch': - post: - operationId: PostCustomerGroupsGroupCustomersBatch - summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' + id: + type: string + description: The ID of the deleted Collection + object: + type: string + description: The type of the object that was deleted. + default: product-collection + deleted: + type: boolean + description: Whether the collection was deleted successfully or not. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Product Collection schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1292,40 +1464,23 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.addCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) + medusa.admin.collections.retrieve(collection_id) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/collections/{id}' \ - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1334,8 +1489,8 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -1348,16 +1503,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteCustomerGroupsGroupCustomerBatch - summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Collection. schema: type: string requestBody: @@ -1365,19 +1520,20 @@ paths: application/json: schema: type: object - required: - - customer_ids properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -1389,40 +1545,31 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.removeCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] + medusa.admin.collections.update(collection_id, { + title: 'New Collection' }) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] + "title": "New Collection" }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1431,8 +1578,8 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -1445,13 +1592,108 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customer-groups: + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency x-authenticated: true - parameters: [] + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' x-codeSamples: - lang: JavaScript label: JS Client @@ -1463,8 +1705,86 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.create({ - name: 'VIP' + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currency: + $ref: '#/components/schemas/currency' + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: 'Adds a list of customers, represented by id''s, to a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] }) .then(({ customer_group }) => { @@ -1474,14 +1794,19 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "VIP" + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] }' security: - api_token: [] @@ -1510,15 +1835,177 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: 'Removes a list of customers, represented by id''s, from a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + parameters: [] + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: type: string description: Name of the customer group metadata: @@ -2013,47 +2500,52 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}/cancel': + /apps/authorizations: post: - operationId: PostBatchJobsBatchJobCancel - summary: Cancel a Batch Job - description: Marks a batch job as canceled + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the batch job. - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - application_name + - state + - code + properties: + application_name: + type: string + description: Name of the application for the token to be generated for. + state: + type: string + description: State of the application. + code: + type: string + description: The code for the generated token. x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.cancel(batch_job_id) - - .then(({ batch_job }) => { - console.log(batch_job.id); - }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ + 'https://medusa-url.com/admin/apps/authorizations' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - App responses: '200': description: OK @@ -2062,8 +2554,8 @@ paths: schema: type: object properties: - batch_job: - $ref: '#/components/schemas/batch_job' + apps: + $ref: '#/components/schemas/OAuth' '400': $ref: '#/components/responses/400_error' '401': @@ -2076,517 +2568,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}/confirm': - post: - operationId: PostBatchJobsBatchJobConfirmProcessing - summary: Confirm a Batch Job - description: Confirms that a previously requested batch job should be executed. + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the batch job. - schema: - type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.confirm(batch_job_id) - - .then(({ batch_job }) => { - console.log(batch_job.id); - }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Batch Job - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - batch_job: - $ref: '#/components/schemas/batch_job' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /batch-jobs: - post: - operationId: PostBatchJobs - summary: Create a Batch Job - description: Creates a Batch Job. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on - what will be done without applying any modifications. - default: false - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.create({ - type: 'product-export', - context: {}, - dry_run: false - }).then((({ batch_job }) => { - console.log(batch_job.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs' \ - - --header 'Content-Type: application/json' \ - - --header 'Authorization: Bearer {api_token}' \ - - --data-raw '{ - "type": "product-export", - "context": { } - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Batch Job - responses: - '201': - description: OK - content: - application/json: - schema: - type: object - properties: - batch_job: - $ref: '#/components/schemas/batch_job' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetBatchJobs - summary: List Batch Jobs - description: Retrieve a list of Batch Jobs. - x-authenticated: true - parameters: - - in: query - name: limit - description: The number of batch jobs to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of batch jobs to skip before results. - schema: - type: integer - default: 0 - - in: query - name: id - style: form - explode: false - description: Filter by the batch ID - schema: - oneOf: - - type: string - description: batch job ID - - type: array - description: multiple batch job IDs - items: - type: string - - in: query - name: type - style: form - explode: false - description: Filter by the batch type - schema: - type: array - items: - type: string - - in: query - name: confirmed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was confirmed, i.e. - less than, greater than etc. - 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: pre_processed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was pre processed, - i.e. less than, greater than etc. - 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: completed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was completed, i.e. - less than, greater than etc. - 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: failed_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was failed, i.e. less - than, greater than etc. - 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 - style: form - explode: false - description: >- - Date comparison for when resulting collections was canceled, i.e. - less than, greater than etc. - 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: order - description: Field used to order retrieved batch jobs - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each order of - the result. - schema: - type: string - - in: query - name: created_at - style: form - explode: false - description: >- - Date comparison for when resulting collections was created, i.e. - less than, greater than etc. - 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 - style: form - explode: false - description: >- - Date comparison for when resulting collections was updated, i.e. - less than, greater than etc. - 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: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.list() - - .then(({ batch_jobs, limit, offset, count }) => { - console.log(batch_jobs.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/batch-jobs' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Batch Job - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - batch_jobs: - type: array - items: - $ref: '#/components/schemas/batch_job' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/batch-jobs/{id}': - get: - operationId: GetBatchJobsBatchJob - summary: Get a Batch Job - description: Retrieves a Batch Job. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Batch Job - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.batchJobs.retrieve(batch_job_id) - - .then(({ batch_job }) => { - console.log(batch_job.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/batch-jobs/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - App responses: '200': description: OK @@ -2595,8 +2593,10 @@ paths: schema: type: object properties: - batch_job: - $ref: '#/components/schemas/batch_job' + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' '400': $ref: '#/components/responses/400_error' '401': @@ -14704,7 +14704,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Publishable Api Key + - PublishableApiKey responses: '200': description: OK @@ -14802,7 +14802,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Publishable Api Key + - PublishableApiKey responses: '200': description: OK @@ -14916,259 +14916,15 @@ paths: type: number default: '0' - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.publishableApiKeys.list() - .then(({ publishable_api_keys }) => { - console.log(publishable_api_keys) - }) - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/publishable-api-keys' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - PublishableApiKeys - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - publishable_api_keys: - type: array - $ref: '#/components/schemas/publishable_api_key' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/publishable-api-keys/{id}': - delete: - operationId: DeletePublishableApiKeysPublishableApiKey - summary: Delete a PublishableApiKey - description: Deletes a PublishableApiKeys - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the PublishableApiKeys to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.publishableApiKey.delete(key_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/publishable-api-key/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - PublishableApiKey - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted PublishableApiKey. - object: - type: string - description: The type of the object that was deleted. - format: publishable_api_key - deleted: - type: boolean - description: Whether the PublishableApiKeys was deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - get: - operationId: GetPublishableApiKeysPublishableApiKey - summary: Get a Publishable API Key - description: Retrieve the Publishable Api Key. - parameters: - - in: path - name: id - required: true - description: The ID of the PublishableApiKey. - schema: - type: string - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.publishableApiKey.retrieve(pubKeyId) - .then(({ publishable_api_key }) => { - console.log(publishable_api_key.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ - - --header 'Authorization: Bearer {api_token}' - - -d '{ "created_by": "user_123" }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - PublishableApiKey - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/publishable-api-keys/:id/sales-channels': - get: - operationId: GetPublishableApiKeySalesChannels - summary: List PublishableApiKey's SalesChannels - description: List PublishableApiKey's SalesChannels - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.publishableApiKeys.listSalesChannels() - .then(({ sales_channels, limit, offset, count }) => { - console.log(sales_channels) - }) - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - PublishableApiKeySalesChannels - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - sales_channels: - type: array - items: - $ref: '#/components/schemas/sales_channel' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/publishable-api-keys/{id}/revoke': - post: - operationId: PostPublishableApiKeysPublishableApiKeyRevoke - summary: Revoke a PublishableApiKey - description: Revokes a PublishableApiKey. - parameters: - - in: path - name: id - required: true - description: The ID of the PublishableApiKey. + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string - x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -15180,20 +14936,17 @@ paths: // must be previously logged in or use api token - medusa.admin.publishableApiKey.revoke() - .then(({ publishable_api_key }) => { - console.log(publishable_api_key.id) + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' - \ + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys' \ --header 'Authorization: Bearer {api_token}' - - -d '{ "created_by": "user_123", "revoked_by": "user_123" }' security: - api_token: [] - cookie_auth: [] @@ -15207,7 +14960,8 @@ paths: schema: type: object properties: - publishable_api_key: + publishable_api_keys: + type: array $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' @@ -15221,28 +14975,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-key/{id}': - post: - operationId: PostPublishableApiKysPublishableApiKey - summary: Updates a PublishableApiKey - description: Updates a PublishableApiKey. + '/publishable-api-keys/{id}': + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the PublishableApiKey. + description: The ID of the PublishableApiKeys to delete. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - title: - description: A title to update for the key. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15254,25 +14999,17 @@ paths: // must be previously logged in or use api token - medusa.admin.publishableApiKey.update(publishable_key_id, { - title: "new title" - }) - .then(({ publishable_api_key }) => { - console.log(publishable_api_key.id) + medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) }) - lang: Shell label: cURL source: > - curl --location --request POST + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{id}' \ - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "updated title" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -15286,48 +15023,31 @@ paths: schema: type: object properties: - publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + format: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/regions/{id}/countries': - post: - operationId: PostRegionsRegionCountries - summary: Add Country - description: Adds a Country to the list of Countries in a Region - x-authenticated: true + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. parameters: - in: path name: id required: true - description: The ID of the Region. + description: The ID of the PublishableApiKey. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -15339,31 +15059,24 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.addCountry(region_id, { - country_code: 'dk' - }) - - .then(({ region }) => { - console.log(region.id); - }); + medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions/{region_id}/countries' \ - - --header 'Authorization: Bearer {api_token}' \ + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ - --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' - --data-raw '{ - "country_code": "dk" - }' + -d '{ "created_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Region + - PublishableApiKey responses: '200': description: OK @@ -15372,8 +15085,8 @@ paths: schema: type: object properties: - region: - $ref: '#/components/schemas/region' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -15386,30 +15099,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/fulfillment-providers': - post: - operationId: PostRegionsRegionFulfillmentProviders - summary: Add Fulfillment Provider - description: Adds a Fulfillment Provider to a Region + '/publishable-api-keys/{id}/sales-channels': + get: + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Region. + description: The ID of the Publishable Api Key. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15421,41 +15123,34 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.addFulfillmentProvider(region_id, { - provider_id: 'manual' - }) - - .then(({ region }) => { - console.log(region.id); - }); + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' + \ - --data-raw '{ - "provider_id": "manual" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Region + - PublishableApiKey responses: '200': description: OK content: application/json: schema: - type: object properties: - region: - $ref: '#/components/schemas/region' + sales_channels: + type: array + items: + $ref: '#/components/schemas/sales_channel' '400': $ref: '#/components/responses/400_error' '401': @@ -15468,30 +15163,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/payment-providers': + '/publishable-api-keys/{id}/revoke': post: - operationId: PostRegionsRegionPaymentProviders - summary: Add Payment Provider - description: Adds a Payment Provider to a Region - x-authenticated: true + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. parameters: - in: path name: id required: true - description: The ID of the Region. + description: The ID of the PublishableApiKey. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -15503,31 +15187,25 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.addPaymentProvider(region_id, { - provider_id: 'manual' - }) - - .then(({ region }) => { - console.log(region.id); - }); + medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ - - --header 'Authorization: Bearer {api_token}' \ + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' + \ - --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' - --data-raw '{ - "provider_id": "manual" - }' + -d '{ "created_by": "user_123", "revoked_by": "user_123" }' security: - api_token: [] - cookie_auth: [] tags: - - Region + - PublishableApiKey responses: '200': description: OK @@ -15536,8 +15214,8 @@ paths: schema: type: object properties: - region: - $ref: '#/components/schemas/region' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -15550,66 +15228,28 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /regions: + '/publishable-api-key/{id}': post: - operationId: PostRegions - summary: Create a Region - description: Creates a Region + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string requestBody: content: application/json: schema: type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - tax_code: - description: An optional tax code the Region. + title: + description: A title to update for the key. type: string - tax_rate: - description: The tax rate to use on Orders in the Region. - type: number - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - example: - - US - type: array - items: - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -15621,53 +15261,30 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.create({ - name: 'Europe', - currency_code: 'eur', - tax_rate: 0, - payment_providers: [ - 'manual' - ], - fulfillment_providers: [ - 'manual' - ], - countries: [ - 'DK' - ] + medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" }) - - .then(({ region }) => { - console.log(region.id); - }); + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/regions' \ + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Europe", - "currency_code": "eur", - "tax_rate": 0, - "payment_providers": [ - "manual" - ], - "fulfillment_providers": [ - "manual" - ], - "countries": [ - "DK" - ] + "title": "updated title" }' security: - api_token: [] - cookie_auth: [] tags: - - Region + - PublishableApiKey responses: '200': description: OK @@ -15676,8 +15293,8 @@ paths: schema: type: object properties: - region: - $ref: '#/components/schemas/region' + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' '400': $ref: '#/components/responses/400_error' '401': @@ -15690,50 +15307,34 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetRegions - summary: List Regions - description: Retrieves a list of Regions. + '/regions/{id}/countries': + post: + operationId: PostRegionsRegionCountries + summary: Add Country + description: Adds a Country to the list of Countries in a Region x-authenticated: true parameters: - - in: query - name: limit - schema: - type: integer - default: 50 - required: false - description: limit the number of regions in response - - in: query - name: offset - schema: - type: integer - default: 0 - required: false - description: Offset of regions in response (used for pagination) - - in: query - name: created_at - schema: - type: object - required: false - description: >- - Date comparison for when resulting region was created, i.e. less - than, greater than etc. - - in: query - name: updated_at - schema: - type: object - required: false - description: >- - Date comparison for when resulting region was updated, i.e. less - than, greater than etc. - - in: query - name: deleted_at + - in: path + name: id + required: true + description: The ID of the Region. schema: - type: object - required: false - description: >- - Date comparison for when resulting region was deleted, i.e. less - than, greater than etc. + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - country_code + properties: + country_code: + description: The 2 character ISO code for the Country. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -15745,18 +15346,26 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.list() + medusa.admin.regions.addCountry(region_id, { + country_code: 'dk' + }) - .then(({ regions, limit, offset, count }) => { - console.log(regions.length); + .then(({ region }) => { + console.log(region.id); }); - lang: Shell label: cURL source: > - curl --location --request GET 'https://medusa-url.com/admin/regions' - \ + curl --location --request POST + 'https://medusa-url.com/admin/regions/{region_id}/countries' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "country_code": "dk" + }' security: - api_token: [] - cookie_auth: [] @@ -15770,19 +15379,8 @@ paths: schema: type: object properties: - regions: - type: array - items: - $ref: '#/components/schemas/region' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + region: + $ref: '#/components/schemas/region' '400': $ref: '#/components/responses/400_error' '401': @@ -15795,11 +15393,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}': - delete: - operationId: DeleteRegionsRegion - summary: Delete a Region - description: Deletes a Region. + '/regions/{id}/fulfillment-providers': + post: + operationId: PostRegionsRegionFulfillmentProviders + summary: Add Fulfillment Provider + description: Adds a Fulfillment Provider to a Region x-authenticated: true parameters: - in: path @@ -15808,6 +15406,17 @@ paths: description: The ID of the Region. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Fulfillment Provider to add. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15819,18 +15428,26 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.delete(region_id) + medusa.admin.regions.addFulfillmentProvider(region_id, { + provider_id: 'manual' + }) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ region }) => { + console.log(region.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' security: - api_token: [] - cookie_auth: [] @@ -15841,20 +15458,11 @@ paths: description: OK content: application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Region. - object: - type: string - description: The type of the object that was deleted. - default: region - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + schema: + type: object + properties: + region: + $ref: '#/components/schemas/region' '400': $ref: '#/components/responses/400_error' '401': @@ -15867,10 +15475,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetRegionsRegion - summary: Get a Region - description: Retrieves a Region. + '/regions/{id}/payment-providers': + post: + operationId: PostRegionsRegionPaymentProviders + summary: Add Payment Provider + description: Adds a Payment Provider to a Region x-authenticated: true parameters: - in: path @@ -15879,6 +15488,17 @@ paths: description: The ID of the Region. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Payment Provider to add. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15890,7 +15510,9 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.retrieve(region_id) + medusa.admin.regions.addPaymentProvider(region_id, { + provider_id: 'manual' + }) .then(({ region }) => { console.log(region.id); @@ -15898,10 +15520,16 @@ paths: - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/regions/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' security: - api_token: [] - cookie_auth: [] @@ -15929,23 +15557,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /regions: post: - operationId: PostRegionsRegion - summary: Update a Region - description: Updates a Region + operationId: PostRegions + summary: Create a Region + description: Creates a Region x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Region. - schema: - type: string requestBody: content: application/json: schema: type: object + required: + - name + - currency_code + - tax_rate + - payment_providers + - fulfillment_providers + - countries properties: name: description: The name of the Region @@ -15956,31 +15585,12 @@ paths: externalDocs: url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' description: See a list of codes. - automatic_taxes: - description: >- - If true Medusa will automatically calculate taxes for carts - in this region. If false you have to manually call POST - /carts/:id/taxes. - type: boolean - gift_cards_taxable: - description: >- - Whether gift cards in this region should be applied sales - tax when purchasing a gift card - type: boolean - tax_provider_id: - description: >- - The ID of the tax provider to use; if null the system tax - provider is used - type: string tax_code: description: An optional tax code the Region. type: string tax_rate: description: The tax rate to use on Orders in the Region. type: number - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean payment_providers: description: >- A list of Payment Provider IDs that should be enabled for @@ -15999,9 +15609,14 @@ paths: description: >- A list of countries' 2 ISO Characters that should be included in the Region. + example: + - US type: array items: type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -16013,8 +15628,19 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.update(region_id, { - name: 'Europe' + medusa.admin.regions.create({ + name: 'Europe', + currency_code: 'eur', + tax_rate: 0, + payment_providers: [ + 'manual' + ], + fulfillment_providers: [ + 'manual' + ], + countries: [ + 'DK' + ] }) .then(({ region }) => { @@ -16024,14 +15650,25 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/regions/{id}' \ + 'https://medusa-url.com/admin/regions' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Europe" + "name": "Europe", + "currency_code": "eur", + "tax_rate": 0, + "payment_providers": [ + "manual" + ], + "fulfillment_providers": [ + "manual" + ], + "countries": [ + "DK" + ] }' security: - api_token: [] @@ -16060,11 +15697,116 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/fulfillment-options': get: - operationId: GetRegionsRegionFulfillmentOptions - summary: List Fulfillment Options - description: Gathers all the fulfillment options available to in the Region. + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + x-authenticated: true + parameters: + - in: query + name: limit + schema: + type: integer + default: 50 + required: false + description: limit the number of regions in response + - in: query + name: offset + schema: + type: integer + default: 0 + required: false + description: Offset of regions in response (used for pagination) + - in: query + name: created_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was created, i.e. less + than, greater than etc. + - in: query + name: updated_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was updated, i.e. less + than, greater than etc. + - in: query + name: deleted_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was deleted, i.e. less + than, greater than etc. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.list() + + .then(({ regions, limit, offset, count }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/regions' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + regions: + type: array + items: + $ref: '#/components/schemas/region' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}': + delete: + operationId: DeleteRegionsRegion + summary: Delete a Region + description: Deletes a Region. x-authenticated: true parameters: - in: path @@ -16084,16 +15826,16 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.retrieveFulfillmentOptions(region_id) + medusa.admin.regions.delete(region_id) - .then(({ fulfillment_options }) => { - console.log(fulfillment_options.length); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -16109,20 +15851,17 @@ paths: schema: type: object properties: - fulfillment_options: - type: array - items: - properties: - provider_id: - type: string - description: ID of the fulfillment provider - options: - type: array - description: fulfillment provider options - example: - - id: manual-fulfillment - - id: manual-fulfillment-return - is_return: true + id: + type: string + description: The ID of the deleted Region. + object: + type: string + description: The type of the object that was deleted. + default: region + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -16135,12 +15874,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/countries/{country_code}': - delete: - operationId: PostRegionsRegionCountriesCountry - summary: Delete Country + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. x-authenticated: true - description: Removes a Country from the list of Countries in a Region parameters: - in: path name: id @@ -16148,15 +15886,6 @@ paths: description: The ID of the Region. schema: type: string - - in: path - name: country_code - description: The 2 character ISO code for the Country. - required: true - schema: - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -16168,7 +15897,7 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.deleteCountry(region_id, 'dk') + medusa.admin.regions.retrieve(region_id) .then(({ region }) => { console.log(region.id); @@ -16176,8 +15905,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ + curl --location --request GET + 'https://medusa-url.com/admin/regions/{id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -16207,11 +15936,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/fulfillment-providers/{provider_id}': - delete: - operationId: PostRegionsRegionFulfillmentProvidersProvider - summary: Del. Fulfillment Provider - description: Removes a Fulfillment Provider. + post: + operationId: PostRegionsRegion + summary: Update a Region + description: Updates a Region x-authenticated: true parameters: - in: path @@ -16220,12 +15948,67 @@ paths: description: The ID of the Region. schema: type: string - - in: path - name: provider_id - required: true - description: The ID of the Fulfillment Provider. - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: The name of the Region + type: string + currency_code: + description: The 3 character ISO currency code to use for the Region. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + automatic_taxes: + description: >- + If true Medusa will automatically calculate taxes for carts + in this region. If false you have to manually call POST + /carts/:id/taxes. + type: boolean + gift_cards_taxable: + description: >- + Whether gift cards in this region should be applied sales + tax when purchasing a gift card + type: boolean + tax_provider_id: + description: >- + The ID of the tax provider to use; if null the system tax + provider is used + type: string + tax_code: + description: An optional tax code the Region. + type: string + tax_rate: + description: The tax rate to use on Orders in the Region. + type: number + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + payment_providers: + description: >- + A list of Payment Provider IDs that should be enabled for + the Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Provider IDs that should be enabled + for the Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be + included in the Region. + type: array + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -16237,7 +16020,9 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') + medusa.admin.regions.update(region_id, { + name: 'Europe' + }) .then(({ region }) => { console.log(region.id); @@ -16245,11 +16030,16 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' - \ + curl --location --request POST + 'https://medusa-url.com/admin/regions/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Europe" + }' security: - api_token: [] - cookie_auth: [] @@ -16277,11 +16067,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/payment-providers/{provider_id}': - delete: - operationId: PostRegionsRegionPaymentProvidersProvider - summary: Delete Payment Provider - description: Removes a Payment Provider. + '/regions/{id}/fulfillment-options': + get: + operationId: GetRegionsRegionFulfillmentOptions + summary: List Fulfillment Options + description: Gathers all the fulfillment options available to in the Region. x-authenticated: true parameters: - in: path @@ -16290,12 +16080,6 @@ paths: description: The ID of the Region. schema: type: string - - in: path - name: provider_id - required: true - description: The ID of the Payment Provider. - schema: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -16307,17 +16091,16 @@ paths: // must be previously logged in or use api token - medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + medusa.admin.regions.retrieveFulfillmentOptions(region_id) - .then(({ region }) => { - console.log(region.id); + .then(({ fulfillment_options }) => { + console.log(fulfillment_options.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' - \ + curl --location --request GET + 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ --header 'Authorization: Bearer {api_token}' security: @@ -16333,8 +16116,20 @@ paths: schema: type: object properties: - region: - $ref: '#/components/schemas/region' + fulfillment_options: + type: array + items: + properties: + provider_id: + type: string + description: ID of the fulfillment provider + options: + type: array + description: fulfillment provider options + example: + - id: manual-fulfillment + - id: manual-fulfillment-return + is_return: true '400': $ref: '#/components/responses/400_error' '401': @@ -16347,91 +16142,28 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /shipping-options: - post: - operationId: PostShippingOptions - summary: Create Shipping Option - description: Creates a Shipping Option + '/regions/{id}/countries/{country_code}': + delete: + operationId: PostRegionsRegionCountriesCountry + summary: Delete Country x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + description: Removes a Country from the list of Countries in a Region + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: country_code + description: The 2 character ISO code for the Country. + required: true + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -16443,40 +16175,23 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.create({ - name: 'PostFake', - region_id: "saasf", - provider_id: "manual", - data: { - }, - price_type: 'flat_rate' - }) + medusa.admin.regions.deleteCountry(region_id, 'dk') - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then(({ region }) => { + console.log(region.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-options' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ - --data-raw '{ - "name": "PostFake", - "region_id": "afasf", - "provider_id": "manual", - "data": {}, - "price_type": "flat_rate" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Region responses: '200': description: OK @@ -16485,8 +16200,8 @@ paths: schema: type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + region: + $ref: '#/components/schemas/region' '400': $ref: '#/components/responses/400_error' '401': @@ -16499,27 +16214,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetShippingOptions - summary: List Shipping Options - description: Retrieves a list of Shipping Options. + '/regions/{id}/fulfillment-providers/{provider_id}': + delete: + operationId: PostRegionsRegionFulfillmentProvidersProvider + summary: Del. Fulfillment Provider + description: Removes a Fulfillment Provider. x-authenticated: true parameters: - - in: query - name: region_id + - in: path + name: id + required: true + description: The ID of the Region. schema: type: string - description: Region ID to fetch options from - - in: query - name: is_return - schema: - type: boolean - description: Flag for fetching return options only - - in: query - name: admin_only + - in: path + name: provider_id + required: true + description: The ID of the Fulfillment Provider. schema: - type: boolean - description: Flag for fetching admin specific options + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -16531,23 +16244,24 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.list() + medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') - .then(({ shipping_options, count }) => { - console.log(shipping_options.length); + .then(({ region }) => { + console.log(region.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Region responses: '200': description: OK @@ -16556,13 +16270,8 @@ paths: schema: type: object properties: - shipping_options: - type: array - items: - $ref: '#/components/schemas/shipping_option' - count: - type: integer - description: The total number of items available + region: + $ref: '#/components/schemas/region' '400': $ref: '#/components/responses/400_error' '401': @@ -16575,17 +16284,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-options/{id}': + '/regions/{id}/payment-providers/{provider_id}': delete: - operationId: DeleteShippingOptionsOption - summary: Delete a Shipping Option - description: Deletes a Shipping Option. + operationId: PostRegionsRegionPaymentProvidersProvider + summary: Delete Payment Provider + description: Removes a Payment Provider. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Option. + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Payment Provider. schema: type: string x-codeSamples: @@ -16599,23 +16314,24 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.delete(option_id) + medusa.admin.regions.deletePaymentProvider(region_id, 'manual') - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ region }) => { + console.log(region.id); }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-options/{option_id}' \ + 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Region responses: '200': description: OK @@ -16624,17 +16340,102 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted Shipping Option. - object: - type: string - description: The type of the object that was deleted. - default: shipping-option - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + region: + $ref: '#/components/schemas/region' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons: + post: + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - label + - value + properties: + label: + description: The label to display to the Customer. + type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + parent_return_reason_id: + description: The ID of the parent return reason. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returnReasons.create({ + label: 'Damaged', + value: 'damaged' + }) + + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/return-reasons' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "label": "Damaged", + "value": "damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16648,17 +16449,10 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetShippingOptionsOption - summary: Get a Shipping Option - description: Retrieves a Shipping Option. + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -16670,23 +16464,23 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.retrieve(option_id) + medusa.admin.returnReasons.list() - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then(({ return_reasons }) => { + console.log(return_reasons.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/shipping-options/{id}' \ + 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return Reason responses: '200': description: OK @@ -16695,8 +16489,10 @@ paths: schema: type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + return_reasons: + type: array + items: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16709,65 +16505,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostShippingOptionsOption - summary: Update Shipping Option - description: Updates a Shipping Option + '/return-reasons/{id}': + delete: + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Option. + description: The ID of the return reason schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - amount: - description: The amount to charge for the Shipping Option. - type: integer - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -16779,43 +16529,23 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.update(option_id, { - name: 'PostFake', - requirements: [ - { - id, - type: 'max_subtotal', - amount: 1000 - } - ] - }) + medusa.admin.returnReasons.delete(return_reason_id) - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-options/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/return-reasons/{id}' \ - --data-raw '{ - "requirements": [ - { - "type": "max_subtotal", - "amount": 1000 - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return Reason responses: '200': description: OK @@ -16824,8 +16554,17 @@ paths: schema: type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + id: + type: string + description: The ID of the deleted return reason + object: + type: string + description: The type of the object that was deleted. + default: return_reason + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -16838,23 +16577,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /shipping-profiles: - post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -16866,31 +16600,23 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.create({ - name: 'Large Products' - }) + medusa.admin.returnReasons.retrieve(return_reason_id) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/return-reasons/{id}' \ - --data-raw '{ - "name": "Large Products" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK @@ -16899,8 +16625,8 @@ paths: schema: type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16913,11 +16639,40 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetShippingProfiles - summary: List Shipping Profiles - description: Retrieves a list of Shipping Profile. + post: + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + label: + description: The label to display to the Customer. + type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -16929,23 +16684,31 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.list() + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' + }) - .then(({ shipping_profiles }) => { - console.log(shipping_profiles.length); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ + curl --location --request POST + 'https://medusa-url.com/admin/return-reasons/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "label": "Damaged" + }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK @@ -16954,10 +16717,8 @@ paths: schema: type: object properties: - shipping_profiles: - type: array - items: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16970,17 +16731,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': - delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. - x-authenticated: true + '/returns/{id}/cancel': + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the Return. schema: type: string x-codeSamples: @@ -16994,23 +16754,23 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.delete(profile_id) + medusa.admin.returns.cancel(return_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + source: > + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return responses: '200': description: OK @@ -17019,17 +16779,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted Shipping Profile. - object: - type: string - description: The type of the object that was deleted. - default: shipping_profile - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -17042,18 +16793,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /returns: get: - operationId: GetShippingProfilesProfile - summary: Get a Shipping Profile - description: Retrieves a Shipping Profile. - x-authenticated: true + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. + - in: query + name: limit + description: The upper limit for the amount of responses returned. schema: - type: string + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' x-codeSamples: - lang: JavaScript label: JS Client @@ -17065,23 +16822,23 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.retrieve(profile_id) + medusa.admin.returns.list() - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + curl --location --request GET 'https://medusa-url.com/admin/returns' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return responses: '200': description: OK @@ -17090,8 +16847,19 @@ paths: schema: type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + returns: + type: array + items: + $ref: '#/components/schemas/return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -17104,15 +16872,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/returns/{id}/receive': post: - operationId: PostShippingProfilesProfile - summary: Update a Shipping Profile - description: Updates a Shipping Profile + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the Return. schema: type: string requestBody: @@ -17120,10 +16891,26 @@ paths: application/json: schema: type: object + required: + - items properties: - name: - description: The name of the Shipping Profile - type: string + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -17135,31 +16922,41 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.update(shipping_profile_id, { - name: 'Large Products' + medusa.admin.returns.receive(return_id, { + items: [ + { + item_id, + quantity: 1 + } + ] }) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles/{id} \ + 'https://medusa-url.com/admin/returns/{id}/receive' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Large Products" + "items": [ + { + "item_id": "asafg", + "quantity": 1 + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return responses: '200': description: OK @@ -17168,8 +16965,8 @@ paths: schema: type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return: + $ref: '#/components/schemas/return' '400': $ref: '#/components/responses/400_error' '401': @@ -17862,18 +17659,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/cancel': + /shipping-profiles: post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string + operationId: PostShippingProfiles + summary: Create a Shipping Profile + description: Creates a Shipping Profile + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -17885,23 +17687,31 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.cancel(return_id) + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) - .then(({ order }) => { - console.log(order.id); + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/cancel' \ + 'https://medusa-url.com/admin/shipping-profiles' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Profile responses: '200': description: OK @@ -17910,8 +17720,8 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -17924,24 +17734,76 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /returns: get: - operationId: GetReturns - summary: List Returns - description: Retrieves a list of Returns + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.list() + + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/shipping_profile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/shipping-profiles/{id}': + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. + - in: path + name: id + required: true + description: The ID of the Shipping Profile. schema: - type: number - default: '0' + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -17953,23 +17815,23 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.list() + medusa.admin.shippingProfiles.delete(profile_id) - .then(({ returns, limit, offset, count }) => { - console.log(returns.length); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request GET 'https://medusa-url.com/admin/returns' - \ + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Profile responses: '200': description: OK @@ -17978,19 +17840,17 @@ paths: schema: type: object properties: - returns: - type: array - items: - $ref: '#/components/schemas/return' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -18003,45 +17863,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/receive': - post: - operationId: PostReturnsReturnReceive - summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. + get: + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Return. + description: The ID of the Shipping Profile. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -18053,41 +17886,23 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.receive(return_id, { - items: [ - { - item_id, - quantity: 1 - } - ] - }) + medusa.admin.shippingProfiles.retrieve(profile_id) - .then((data) => { - console.log(data.return.id); + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/receive' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - --data-raw '{ - "items": [ - { - "item_id": "asafg", - "quantity": 1 - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Profile responses: '200': description: OK @@ -18096,8 +17911,8 @@ paths: schema: type: object properties: - return: - $ref: '#/components/schemas/return' + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -18110,40 +17925,26 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /return-reasons: post: - operationId: PostReturnReasons - summary: Create a Return Reason - description: Creates a Return Reason - x-authenticated: true + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string requestBody: content: application/json: schema: type: object - required: - - label - - value properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - parent_return_reason_id: - description: The ID of the parent return reason. - type: string - description: - description: An optional description to for the Reason. + name: + description: The name of the Shipping Profile type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -18155,33 +17956,31 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.create({ - label: 'Damaged', - value: 'damaged' + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' }) - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/return-reasons' \ + 'https://medusa-url.com/admin/shipping-profiles/{id} \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "label": "Damaged", - "value": "damaged" + "name": "Large Products" }' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Profile responses: '200': description: OK @@ -18190,8 +17989,8 @@ paths: schema: type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -18204,11 +18003,22 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. + '/store/currencies/{code}': + post: + operationId: PostStoreCurrenciesCode + summary: Add a Currency Code + description: Adds a Currency Code to the available currencies. x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -18220,23 +18030,23 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.list() + medusa.admin.store.addCurrency('eur') - .then(({ return_reasons }) => { - console.log(return_reasons.length); + .then(({ store }) => { + console.log(store.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/return-reasons' \ + curl --location --request POST + 'https://medusa-url.com/admin/store/currencies/eur' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Store responses: '200': description: OK @@ -18245,10 +18055,8 @@ paths: schema: type: object properties: - return_reasons: - type: array - items: - $ref: '#/components/schemas/return_reason' + store: + $ref: '#/components/schemas/store' '400': $ref: '#/components/responses/400_error' '401': @@ -18261,19 +18069,21 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/return-reasons/{id}': delete: - operationId: DeleteReturnReason - summary: Delete a Return Reason - description: Deletes a return reason. + operationId: DeleteStoreCurrenciesCode + summary: Delete a Currency Code + description: Removes a Currency Code from the available currencies. x-authenticated: true parameters: - in: path - name: id + name: code required: true - description: The ID of the return reason + description: The 3 character ISO currency code. schema: type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -18285,42 +18095,33 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.delete(return_reason_id) + medusa.admin.store.deleteCurrency('eur') - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ store }) => { + console.log(store.id); }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/return-reasons/{id}' \ + 'https://medusa-url.com/admin/store/currencies/eur' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted return reason - object: - type: string - description: The type of the object that was deleted. - default: return_reason - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + store: + $ref: '#/components/schemas/store' '400': $ref: '#/components/responses/400_error' '401': @@ -18333,18 +18134,12 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /store: get: - operationId: GetReturnReasonsReason - summary: Get a Return Reason - description: Retrieves a Return Reason. + operationId: GetStore + summary: Get Store details + description: Retrieves the Store details x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Return Reason. - schema: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -18356,23 +18151,21 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.retrieve(return_reason_id) + medusa.admin.store.retrieve() - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ store }) => { + console.log(store.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/return-reasons/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/store' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Store responses: '200': description: OK @@ -18381,8 +18174,8 @@ paths: schema: type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + store: + $ref: '#/components/schemas/store' '400': $ref: '#/components/responses/400_error' '401': @@ -18396,34 +18189,45 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostReturnReasonsReason - summary: Update a Return Reason - description: Updates a Return Reason + operationId: PostStore + summary: Update Store Details + description: Updates the Store details x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Return Reason. - schema: - type: string requestBody: content: application/json: schema: type: object properties: - label: - description: The label to display to the Customer. + name: + description: The name of the Store type: string - value: + swap_link_template: description: >- - The value that the Return Reason will be identified by. Must - be unique. + A template for Swap links - use `{{cart_id}}` to insert the + Swap Cart id type: string - description: - description: An optional description to for the Reason. + payment_link_template: + description: >- + A template for payment links links - use `{{cart_id}}` to + insert the Cart id + type: string + invite_link_template: + description: >- + A template for invite links - use `{{invite_token}}` to + insert the invite token type: string + default_currency_code: + description: The default currency code for the Store. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currencies: + description: Array of currencies in 2 character ISO code format. + type: array + items: + type: string metadata: description: >- An optional set of key-value pairs with additional @@ -18440,31 +18244,31 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.update(return_reason_id, { - label: 'Damaged' + medusa.admin.store.update({ + name: 'Medusa Store' }) - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ store }) => { + console.log(store.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons/{id}' \ + curl --location --request POST 'https://medusa-url.com/admin/store' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "label": "Damaged" + "name": "Medusa Store" }' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Store responses: '200': description: OK @@ -18473,8 +18277,8 @@ paths: schema: type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + store: + $ref: '#/components/schemas/store' '400': $ref: '#/components/responses/400_error' '401': @@ -18487,22 +18291,12 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/store/currencies/{code}': - post: - operationId: PostStoreCurrenciesCode - summary: Add a Currency Code - description: Adds a Currency Code to the available currencies. + /store/payment-providers: + get: + operationId: GetStorePaymentProviders + summary: List Payment Providers + description: Retrieves the configured Payment Providers x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The 3 character ISO currency code. - schema: - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -18514,16 +18308,16 @@ paths: // must be previously logged in or use api token - medusa.admin.store.addCurrency('eur') + medusa.admin.store.listPaymentProviders() - .then(({ store }) => { - console.log(store.id); + .then(({ payment_providers }) => { + console.log(payment_providers.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/store/currencies/eur' \ + curl --location --request GET + 'https://medusa-url.com/admin/store/payment-providers' \ --header 'Authorization: Bearer {api_token}' security: @@ -18539,8 +18333,10 @@ paths: schema: type: object properties: - store: - $ref: '#/components/schemas/store' + payment_providers: + type: array + items: + $ref: '#/components/schemas/payment_provider' '400': $ref: '#/components/responses/400_error' '401': @@ -18553,21 +18349,12 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteStoreCurrenciesCode - summary: Delete a Currency Code - description: Removes a Currency Code from the available currencies. + /store/tax-providers: + get: + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The 3 character ISO currency code. - schema: - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. x-codeSamples: - lang: JavaScript label: JS Client @@ -18579,23 +18366,177 @@ paths: // must be previously logged in or use api token - medusa.admin.store.deleteCurrency('eur') + medusa.admin.store.listTaxProviders() + + .then(({ tax_providers }) => { + console.log(tax_providers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/tax-providers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + tax_providers: + type: array + items: + $ref: '#/components/schemas/tax_provider' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-options: + post: + operationId: PostShippingOptions + summary: Create Shipping Option + description: Creates a Shipping Option + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: >- + The ID of the Region in which the Shipping Option will be + available. + type: string + provider_id: + description: >- + The ID of the Fulfillment Provider that handles the Shipping + Option. + type: string + profile_id: + description: >- + The ID of the Shipping Profile to add the Shipping Option + to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle + shipping with this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping + Option to be available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + default: false + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' + }) - .then(({ store }) => { - console.log(store.id); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/store/currencies/eur' \ + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" + }' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Shipping Option responses: '200': description: OK @@ -18604,8 +18545,8 @@ paths: schema: type: object properties: - store: - $ref: '#/components/schemas/store' + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -18618,12 +18559,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /store: get: - operationId: GetStore - summary: Get Store details - description: Retrieves the Store details + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return + schema: + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options x-codeSamples: - lang: JavaScript label: JS Client @@ -18635,21 +18591,23 @@ paths: // must be previously logged in or use api token - medusa.admin.store.retrieve() + medusa.admin.shippingOptions.list() - .then(({ store }) => { - console.log(store.id); + .then(({ shipping_options, count }) => { + console.log(shipping_options.length); }); - lang: Shell label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/store' \ + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-options' \ + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Shipping Option responses: '200': description: OK @@ -18658,8 +18616,13 @@ paths: schema: type: object properties: - store: - $ref: '#/components/schemas/store' + shipping_options: + type: array + items: + $ref: '#/components/schemas/shipping_option' + count: + type: integer + description: The total number of items available '400': $ref: '#/components/responses/400_error' '401': @@ -18672,51 +18635,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostStore - summary: Update Store Details - description: Updates the Store details + '/shipping-options/{id}': + delete: + operationId: DeleteShippingOptionsOption + summary: Delete a Shipping Option + description: Deletes a Shipping Option. x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - A template for Swap links - use `{{cart_id}}` to insert the - Swap Cart id - type: string - payment_link_template: - description: >- - A template for payment links links - use `{{cart_id}}` to - insert the Cart id - type: string - invite_link_template: - description: >- - A template for invite links - use `{{invite_token}}` to - insert the invite token - type: string - default_currency_code: - description: The default currency code for the Store. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -18728,31 +18659,23 @@ paths: // must be previously logged in or use api token - medusa.admin.store.update({ - name: 'Medusa Store' - }) + medusa.admin.shippingOptions.delete(option_id) - .then(({ store }) => { - console.log(store.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST 'https://medusa-url.com/admin/store' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-options/{option_id}' \ - --data-raw '{ - "name": "Medusa Store" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Shipping Option responses: '200': description: OK @@ -18761,8 +18684,17 @@ paths: schema: type: object properties: - store: - $ref: '#/components/schemas/store' + id: + type: string + description: The ID of the deleted Shipping Option. + object: + type: string + description: The type of the object that was deleted. + default: shipping-option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -18775,12 +18707,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /store/payment-providers: get: - operationId: GetStorePaymentProviders - summary: List Payment Providers - description: Retrieves the configured Payment Providers + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -18792,23 +18730,23 @@ paths: // must be previously logged in or use api token - medusa.admin.store.listPaymentProviders() + medusa.admin.shippingOptions.retrieve(option_id) - .then(({ payment_providers }) => { - console.log(payment_providers.length); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/store/payment-providers' \ + 'https://medusa-url.com/admin/shipping-options/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Shipping Option responses: '200': description: OK @@ -18817,10 +18755,8 @@ paths: schema: type: object properties: - payment_providers: - type: array - items: - $ref: '#/components/schemas/payment_provider' + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -18833,12 +18769,65 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /store/tax-providers: - get: - operationId: GetStoreTaxProviders - summary: List Tax Providers - description: Retrieves the configured Tax Providers + post: + operationId: PostShippingOptionsOption + summary: Update Shipping Option + description: Updates a Shipping Option x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + requirements: + description: >- + The requirements that must be satisfied for the Shipping + Option to be available. + type: array + items: + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -18850,23 +18839,43 @@ paths: // must be previously logged in or use api token - medusa.admin.store.listTaxProviders() + medusa.admin.shippingOptions.update(option_id, { + name: 'PostFake', + requirements: [ + { + id, + type: 'max_subtotal', + amount: 1000 + } + ] + }) - .then(({ tax_providers }) => { - console.log(tax_providers.length); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/store/tax-providers' \ + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "requirements": [ + { + "type": "max_subtotal", + "amount": 1000 + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Shipping Option responses: '200': description: OK @@ -18875,10 +18884,8 @@ paths: schema: type: object properties: - tax_providers: - type: array - items: - $ref: '#/components/schemas/tax_provider' + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -20129,197 +20136,41 @@ paths: x-authenticated: true requestBody: content: - application/json: - schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.taxRates.update(tax_rate_id, { - name: 'New Tax Rate' - }) - - .then(({ tax_rate }) => { - console.log(tax_rate.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "New Tax Rate" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Tax Rate - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - tax_rate: - $ref: '#/components/schemas/tax_rate' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /variants: - get: - operationId: GetVariants - summary: List Product Variants - description: Retrieves a list of Product Variants - x-authenticated: true - parameters: - - in: query - name: id - description: A Product Variant id to filter by. - schema: - type: string - - in: query - name: ids - description: A comma separated list of Product Variant ids to filter by. - schema: - type: string - - in: query - name: expand - description: A comma separated list of Product Variant relations to load. - schema: - type: string - - in: query - name: fields - description: A comma separated list of Product Variant fields to include. - schema: - type: string - - in: query - name: offset - description: How many product variants to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Maximum number of Product Variants to return. - schema: - type: number - default: '100' - - in: query - name: cart_id - description: The id of the cart to use for price selection. - schema: - type: string - - in: query - name: region_id - description: The id of the region to use for price selection. - schema: - type: string - - in: query - name: currency_code - description: The currency code to use for price selection. - schema: - type: string - - in: query - name: customer_id - description: The id of the customer to use for price selection. - schema: - type: string - - in: query - name: title - style: form - explode: false - description: product variant title to search for. - schema: - oneOf: - - type: string - description: a single title to search by - - type: array - description: multiple titles to search by - items: + application/json: + schema: + type: object + properties: + code: type: string - - in: query - name: inventory_quantity - description: Filter by available inventory quantity - schema: - oneOf: - - type: number - description: a specific number to search by. - - type: object - description: search 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 + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: >- + The IDs of the shipping options associated with this tax + rate + items: + type: string + product_types: + type: array + description: >- + The IDs of the types of products associated with this tax + rate + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -20331,23 +20182,31 @@ paths: // must be previously logged in or use api token - medusa.admin.variants.list() + medusa.admin.taxRates.update(tax_rate_id, { + name: 'New Tax Rate' + }) - .then(({ variants, limit, offset, count }) => { - console.log(variants.length); + .then(({ tax_rate }) => { + console.log(tax_rate.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/variants' \ + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Tax Rate" + }' security: - api_token: [] - cookie_auth: [] tags: - - Product Variant + - Tax Rate responses: '200': description: OK @@ -20356,19 +20215,8 @@ paths: schema: type: object properties: - variants: - type: array - items: - $ref: '#/components/schemas/product_variant' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + tax_rate: + $ref: '#/components/schemas/tax_rate' '400': $ref: '#/components/responses/400_error' '401': @@ -21082,6 +20930,165 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /variants: + get: + operationId: GetVariants + summary: List Product Variants + description: Retrieves a list of Product Variants + x-authenticated: true + parameters: + - in: query + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.variants.list() + + .then(({ variants, limit, offset, count }) => { + console.log(variants.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/variants' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/product_variant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' components: responses: default_error: diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 2f6475989bfaf..f715e780afd71 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -202,115 +202,6 @@ tags: servers: - url: 'https://api.medusa-commerce.com/admin' paths: - /apps/authorizations: - post: - operationId: PostApps - summary: Generate Token for App - description: Generates a token for an application. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - application_name - - state - - code - properties: - application_name: - type: string - description: Name of the application for the token to be generated for. - state: - type: string - description: State of the application. - code: - type: string - description: The code for the generated token. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "application_name": "example", - "state": "ready", - "code": "token" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps: - get: - operationId: GetApps - summary: List Applications - description: Retrieve a list of applications. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/apps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - type: array - items: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /auth: post: operationId: PostAuth @@ -1219,17 +1110,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}/customers/batch': + '/collections/{id}/products/batch': post: - operationId: PostCustomerGroupsGroupCustomersBatch - summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Collection. schema: type: string requestBody: @@ -1238,63 +1129,35 @@ paths: schema: type: object required: - - customer_ids + - product_ids properties: - customer_ids: - description: The ids of the customers to add + product_ids: + description: An array of Product IDs to add to the Product Collection. type: array items: - required: - - id - properties: - id: - description: ID of the customer - type: string + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.addCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" ] }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1303,8 +1166,8 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -1318,15 +1181,15 @@ paths: '500': $ref: '#/components/responses/500_error' delete: - operationId: DeleteCustomerGroupsGroupCustomerBatch - summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Collection. schema: type: string requestBody: @@ -1335,63 +1198,37 @@ paths: schema: type: object required: - - customer_ids + - product_ids properties: - customer_ids: - description: The ids of the customers to remove + product_ids: + description: >- + An array of Product IDs to remove from the Product + Collection. type: array items: - required: - - id - properties: - id: - description: ID of the customer - type: string + description: The ID of a Product to add to the Product Collection. + type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.removeCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" ] }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1400,8 +1237,19 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string '400': $ref: '#/components/responses/400_error' '401': @@ -1414,49 +1262,69 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customer-groups: + /collections: post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. x-authenticated: true - parameters: [] - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.create({ - name: 'VIP' + medusa.admin.collections.create({ + title: 'New Collection' }) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "VIP" + "title": "New Collection" }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1465,8 +1333,8 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -1479,88 +1347,49 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. get: - operationId: GetCustomerGroups - summary: List Customer Groups - description: Retrieve a list of customer groups. + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. x-authenticated: true parameters: - in: query - name: q - description: Query used for searching customer group names. + name: limit + description: The number of collections to return. schema: - type: string + type: integer + default: 10 - in: query name: offset - description: How many groups to skip in the result. + description: The number of collections to skip before the results. schema: type: integer default: 0 - in: query - name: order - description: the field used to order the customer groups. + name: title + description: The title of collections to return. schema: type: string - in: query - name: discount_condition_id - description: The discount condition id on which to filter the customer groups. + name: handle + description: The handle of collections to return. schema: type: string - in: query - name: id - style: form - explode: false - description: Filter by the customer group ID + name: q + description: a search term to search titles and handles. schema: - oneOf: - - type: string - description: customer group ID - - type: array - description: multiple customer group IDs - items: - type: string - - type: object - properties: - lt: - type: string - description: filter by IDs less than this ID - gt: - type: string - description: filter by IDs greater than this ID - lte: - type: string - description: filter by IDs less than or equal to this ID - gte: - type: string - description: filter by IDs greater than or equal to this ID + type: string - in: query - name: name - style: form - explode: false - description: Filter by the customer group name + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. schema: - type: array - description: multiple customer group names - items: - type: string - description: customer group name + type: string - in: query name: created_at - description: Date comparison for when resulting customer groups were created. + description: Date comparison for when resulting collections were created. schema: type: object properties: @@ -1582,7 +1411,7 @@ paths: format: date - in: query name: updated_at - description: Date comparison for when resulting customer groups were updated. + description: Date comparison for when resulting collections were updated. schema: type: object properties: @@ -1603,18 +1432,27 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: limit - description: Limit the number of customer groups returned. - schema: - type: integer - default: 10 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each customer - groups of the result. + name: deleted_at + description: Date comparison for when resulting collections were deleted. schema: - type: string + 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 @@ -1626,23 +1464,23 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.list() + medusa.admin.collections.list() - .then(({ customer_groups, limit, offset, count }) => { - console.log(customer_groups.length); + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/customer-groups' \ + 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1651,10 +1489,10 @@ paths: schema: type: object properties: - customer_groups: + collections: type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/product_collection' count: type: integer description: The total number of items available @@ -1676,17 +1514,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}': + '/collections/{id}': delete: - operationId: DeleteCustomerGroupsCustomerGroup - summary: Delete a Customer Group - description: Deletes a CustomerGroup. + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer Group + description: The ID of the Collection. schema: type: string x-codeSamples: @@ -1700,7 +1538,7 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.delete(customer_group_id) + medusa.admin.collections.delete(collection_id) .then(({ id, object, deleted }) => { console.log(id); @@ -1709,14 +1547,14 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1727,16 +1565,14 @@ paths: properties: id: type: string - description: The ID of the deleted customer group. + description: The ID of the deleted Collection object: type: string description: The type of the object that was deleted. - default: customer_group + default: product-collection deleted: type: boolean - description: >- - Whether the customer group was deleted successfully or - not. + description: Whether the collection was deleted successfully or not. default: true '400': $ref: '#/components/responses/400_error' @@ -1751,29 +1587,15 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetCustomerGroupsGroup - summary: Get a Customer Group - description: Retrieves a Customer Group. + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Customer Group. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in the customer - group. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in the customer - group. + description: The ID of the Product Collection schema: type: string x-codeSamples: @@ -1787,23 +1609,23 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.retrieve(customer_group_id) + medusa.admin.collections.retrieve(collection_id) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1812,8 +1634,8 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -1827,15 +1649,15 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostCustomerGroupsGroup - summary: Update a Customer Group - description: Update a CustomerGroup. + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the customer group. + description: The ID of the Collection. schema: type: string requestBody: @@ -1844,11 +1666,18 @@ paths: schema: type: object properties: - name: - description: Name of the customer group + title: + type: string + description: The title to identify the Collection by. + handle: type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. metadata: - description: Metadata for the customer. + description: >- + An optional set of key-value pairs to hold additional + information. type: object x-codeSamples: - lang: JavaScript @@ -1861,31 +1690,31 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.update(customer_group_id, { - name: 'VIP' + medusa.admin.collections.update(collection_id, { + title: 'New Collection' }) - .then(({ customer_group }) => { - console.log(customer_group.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}' \ + 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "VIP" + "title": "New Collection" }' security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Collection responses: '200': description: OK @@ -1894,8 +1723,8 @@ paths: schema: type: object properties: - customer_group: - $ref: '#/components/schemas/customer_group' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '401': @@ -1908,11 +1737,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}/customers': - get: - operationId: GetCustomerGroupsGroupCustomers - summary: List Customers - description: Retrieves a list of customers in a customer group + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: 'Adds a list of customers, represented by id''s, to a customer group.' x-authenticated: true parameters: - in: path @@ -1921,6 +1750,24 @@ paths: description: The ID of the customer group. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1932,18 +1779,35 @@ paths: // must be previously logged in or use api token - medusa.admin.customerGroups.listCustomers(customer_group_id) + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) - .then(({ customers }) => { - console.log(customers.length); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' security: - api_token: [] - cookie_auth: [] @@ -1957,19 +1821,8 @@ paths: schema: type: object properties: - customers: - type: array - items: - $ref: '#/components/schemas/customer' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -1982,17 +1835,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': - post: - operationId: PostProductsToCollection - summary: Update Products - description: Updates products associated with a Product Collection + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: 'Removes a list of customers, represented by id''s, from a customer group.' x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the customer group. schema: type: string requestBody: @@ -2001,35 +1853,63 @@ paths: schema: type: object required: - - product_ids + - customer_ids properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. + customer_ids: + description: The ids of the customers to remove type: array items: - description: The ID of a Product to add to the Product Collection. - type: string + required: + - id + properties: + id: + description: ID of the customer + type: string x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } ] }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK @@ -2038,8 +1918,8 @@ paths: schema: type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -2052,55 +1932,49 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteProductsFromCollection - summary: Remove Product - description: Removes products associated with a Product Collection + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + parameters: [] x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] + "name": "VIP" }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK @@ -2109,19 +1983,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -2134,134 +1997,88 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /collections: - post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. - x-authenticated: true requestBody: content: application/json: schema: type: object required: - - title + - name properties: - title: - type: string - description: The title to identify the Collection by. - handle: + name: type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. + description: Name of the customer group metadata: - description: >- - An optional set of key-value pairs to hold additional - information. type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.create({ - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "New Collection" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' + description: Metadata for the customer. get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. x-authenticated: true parameters: - in: query - name: limit - description: The number of collections to return. + name: q + description: Query used for searching customer group names. schema: - type: integer - default: 10 + type: string - in: query name: offset - description: The number of collections to skip before the results. + description: How many groups to skip in the result. schema: type: integer default: 0 - in: query - name: title - description: The title of collections to return. + name: order + description: the field used to order the customer groups. schema: type: string - in: query - name: handle - description: The handle of collections to return. + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. schema: type: string - in: query - name: q - description: a search term to search titles and handles. + name: id + style: form + explode: false + description: Filter by the customer group ID schema: - type: string + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID - in: query - name: discount_condition_id - description: >- - The discount condition id on which to filter the product - collections. + name: name + style: form + explode: false + description: Filter by the customer group name schema: - type: string + type: array + description: multiple customer group names + items: + type: string + description: customer group name - in: query name: created_at - description: Date comparison for when resulting collections were created. + description: Date comparison for when resulting customer groups were created. schema: type: object properties: @@ -2283,7 +2100,7 @@ paths: format: date - in: query name: updated_at - description: Date comparison for when resulting collections were updated. + description: Date comparison for when resulting customer groups were updated. schema: type: object properties: @@ -2304,27 +2121,18 @@ paths: description: filter by dates greater than or equal to this date format: date - in: query - name: deleted_at - description: Date comparison for when resulting collections were deleted. + name: limit + description: Limit the number of customer groups returned. 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 + type: integer + default: 10 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -2336,23 +2144,23 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.list() + medusa.admin.customerGroups.list() - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/collections' \ + 'https://medusa-url.com/admin/customer-groups' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK @@ -2361,10 +2169,10 @@ paths: schema: type: object properties: - collections: + customer_groups: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/customer_group' count: type: integer description: The total number of items available @@ -2386,17 +2194,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}': + '/customer-groups/{id}': delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the Customer Group schema: type: string x-codeSamples: @@ -2410,7 +2218,7 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.delete(collection_id) + medusa.admin.customerGroups.delete(customer_group_id) .then(({ id, object, deleted }) => { console.log(id); @@ -2419,14 +2227,14 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK @@ -2437,14 +2245,16 @@ paths: properties: id: type: string - description: The ID of the deleted Collection + description: The ID of the deleted customer group. object: type: string description: The type of the object that was deleted. - default: product-collection + default: customer_group deleted: type: boolean - description: Whether the collection was deleted successfully or not. + description: >- + Whether the customer group was deleted successfully or + not. default: true '400': $ref: '#/components/responses/400_error' @@ -2459,15 +2269,29 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Product Collection + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the customer + group. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the customer + group. schema: type: string x-codeSamples: @@ -2481,23 +2305,23 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.retrieve(collection_id) + medusa.admin.customerGroups.retrieve(customer_group_id) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK @@ -2506,8 +2330,8 @@ paths: schema: type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' '400': $ref: '#/components/responses/400_error' '401': @@ -2521,15 +2345,15 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostCollectionsCollection - summary: Update a Collection - description: Updates a Product Collection. + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Collection. + description: The ID of the customer group. schema: type: string requestBody: @@ -2538,18 +2362,11 @@ paths: schema: type: object properties: - title: - type: string - description: The title to identify the Collection by. - handle: + name: + description: Name of the customer group type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. metadata: - description: >- - An optional set of key-value pairs to hold additional - information. + description: Metadata for the customer. type: object x-codeSamples: - lang: JavaScript @@ -2562,31 +2379,31 @@ paths: // must be previously logged in or use api token - medusa.admin.collections.update(collection_id, { - title: 'New Collection' + medusa.admin.customerGroups.update(customer_group_id, { + name: 'VIP' }) - .then(({ collection }) => { - console.log(collection.id); + .then(({ customer_group }) => { + console.log(customer_group.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ + 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "title": "New Collection" + "name": "VIP" }' security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Customer Group responses: '200': description: OK @@ -2595,8 +2412,191 @@ paths: schema: type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + customer_group: + $ref: '#/components/schemas/customer_group' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customer-groups/{id}/customers': + get: + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.listCustomers(customer_group_id) + + .then(({ customers }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customers: + type: array + items: + $ref: '#/components/schemas/customer' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps/authorizations: + post: + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - application_name + - state + - code + properties: + application_name: + type: string + description: Name of the application for the token to be generated for. + state: + type: string + description: State of the application. + code: + type: string + description: The code for the generated token. + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/apps/authorizations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' '400': $ref: '#/components/responses/400_error' '401': @@ -2992,95 +2992,116 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/regions/{region_id}': + /draft-orders: post: - operationId: PostDiscountsDiscountRegionsRegion - summary: Add Region - description: Adds a Region to the list of Regions that a Discount can be used in. + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Discount. - schema: - type: string - - in: path - name: region_id - required: true - description: The ID of the Region. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.discounts.addRegion(discount_id, region_id) - - .then(({ discount }) => { - console.log(discount.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - discount: - $ref: '#/components/schemas/discount' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - delete: - operationId: DeleteDiscountsDiscountRegionsRegion - summary: Remove Region - x-authenticated: true - description: >- - Removes a Region from the list of Regions that a Discount can be used - in. - parameters: - - in: path - name: id - required: true - description: The ID of the Discount. - schema: - type: string - - in: path - name: region_id - required: true - description: The ID of the Region. - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - items + - region_id + - shipping_methods + properties: + status: + description: The status of the draft order + type: string + enum: + - open + - completed + email: + description: The email of the customer of the draft order + type: string + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - quantity + properties: + variant_id: + description: >- + The ID of the Product Variant to generate the Line + Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details + about the Line Item. + type: object + region_id: + description: The ID of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order + type: array + items: + type: object + required: + - code + properties: + code: + description: The code of the discount to apply + type: string + customer_id: + description: The ID of the customer to add on the draft order + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine + use of notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + type: object + required: + - option_id + properties: + option_id: + description: The ID of the shipping option in use + type: string + data: + description: >- + The optional additional data needed for the shipping + method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Draft Order. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -3092,23 +3113,53 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.removeRegion(discount_id, region_id) + medusa.admin.draftOrders.create({ + email: 'user@example.com', + region_id, + items: [ + { + quantity: 1 + } + ], + shipping_methods: [ + { + option_id + } + ], + }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "region_id": "{region_id}" + "items": [ + { + "quantity": 1 + } + ], + "shipping_methods": [ + { + "option_id": "{option_id}" + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK @@ -3117,8 +3168,8 @@ paths: schema: type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3131,57 +3182,31 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{discount_id}/conditions/{condition_id}/batch': - post: - operationId: PostDiscountsDiscountConditionsConditionBatch - summary: Add a batch of resources to a discount condition - description: Add a batch of resources to a discount condition. + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders x-authenticated: true parameters: - - in: path - name: discount_id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: condition_id - required: true - description: The ID of the condition on which to add the item. + - in: query + name: offset + description: The number of items to skip before the results. schema: - type: string + type: number + default: '0' - in: query - name: expand - description: >- - (Comma separated) Which relations should be expanded in each - discount of the result. + name: limit + description: Limit the number of items returned. schema: - type: string + type: number + default: '50' - in: query - name: fields + name: q description: >- - (Comma separated) Which fields should be included in each discount - of the result. + a search term to search emails in carts associated with draft orders + and display IDs of draft orders schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3193,33 +3218,23 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.addConditionResourceBatch(discount_id, - condition_id, { - resources: [{ id: item_id }] - }) + medusa.admin.draftOrders.list() - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_orders, limit, offset, count }) => { + console.log(draft_orders.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders' \ - --data-raw '{ - "resources": [{ "id": "item_id" }] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK @@ -3228,8 +3243,19 @@ paths: schema: type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_orders: + type: array + items: + $ref: '#/components/schemas/draft-order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -3242,36 +3268,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - delete: - operationId: DeleteDiscountsDiscountConditionsConditionBatch - summary: Delete a batch of resources from a discount condition - description: Delete a batch of resources from a discount condition. + '/draft-orders/{id}/line-items': + post: + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item + description: Creates a Line Item for the Draft Order x-authenticated: true parameters: - in: path - name: discount_id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: condition_id + name: id required: true - description: The ID of the condition on which to add the item. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which relations should be expanded in each - discount of the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each discount - of the result. + description: The ID of the Draft Order. schema: type: string requestBody: @@ -3280,18 +3287,28 @@ paths: schema: type: object required: - - resources + - quantity properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + variant_id: + description: >- + The ID of the Product Variant to generate the Line Item + from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + default: Custom item + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -3303,33 +3320,31 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.deleteConditionResourceBatch(discount_id, - condition_id, { - resources: [{ id: item_id }] + medusa.admin.draftOrders.addLineItem(draft_order_id, { + quantity: 1 }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' - \ + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "resources": [{ "id": "item_id" }] + "quantity": 1 }' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK @@ -3338,8 +3353,8 @@ paths: schema: type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3352,121 +3367,47 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{discount_id}/conditions': - post: - operationId: PostDiscountsDiscountConditions - summary: Create a Condition - description: >- - Creates a DiscountCondition. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` should be - provided. + '/draft-orders/{id}': + delete: + operationId: DeleteDraftOrdersDraftOrder + summary: Delete a Draft Order + description: Deletes a Draft Order x-authenticated: true parameters: - in: path - name: discount_id + name: id required: true - description: The ID of the Product. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + description: The ID of the Draft Order. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" - import { DiscountConditionOperator } from "@medusajs/medusa" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.createCondition(discount_id, { - operator: DiscountConditionOperator.IN - }) + medusa.admin.draftOrders.delete(draft_order_id) - .then(({ discount }) => { - console.log(discount.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}' \ - --data-raw '{ - "operator": "in" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK @@ -3475,8 +3416,17 @@ paths: schema: type: object properties: - discount: - $ref: '#/components/schemas/discount' + id: + type: string + description: The ID of the deleted Draft Order. + object: + type: string + description: The type of the object that was deleted. + default: draft-order + deleted: + type: boolean + description: Whether the draft order was deleted successfully or not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -3489,219 +3439,46 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /discounts: - post: - operationId: PostDiscounts - summary: Creates a Discount + get: + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. x-authenticated: true - description: >- - Creates a Discount with a given set of rules that define how the - Discount behaves. parameters: - - in: query - name: expand - description: (Comma separated) Which fields should be expanded in each customer. - schema: - type: string - - in: query - name: fields - description: (Comma separated) Which fields should be retrieved in each customer. + - in: path + name: id + required: true + description: The ID of the Draft Order. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts - that reduce the price by a fixed amount, `percentage` - for percentage reductions or `free_shipping` for - shipping vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" - import { AllocationType, DiscountRuleType } from "@medusajs/medusa" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.create({ - code: 'TEST', - rule: { - type: DiscountRuleType.FIXED, - value: 10, - allocation: AllocationType.ITEM - }, - regions: ['reg_XXXXXXXX'], - is_dynamic: false, - is_disabled: false - }) + medusa.admin.draftOrders.retrieve(draft_order_id) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders/{id}' \ - --data-raw '{ - "code": "TEST", - "rule": { - "type": "fixed", - "value": 10, - "allocation": "item" - }, - "regions": ['reg_XXXXXXXX'] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK @@ -3710,8 +3487,8 @@ paths: schema: type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3724,67 +3501,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetDiscounts - summary: List Discounts + '/draft-orders/{id}/line-items/{line_id}': + delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. x-authenticated: true - description: Retrieves a list of Discounts parameters: - - in: query - name: q - description: Search query applied on the code field. + - in: path + name: id + required: true + description: The ID of the Draft Order. schema: type: string - - in: query - name: rule - description: Discount Rules filters to apply on the search - schema: - type: object - properties: - type: - type: string - enum: - - fixed - - percentage - - free_shipping - description: >- - The type of the Discount, can be `fixed` for discounts that - reduce the price by a fixed amount, `percentage` for - percentage reductions or `free_shipping` for shipping - vouchers. - allocation: - type: string - enum: - - total - - item - description: >- - The value that the discount represents; this will depend on - the type of the discount - - in: query - name: is_dynamic - description: Return only dynamic discounts. - schema: - type: boolean - - in: query - name: is_disabled - description: Return only disabled discounts. - schema: - type: boolean - - in: query - name: limit - description: The number of items in the response - schema: - type: number - default: '20' - - in: query - name: offset - description: The offset of items in response - schema: - type: number - default: '0' - - in: query - name: expand - description: Comma separated list of relations to include in the results. + - in: path + name: line_id + required: true + description: The ID of the Draft Order. schema: type: string x-codeSamples: @@ -3798,23 +3531,24 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.list() + medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) - .then(({ discounts, limit, offset, count }) => { - console.log(discounts.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK @@ -3823,19 +3557,8 @@ paths: schema: type: object properties: - discounts: - type: array - items: - $ref: '#/components/schemas/discount' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3848,22 +3571,44 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/dynamic-codes': post: - operationId: PostDiscountsDiscountDynamicCodes - summary: Create a Dynamic Code - description: >- - Creates a dynamic unique code that can map to a parent Discount. This is - useful if you want to automatically generate codes with the same - behaviour. + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item + description: Updates a Line Item for a Draft Order x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Discount to create the dynamic code from." + description: The ID of the Draft Order. + 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: + type: object + properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -3875,32 +3620,32 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.createDynamicCode(discount_id, { - code: 'TEST', - usage_limit: 1 + medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + quantity: 1 }) - .then(({ discount }) => { - console.log(discount.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "code": "TEST" + "quantity": 1 }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Draft Order responses: '200': description: OK @@ -3909,8 +3654,8 @@ paths: schema: type: object properties: - discount: - $ref: '#/components/schemas/discount' + draft_order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -3923,53 +3668,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - code - properties: - code: - type: string - description: The unique code that will be used to redeem the Discount. - usage_limit: - type: number - default: '1' - description: amount of times the discount can be applied. - metadata: - type: object - description: >- - An optional set of key-value paris to hold additional - information. - '/discounts/{discount_id}/conditions/{condition_id}': - delete: - operationId: DeleteDiscountsDiscountConditionsCondition - summary: Delete a Condition - description: Deletes a DiscountCondition + '/draft-orders/{id}/pay': + post: + summary: Registers a Payment + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. x-authenticated: true parameters: - in: path - name: discount_id - required: true - description: The ID of the Discount - schema: - type: string - - in: path - name: condition_id + name: id required: true - description: The ID of the DiscountCondition - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The Draft Order id. schema: type: string x-codeSamples: @@ -3983,24 +3692,23 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.deleteCondition(discount_id, condition_id) + medusa.admin.draftOrders.markPaid(draft_order_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' - \ + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK @@ -4009,22 +3717,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted DiscountCondition - object: - type: string - description: The type of the object that was deleted. - default: discount-condition - deleted: - type: boolean - description: >- - Whether the discount condition was deleted successfully or - not. - default: true - discount: - description: The Discount to which the condition used to belong - $ref: '#/components/schemas/discount' + order: + $ref: '#/components/schemas/draft-order' '400': $ref: '#/components/responses/400_error' '401': @@ -4037,34 +3731,68 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetDiscountsDiscountConditionsCondition - summary: Get a Condition - description: Gets a DiscountCondition + '/admin/draft-orders/{id}': + post: + operationId: PostDraftOrdersDraftOrder + summary: Update a Draft Order + description: Updates a Draft Order. x-authenticated: true parameters: - in: path - name: discount_id - required: true - description: The ID of the Discount. - schema: - type: string - - in: path - name: condition_id + name: id required: true - description: The ID of the DiscountCondition. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The ID of the Draft Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Draft Order in. + country_code: + type: string + description: The 2 character ISO code for the Country. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Draft Order. + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string + discounts: + description: An array of Discount codes to add to the Draft Order. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine + use of notifications. + type: boolean + customer_id: + description: The ID of the Customer to associate the Draft Order with. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -4076,24 +3804,31 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.getCondition(discount_id, condition_id) + medusa.admin.draftOrders.update(draft_order_id, { + email: "user@example.com" + }) - .then(({ discount_condition }) => { - console.log(discount_condition.id); + .then(({ draft_order }) => { + console.log(draft_order.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' - \ + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Draft Order responses: '200': description: OK @@ -4102,9 +3837,9 @@ paths: schema: type: object properties: - discount_condition: - $ref: '#/components/schemas/discount_condition' - '400': + draft_order: + $ref: '#/components/schemas/draft-order' + '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' @@ -4116,80 +3851,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/discounts/{id}/regions/{region_id}': post: - operationId: PostDiscountsDiscountConditionsCondition - summary: Update a Condition - description: >- - Updates a DiscountCondition. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` should be - provided. + operationId: PostDiscountsDiscountRegionsRegion + summary: Add Region + description: Adds a Region to the list of Regions that a Discount can be used in. x-authenticated: true parameters: - in: path - name: discount_id + name: id required: true - description: The ID of the Product. + description: The ID of the Discount. schema: type: string - in: path - name: condition_id + name: region_id required: true - description: The ID of the DiscountCondition. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each item of - the result. + description: The ID of the Region. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -4201,11 +3881,7 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.updateCondition(discount_id, condition_id, { - products: [ - product_id - ] - }) + medusa.admin.discounts.addRegion(discount_id, region_id) .then(({ discount }) => { console.log(discount.id); @@ -4214,18 +3890,9 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ - --data-raw '{ - "products": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -4253,17 +3920,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}': delete: - operationId: DeleteDiscountsDiscount - summary: Delete a Discount - description: Deletes a Discount. + operationId: DeleteDiscountsDiscountRegionsRegion + summary: Remove Region x-authenticated: true + description: >- + Removes a Region from the list of Regions that a Discount can be used + in. parameters: - in: path name: id required: true - description: The ID of the Discount + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. schema: type: string x-codeSamples: @@ -4277,16 +3951,16 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.delete(discount_id) + medusa.admin.discounts.removeRegion(discount_id, region_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}' \ + 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -4302,17 +3976,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted Discount - object: - type: string - description: The type of the object that was deleted. - default: discount - deleted: - type: boolean - description: Whether the discount was deleted successfully or not. - default: true + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4325,28 +3990,57 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetDiscountsDiscount - summary: Get a Discount - description: Retrieves a Discount + '/discounts/{discount_id}/conditions/{condition_id}/batch': + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add a batch of resources to a discount condition + description: Add a batch of resources to a discount condition. x-authenticated: true parameters: - in: path - name: id + name: discount_id required: true - description: The ID of the Discount + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. schema: type: string - in: query name: expand - description: Comma separated list of relations to include in the results. + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. schema: type: string - in: query name: fields - description: Comma separated list of fields to include in the results. + description: >- + (Comma separated) Which fields should be included in each discount + of the result. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -4358,7 +4052,10 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.retrieve(discount_id) + medusa.admin.discounts.addConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) .then(({ discount }) => { console.log(discount.id); @@ -4366,15 +4063,22 @@ paths: - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discount Condition responses: '200': description: OK @@ -4397,32 +4101,36 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostDiscountsDiscount - summary: Update a Discount - description: >- - Updates a Discount with a given set of rules that define how the - Discount behaves. + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete a batch of resources from a discount condition + description: Delete a batch of resources from a discount condition. x-authenticated: true parameters: - in: path - name: id + name: discount_id required: true - description: The ID of the Discount. + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. schema: type: string - in: query name: expand description: >- - (Comma separated) Which fields should be expanded in each item of - the result. + (Comma separated) Which relations should be expanded in each + discount of the result. schema: type: string - in: query name: fields description: >- - (Comma separated) Which fields should be included in each item of - the result. + (Comma separated) Which fields should be included in each discount + of the result. schema: type: string requestBody: @@ -4430,121 +4138,19 @@ paths: application/json: schema: type: object + required: + - resources properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - id - properties: - id: - type: string - description: The ID of the Rule - description: - type: string - description: A short description of the discount - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - id: - type: string - description: The ID of the Rule - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - usage_limit: - type: number - description: Maximum times the discount can be used - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. + resources: + description: The resources to be deleted from the discount condition type: array items: - type: string - metadata: - description: An object containing metadata of the discount - type: object + required: + - id + properties: + id: + description: The id of the item + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -4556,8 +4162,9 @@ paths: // must be previously logged in or use api token - medusa.admin.discounts.update(discount_id, { - code: 'TEST' + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] }) .then(({ discount }) => { @@ -4566,21 +4173,22 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "code": "TEST" + "resources": [{ "id": "item_id" }] }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discount Condition responses: '200': description: OK @@ -4603,37 +4211,99 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/dynamic-codes/{code}': - delete: - operationId: DeleteDiscountsDiscountDynamicCodesCode - summary: Delete a Dynamic Code - description: Deletes a dynamic code from a Discount. + '/discounts/{discount_id}/conditions': + post: + operationId: PostDiscountsDiscountConditions + summary: Create a Condition + description: >- + Creates a DiscountCondition. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. x-authenticated: true parameters: - in: path - name: id + name: discount_id required: true - description: The ID of the Discount + description: The ID of the Product. schema: type: string - - in: path - name: code - required: true - description: The ID of the Discount + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - operator + properties: + operator: + description: Operator of the condition + type: string + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client source: > import Medusa from "@medusajs/medusa-js" + import { DiscountConditionOperator } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.deleteDynamicCode(discount_id, code) + medusa.admin.discounts.createCondition(discount_id, { + operator: DiscountConditionOperator.IN + }) .then(({ discount }) => { console.log(discount.id); @@ -4641,15 +4311,21 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "operator": "in" + }' security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discount Condition responses: '200': description: OK @@ -4672,188 +4348,166 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/code/{code}': - get: - operationId: GetDiscountsDiscountCode - summary: Get Discount by Code - description: Retrieves a Discount by its discount code + /discounts: + post: + operationId: PostDiscounts + summary: Creates a Discount x-authenticated: true + description: >- + Creates a Discount with a given set of rules that define how the + Discount behaves. parameters: - - in: path - name: code - required: true - description: The code of the Discount - schema: - type: string - in: query name: expand - description: Comma separated list of relations to include in the results. + description: (Comma separated) Which fields should be expanded in each customer. schema: type: string - in: query name: fields - description: Comma separated list of fields to include in the results. + description: (Comma separated) Which fields should be retrieved in each customer. schema: type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.discounts.retrieveByCode(code) - - .then(({ discount }) => { - console.log(discount.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/code/{code}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - discount: - $ref: '#/components/schemas/discount' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /draft-orders: - post: - operationId: PostDraftOrders - summary: Create a Draft Order - description: Creates a Draft Order - x-authenticated: true requestBody: content: application/json: schema: type: object required: - - email - - items - - region_id - - shipping_methods + - code + - rule + - regions properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order + code: type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: boolean + description: >- + Whether the Discount should have multiple instances of + itself, each with a different code. This can be useful for + automatically generated codes that all have to follow a + common set of rules. + default: false + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - type + - value + - allocation + properties: + description: + type: string + description: A short description of the discount + type: + type: string + description: >- + The type of the Discount, can be `fixed` for discounts + that reduce the price by a fixed amount, `percentage` + for percentage reductions or `free_shipping` for + shipping vouchers. + enum: + - fixed + - percentage + - free_shipping + value: + type: number + description: >- + The value that the discount represents; this will depend + on the type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the + discount can be used. Only one of `products`, + `product_types`, `product_collections`, `product_tags`, + and `customer_groups` should be provided. + items: type: object - region_id: - description: The ID of the region for the draft order + required: + - operator + properties: + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is + applied on product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is + applied on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is + applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is + applied on customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will + have to enable it later to make it available to Customers. + default: false + starts_at: type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order + format: date-time + description: The time at which the Discount should be available. + ends_at: type: string - no_notification_order: + format: date-time description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order + The time at which the Discount should no longer be + available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + regions: + description: >- + A list of Region ids representing the Regions in which the + Discount can be used. type: array items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer + type: string + usage_limit: + type: number + description: Maximum times the discount can be used metadata: description: >- - The optional key-value map with additional details about the - Draft Order. + An optional set of key-value pairs to hold additional + information. type: object x-codeSamples: - lang: JavaScript @@ -4861,58 +4515,52 @@ paths: source: > import Medusa from "@medusajs/medusa-js" + import { AllocationType, DiscountRuleType } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.create({ - email: 'user@example.com', - region_id, - items: [ - { - quantity: 1 - } - ], - shipping_methods: [ - { - option_id - } - ], - }) - - .then(({ draft_order }) => { - console.log(draft_order.id); + medusa.admin.discounts.create({ + code: 'TEST', + rule: { + type: DiscountRuleType.FIXED, + value: 10, + allocation: AllocationType.ITEM + }, + regions: ['reg_XXXXXXXX'], + is_dynamic: false, + is_disabled: false + }) + + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/draft-orders' \ + 'https://medusa-url.com/admin/discounts' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com", - "region_id": "{region_id}" - "items": [ - { - "quantity": 1 - } - ], - "shipping_methods": [ - { - "option_id": "{option_id}" - } - ] + "code": "TEST", + "rule": { + "type": "fixed", + "value": 10, + "allocation": "item" + }, + "regions": ['reg_XXXXXXXX'] }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -4921,8 +4569,8 @@ paths: schema: type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4936,28 +4584,66 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetDraftOrders - summary: List Draft Orders - description: Retrieves an list of Draft Orders + operationId: GetDiscounts + summary: List Discounts x-authenticated: true + description: Retrieves a list of Discounts parameters: - in: query - name: offset - description: The number of items to skip before the results. + name: q + description: Search query applied on the code field. schema: - type: number - default: '0' + type: string + - in: query + name: rule + description: Discount Rules filters to apply on the search + schema: + type: object + properties: + type: + type: string + enum: + - fixed + - percentage + - free_shipping + description: >- + The type of the Discount, can be `fixed` for discounts that + reduce the price by a fixed amount, `percentage` for + percentage reductions or `free_shipping` for shipping + vouchers. + allocation: + type: string + enum: + - total + - item + description: >- + The value that the discount represents; this will depend on + the type of the discount + - in: query + name: is_dynamic + description: Return only dynamic discounts. + schema: + type: boolean + - in: query + name: is_disabled + description: Return only disabled discounts. + schema: + type: boolean - in: query name: limit - description: Limit the number of items returned. + description: The number of items in the response schema: type: number - default: '50' + default: '20' - in: query - name: q - description: >- - a search term to search emails in carts associated with draft orders - and display IDs of draft orders + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. schema: type: string x-codeSamples: @@ -4971,23 +4657,23 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.list() + medusa.admin.discounts.list() - .then(({ draft_orders, limit, offset, count }) => { - console.log(draft_orders.length); + .then(({ discounts, limit, offset, count }) => { + console.log(discounts.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/draft-orders' \ + 'https://medusa-url.com/admin/discounts' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -4996,10 +4682,10 @@ paths: schema: type: object properties: - draft_orders: + discounts: type: array items: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/discount' count: type: integer description: The total number of items available @@ -5021,47 +4707,22 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items': + '/discounts/{id}/dynamic-codes': post: - operationId: PostDraftOrdersDraftOrderLineItems - summary: Create a Line Item - description: Creates a Line Item for the Draft Order + operationId: PostDiscountsDiscountDynamicCodes + summary: Create a Dynamic Code + description: >- + Creates a dynamic unique code that can map to a parent Discount. This is + useful if you want to automatically generate codes with the same + behaviour. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Draft Order. + description: The ID of the Discount to create the dynamic code from." schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -5073,31 +4734,32 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.addLineItem(draft_order_id, { - quantity: 1 + medusa.admin.discounts.createDynamicCode(discount_id, { + code: 'TEST', + usage_limit: 1 }) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ + 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "quantity": 1 + "code": "TEST" }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -5106,8 +4768,8 @@ paths: schema: type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5120,17 +4782,53 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}': + requestBody: + content: + application/json: + schema: + type: object + required: + - code + properties: + code: + type: string + description: The unique code that will be used to redeem the Discount. + usage_limit: + type: number + default: '1' + description: amount of times the discount can be applied. + metadata: + type: object + description: >- + An optional set of key-value paris to hold additional + information. + '/discounts/{discount_id}/conditions/{condition_id}': delete: - operationId: DeleteDraftOrdersDraftOrder - summary: Delete a Draft Order - description: Deletes a Draft Order + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a Condition + description: Deletes a DiscountCondition x-authenticated: true parameters: - in: path - name: id + name: discount_id required: true - description: The ID of the Draft Order. + description: The ID of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -5144,7 +4842,7 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.delete(draft_order_id) + medusa.admin.discounts.deleteCondition(discount_id, condition_id) .then(({ id, object, deleted }) => { console.log(id); @@ -5153,14 +4851,15 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}' \ + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount Condition responses: '200': description: OK @@ -5171,15 +4870,20 @@ paths: properties: id: type: string - description: The ID of the deleted Draft Order. + description: The ID of the deleted DiscountCondition object: type: string description: The type of the object that was deleted. - default: draft-order + default: discount-condition deleted: type: boolean - description: Whether the draft order was deleted successfully or not. + description: >- + Whether the discount condition was deleted successfully or + not. default: true + discount: + description: The Discount to which the condition used to belong + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5193,15 +4897,31 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetDraftOrdersDraftOrder - summary: Get a Draft Order - description: Retrieves a Draft Order. + operationId: GetDiscountsDiscountConditionsCondition + summary: Get a Condition + description: Gets a DiscountCondition x-authenticated: true parameters: - in: path - name: id + name: discount_id required: true - description: The ID of the Draft Order. + description: The ID of the Discount. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -5215,23 +4935,24 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.retrieve(draft_order_id) + medusa.admin.discounts.getCondition(discount_id, condition_id) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ discount_condition }) => { + console.log(discount_condition.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/draft-orders/{id}' \ + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount Condition responses: '200': description: OK @@ -5240,8 +4961,8 @@ paths: schema: type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount_condition: + $ref: '#/components/schemas/discount_condition' '400': $ref: '#/components/responses/400_error' '401': @@ -5254,25 +4975,80 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items/{line_id}': - delete: - operationId: DeleteDraftOrdersDraftOrderLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Draft Order. + post: + operationId: PostDiscountsDiscountConditionsCondition + summary: Update a Condition + description: >- + Updates a DiscountCondition. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. x-authenticated: true parameters: - in: path - name: id + name: discount_id required: true - description: The ID of the Draft Order. + description: The ID of the Product. schema: type: string - in: path - name: line_id + name: condition_id required: true - description: The ID of the Draft Order. + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each item of + the result. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -5284,24 +5060,36 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + medusa.admin.discounts.updateCondition(discount_id, condition_id, { + products: [ + product_id + ] + }) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "products": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -5310,8 +5098,8 @@ paths: schema: type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5324,44 +5112,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostDraftOrdersDraftOrderLineItemsItem - summary: Update a Line Item - description: Updates a Line Item for a Draft Order + '/discounts/{id}': + delete: + operationId: DeleteDiscountsDiscount + summary: Delete a Discount + description: Deletes a Discount. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Line Item. + description: The ID of the Discount schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -5373,32 +5136,23 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { - quantity: 1 - }) + medusa.admin.discounts.delete(discount_id) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ id, object, deleted }) => { + console.log(id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}' \ - --data-raw '{ - "quantity": 1 - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -5407,8 +5161,17 @@ paths: schema: type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + id: + type: string + description: The ID of the deleted Discount + object: + type: string + description: The type of the object that was deleted. + default: discount + deleted: + type: boolean + description: Whether the discount was deleted successfully or not. + default: true '400': $ref: '#/components/responses/400_error' '401': @@ -5421,17 +5184,26 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/pay': - post: - summary: Registers a Payment - operationId: PostDraftOrdersDraftOrderRegisterPayment - description: Registers a payment for a Draft Order. + get: + operationId: GetDiscountsDiscount + summary: Get a Discount + description: Retrieves a Discount x-authenticated: true parameters: - in: path name: id required: true - description: The Draft Order id. + description: The ID of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string x-codeSamples: @@ -5445,23 +5217,23 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.markPaid(draft_order_id) + medusa.admin.discounts.retrieve(discount_id) - .then(({ order }) => { - console.log(order.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + curl --location --request GET + 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -5470,8 +5242,8 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5484,68 +5256,154 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/admin/draft-orders/{id}': post: - operationId: PostDraftOrdersDraftOrder - summary: Update a Draft Order - description: Updates a Draft Order. + operationId: PostDiscountsDiscount + summary: Update a Discount + description: >- + Updates a Discount with a given set of rules that define how the + Discount behaves. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Draft Order. + description: The ID of the Discount. schema: type: string - requestBody: + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each item of + the result. + schema: + type: string + requestBody: content: application/json: schema: type: object properties: - region_id: + code: type: string - description: The ID of the Region to create the Draft Order in. - country_code: + description: A unique code that will be used to redeem the Discount + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - id + properties: + id: + type: string + description: The ID of the Rule + description: + type: string + description: A short description of the discount + value: + type: number + description: >- + The value that the discount represents; this will depend + on the type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the + discount can be used. Only one of `products`, + `product_types`, `product_collections`, `product_tags`, + and `customer_groups` should be provided. + items: + type: object + required: + - operator + properties: + id: + type: string + description: The ID of the Rule + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is + applied on product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is + applied on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is + applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is + applied on customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will + have to enable it later to make it available to Customers. + starts_at: type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: + format: date-time + description: The time at which the Discount should be available. + ends_at: type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: + format: date-time description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. + The time at which the Discount should no longer be + available. + valid_duration: type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + usage_limit: + type: number + description: Maximum times the discount can be used + regions: + description: >- + A list of Region ids representing the Regions in which the + Discount can be used. + type: array + items: + type: string + metadata: + description: An object containing metadata of the discount + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -5557,31 +5415,31 @@ paths: // must be previously logged in or use api token - medusa.admin.draftOrders.update(draft_order_id, { - email: "user@example.com" + medusa.admin.discounts.update(discount_id, { + code: 'TEST' }) - .then(({ draft_order }) => { - console.log(draft_order.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}' \ + 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com" + "code": "TEST" }' security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Discount responses: '200': description: OK @@ -5590,8 +5448,8 @@ paths: schema: type: object properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5604,46 +5462,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /gift-cards: - post: - operationId: PostGiftCards - summary: Create a Gift Card - description: >- - Creates a Gift Card that can redeemed by its unique code. The Gift Card - is only valid within 1 region. + '/discounts/{id}/dynamic-codes/{code}': + delete: + operationId: DeleteDiscountsDiscountDynamicCodesCode + summary: Delete a Dynamic Code + description: Deletes a dynamic code from a Discount. x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: code + required: true + description: The ID of the Discount + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -5655,26 +5492,189 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.create({ - region_id - }) + medusa.admin.discounts.deleteDynamicCode(discount_id, code) - .then(({ gift_card }) => { - console.log(gift_card.id); + .then(({ discount }) => { + console.log(discount.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/gift-cards' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ - --data-raw '{ - "region_id": "{region_id}" - }' + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/code/{code}': + get: + operationId: GetDiscountsDiscountCode + summary: Get Discount by Code + description: Retrieves a Discount by its discount code + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.retrieveByCode(code) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts/code/{code}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /gift-cards: + post: + operationId: PostGiftCards + summary: Create a Gift Card + description: >- + Creates a Gift Card that can redeemed by its unique code. The Gift Card + is only valid within 1 region. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - region_id + properties: + value: + type: integer + description: >- + The value (excluding VAT) that the Gift Card should + represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have + to enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: >- + The time at which the Gift Card should no longer be + available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.giftCards.create({ + region_id + }) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/gift-cards' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "region_id": "{region_id}" + }' security: - api_token: [] - cookie_auth: [] @@ -6967,39 +6967,22 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items': + '/orders/{id}/shipping-methods': post: - operationId: PostOrderEditsEditLineItems - summary: Add an line item to an order (edit) - description: Create an OrderEdit LineItem. + operationId: PostOrdersOrderShippingMethods + summary: Add a Shipping Method + description: >- + Adds a Shipping Method to an Order. If another Shipping Method exists + with the same Shipping Profile, the previous Shipping Method will be + replaced. + x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit. + description: The ID of the Order. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -7011,31 +6994,33 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.addLineItem(order_edit_id, { - variant_id, - quantity + medusa.admin.orders.addShippingMethod(order_id, { + price: 1000, + option_id }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items' \ + 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ - --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", - "quantity": 3 }' + --data-raw '{ + "price": 1000, + "option_id": "{option_id}" + }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK @@ -7044,8 +7029,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7058,46 +7043,72 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/cancel': - post: - operationId: PostOrderEditsOrderEditCancel - summary: Cancel an OrderEdit - description: Cancels an OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token + requestBody: + content: + application/json: + schema: + type: object + required: + - price + - option_id + properties: + price: + type: integer + description: >- + The price (excluding VAT) that should be charged for the + Shipping Method + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + data: + type: object + description: >- + The data required for the Shipping Option to create a + Shipping Method. This will depend on the Fulfillment + Provider. + '/orders/{id}/archive': + post: + operationId: PostOrdersOrderArchive + summary: Archive Order + description: Archives the order with the given id. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" - medusa.admin.orderEdits.cancel(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.archive(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + 'https://medusa-url.com/admin/orders/{id}/archive' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK @@ -7106,27 +7117,37 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/confirm': + '/orders/{id}/claims/{claim_id}/cancel': post: - operationId: PostOrderEditsOrderEditConfirm - summary: Confirms an OrderEdit - description: Confirms an OrderEdit. + operationId: PostOrdersClaimCancel + summary: Cancel a Claim + description: Cancels a Claim x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the order edit. + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. schema: type: string x-codeSamples: @@ -7140,22 +7161,24 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.confirm(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancelClaim(order_id, claim_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Claim responses: '200': description: OK @@ -7164,36 +7187,45 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /order-edits: + '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': post: - operationId: PostOrderEdits - summary: Create an OrderEdit - description: Creates an OrderEdit. - requestBody: - content: - application/json: - schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string + operationId: PostOrdersClaimFulfillmentsCancel + summary: Cancel Claim Fulfillment + description: Registers a claim's fulfillment as canceled. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Claim relates to. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7205,27 +7237,25 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.create({ order_id }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, + fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' + \ - --data-raw '{ "order_id": "my_order_id", "internal_note": - "my_optional_note" }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK @@ -7234,8 +7264,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7248,42 +7278,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetOrderEdits - summary: List OrderEdits - description: List OrderEdits. + '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': + post: + operationId: PostOrdersSwapFulfillmentsCancel + summary: Cancel Swap's Fulfilmment + description: Registers a Swap's Fulfillment as canceled. x-authenticated: true parameters: - - in: query - name: q - description: Query used for searching order edit internal note. - schema: - type: string - - in: query - name: order_id - description: List order edits by order id. + - in: path + name: id + required: true + description: The ID of the Order which the Swap relates to. schema: type: string - - in: query - name: limit - description: The number of items in the response - schema: - type: number - default: '20' - - in: query - name: offset - description: The offset of items in response - schema: - type: number - default: '0' - - in: query - name: expand - description: Comma separated list of relations to include in the results. + - in: path + name: swap_id + required: true + description: The ID of the Swap which the Fulfillment relates to. schema: type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. schema: type: string x-codeSamples: @@ -7297,22 +7314,25 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.list() - .then(({ order_edits, count, limit, offset }) => { - console.log(order_edits.length) - }) + medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, + fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK @@ -7321,18 +7341,8 @@ paths: schema: type: object properties: - order_edits: - type: array - $ref: '#/components/schemas/order_edit' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7345,23 +7355,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items/{item_id}': - delete: - operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete line items from an order edit and create change item - description: Delete line items from an order edit and create change item + '/orders/{id}/fulfillments/{fulfillment_id}/cancel': + post: + operationId: PostOrdersOrderFulfillmentsCancel + summary: Cancels a Fulfilmment + description: Registers a Fulfillment as canceled. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to delete from. + description: The ID of the Order which the Fulfillment relates to. schema: type: string - in: path - name: item_id + name: fulfillment_id required: true - description: The ID of the order edit item to delete from order. + description: The ID of the Fulfillment schema: type: string x-codeSamples: @@ -7375,22 +7385,24 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Fulfillment responses: '200': description: OK @@ -7399,8 +7411,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7413,35 +7425,22 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/orders/{id}/cancel': post: - operationId: PostOrderEditsEditLineItemsLineItem - summary: Create or update the order edit change holding the line item changes - description: Create or update the order edit change holding the line item changes + operationId: PostOrdersOrderCancel + summary: Cancel an Order + description: >- + Registers an Order as canceled. This triggers a flow that will cancel + any created Fulfillments and Payments, may fail if the Payment or + Fulfillment Provider is unable to cancel the Payment/Fulfillment. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to update. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to update. + description: The ID of the Order. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -7453,29 +7452,23 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, - { - quantity: 5 - }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.cancel(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/orders/{id}/cancel' \ - --data-raw '{ "quantity": 5 }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK @@ -7484,8 +7477,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7498,23 +7491,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/changes/{change_id}': - delete: - operationId: DeleteOrderEditsOrderEditItemChange - summary: Delete an Order Edit Item Change - description: Deletes an Order Edit Item Change + '/orders/{id}/swaps/{swap_id}/cancel': + post: + operationId: PostOrdersSwapCancel + summary: Cancels a Swap + description: Cancels a Swap x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to delete. + description: The ID of the Order. schema: type: string - in: path - name: change_id + name: swap_id required: true - description: The ID of the Order Edit Item Change to delete. + description: The ID of the Swap. schema: type: string x-codeSamples: @@ -7528,16 +7521,16 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.deleteItemChange(order_edit_id, - item_change_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) + medusa.admin.orders.cancelSwap(order_id, swap_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' + curl --location --request POST + 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \ --header 'Authorization: Bearer {api_token}' @@ -7545,7 +7538,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Swap responses: '200': description: OK @@ -7554,30 +7547,31 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted Order Edit Item Change. - object: - type: string - description: The type of the object that was deleted. - format: item_change - deleted: - type: boolean - description: Whether or not the Order Edit Item Change was deleted. - default: true + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' - '/order-edits/{id}': - delete: - operationId: DeleteOrderEditsOrderEdit - summary: Delete an Order Edit - description: Deletes an Order Edit + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/capture': + post: + operationId: PostOrdersOrderCapture + summary: Capture Order's Payment + description: Captures all the Payments associated with an Order. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to delete. + description: The ID of the Order. schema: type: string x-codeSamples: @@ -7591,22 +7585,23 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.delete(order_edit_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) + medusa.admin.orders.capturePayment(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/capture' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK @@ -7615,39 +7610,31 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted Order Edit. - object: - type: string - description: The type of the object that was deleted. - format: order_edit - deleted: - type: boolean - description: Whether or not the Order Edit was deleted. - default: true + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' - get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/complete': + post: + operationId: PostOrdersOrderComplete + summary: Complete an Order + description: Completes an Order x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the OrderEdit. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The ID of the Order. schema: type: string x-codeSamples: @@ -7661,22 +7648,23 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.retrieve(orderEditId) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.complete(order_id) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/complete' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order responses: '200': description: OK @@ -7685,8 +7673,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7699,16 +7687,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/orders/{id}/claims/{claim_id}/shipments': post: - operationId: PostOrderEditsOrderEdit - summary: Updates an OrderEdit - description: Updates a OrderEdit. + operationId: PostOrdersOrderClaimsClaimShipments + summary: Create Claim Shipment + description: Registers a Claim Fulfillment as shipped. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the OrderEdit. + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. schema: type: string requestBody: @@ -7716,13 +7711,20 @@ paths: application/json: schema: type: object + required: + - fulfillment_id properties: - internal_note: - description: An optional note to create or update for the order edit. + fulfillment_id: + description: The ID of the Fulfillment. type: string - x-codeSamples: - - lang: JavaScript - label: JS Client + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client source: > import Medusa from "@medusajs/medusa-js" @@ -7731,30 +7733,32 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.update(order_edit_id, { - internal_note: "internal reason XY" + medusa.admin.orders.createClaimShipment(order_id, claim_id, { + fulfillment_id }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' + \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "internal_note": "internal reason XY" + "fulfillment_id": "{fulfillment_id}" }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Claim responses: '200': description: OK @@ -7763,8 +7767,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -7777,19 +7781,143 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/request': + '/order/{id}/claims': post: - operationId: PostOrderEditsOrderEditRequest - summary: Request order edit confirmation - description: Request customer confirmation of an Order Edit + operationId: PostOrdersOrderClaims + summary: Create a Claim + description: Creates a Claim. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order Edit to request confirmation from. + description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - type + - claim_items + properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is + treated: `replace` Claims will result in a Fulfillment with + new items being created, while a `refund` Claim will refund + the amount paid for the claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: >- + Short text describing the Claim Item in further + detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: >- + A list of image URL's that will be associated with the + Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the + items are to be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: >- + The ID of the Shipping Option to create a Shipping + Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults + to the parent order's shipping address + $ref: '#/components/schemas/address' + refund_amount: + description: >- + The amount to refund the Customer when the Claim type is + `refund`. + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -7801,22 +7929,43 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.requestConfirmation(order_edit_id) - .then({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orders.createClaim(order_id, { + type: 'refund', + claim_items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/request' \ + 'https://medusa-url.com/admin/orders/{id}/claims' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "type": "refund", + "claim_items": [ + { + "item_id": "asdsd", + "quantity": 1 + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Claim responses: '200': description: OK @@ -7825,24 +7974,27 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/shipping-methods': + '/orders/{id}/fulfillment': post: - operationId: PostOrdersOrderShippingMethods - summary: Add a Shipping Method + operationId: PostOrdersOrderFulfillments + summary: Create a Fulfillment description: >- - Adds a Shipping Method to an Order. If another Shipping Method exists - with the same Shipping Profile, the previous Shipping Method will be - replaced. + Creates a Fulfillment of an Order - will notify Fulfillment Providers to + prepare a shipment. x-authenticated: true parameters: - in: path @@ -7851,6 +8003,38 @@ paths: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -7862,33 +8046,41 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.addShippingMethod(order_id, { - price: 1000, - option_id - }) - - .then(({ order }) => { + medusa.admin.orders.createFulfillment(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ + 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "price": 1000, - "option_id": "{option_id}" + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Fulfillment responses: '200': description: OK @@ -7911,36 +8103,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - price - - option_id - properties: - price: - type: integer - description: >- - The price (excluding VAT) that should be charged for the - Shipping Method - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - data: - type: object - description: >- - The data required for the Shipping Option to create a - Shipping Method. This will depend on the Fulfillment - Provider. - '/orders/{id}/archive': + '/orders/{id}/shipment': post: - operationId: PostOrdersOrderArchive - summary: Archive Order - description: Archives the order with the given id. + operationId: PostOrdersOrderShipment + summary: Create a Shipment + description: Registers a Fulfillment as shipped. x-authenticated: true parameters: - in: path @@ -7949,6 +8116,27 @@ paths: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Shipment. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -7960,7 +8148,9 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.archive(order_id) + medusa.admin.orders.createShipment(order_id, { + fulfillment_id + }) .then(({ order }) => { console.log(order.id); @@ -7969,9 +8159,15 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/archive' \ + 'https://medusa-url.com/admin/orders/{id}/shipment' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' security: - api_token: [] - cookie_auth: [] @@ -7999,11 +8195,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/cancel': + '/orders/{id}/swaps/{swap_id}/shipments': post: - operationId: PostOrdersClaimCancel - summary: Cancel a Claim - description: Cancels a Claim + operationId: PostOrdersOrderSwapsSwapShipments + summary: Create Swap Shipment + description: Registers a Swap Fulfillment as shipped. x-authenticated: true parameters: - in: path @@ -8013,11 +8209,32 @@ paths: schema: type: string - in: path - name: claim_id + name: swap_id required: true - description: The ID of the Claim. + description: The ID of the Swap. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: >- + If set to true no notification will be sent related to this + Claim. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8029,7 +8246,9 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelClaim(order_id, claim_id) + medusa.admin.orders.createSwapShipment(order_id, swap_id, { + fulfillment_id + }) .then(({ order }) => { console.log(order.id); @@ -8038,15 +8257,21 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Swap responses: '200': description: OK @@ -8069,31 +8294,104 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': + '/order/{id}/swaps': post: - operationId: PostOrdersClaimFulfillmentsCancel - summary: Cancel Claim Fulfillment - description: Registers a claim's fulfillment as canceled. + operationId: PostOrdersOrderSwaps + summary: Create a Swap + description: >- + Creates a Swap. Swaps are used to handle Return of previously purchased + goods and Fulfillment of replacements simultaneously. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order which the Claim relates to. - schema: - type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim which the Fulfillment relates to. - schema: - type: string - - in: path - name: fulfillment_id - required: true - description: The ID of the Fulfillment. + description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - return_items + properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping + Method from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: >- + The ID of the Shipping Option to override with a + custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true x-codeSamples: - lang: JavaScript label: JS Client @@ -8105,8 +8403,14 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, - fulfillment_id) + medusa.admin.orders.createSwap(order_id, { + return_items: [ + { + item_id, + quantity: 1 + } + ] + }) .then(({ order }) => { console.log(order.id); @@ -8115,15 +8419,25 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' - \ + 'https://medusa-url.com/admin/orders/{id}/swaps' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "return_items": [ + { + "item_id": "asfasf", + "quantity": 1 + } + ] + }' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Swap responses: '200': description: OK @@ -8146,31 +8460,41 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': + '/orders/{id}/claims/{claim_id}/fulfillments': post: - operationId: PostOrdersSwapFulfillmentsCancel - summary: Cancel Swap's Fulfilmment - description: Registers a Swap's Fulfillment as canceled. + operationId: PostOrdersOrderClaimsClaimFulfillments + summary: Create Claim Fulfillment + description: Creates a Fulfillment for a Claim. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order which the Swap relates to. - schema: - type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap which the Fulfillment relates to. + description: The ID of the Order. schema: type: string - in: path - name: fulfillment_id + name: claim_id required: true - description: The ID of the Fulfillment. + description: The ID of the Claim. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8182,8 +8506,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, - fulfillment_id) + medusa.admin.orders.fulfillClaim(order_id, claim_id) .then(({ order }) => { console.log(order.id); @@ -8192,7 +8515,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \ --header 'Authorization: Bearer {api_token}' @@ -8223,25 +8546,41 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/fulfillments/{fulfillment_id}/cancel': + '/orders/{id}/swaps/{swap_id}/fulfillments': post: - operationId: PostOrdersOrderFulfillmentsCancel - summary: Cancels a Fulfilmment - description: Registers a Fulfillment as canceled. + operationId: PostOrdersOrderSwapsSwapFulfillments + summary: Create Swap Fulfillment + description: Creates a Fulfillment for a Swap. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order which the Fulfillment relates to. + description: The ID of the Order. schema: type: string - in: path - name: fulfillment_id + name: swap_id required: true - description: The ID of the Fulfillment + description: The ID of the Swap. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8253,7 +8592,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + medusa.admin.orders.fulfillSwap(order_id, swap_id) .then(({ order }) => { console.log(order.id); @@ -8262,7 +8601,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ --header 'Authorization: Bearer {api_token}' @@ -8293,14 +8632,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/cancel': - post: - operationId: PostOrdersOrderCancel - summary: Cancel an Order - description: >- - Registers an Order as canceled. This triggers a flow that will cancel - any created Fulfillments and Payments, may fail if the Payment or - Fulfillment Provider is unable to cancel the Payment/Fulfillment. + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order x-authenticated: true parameters: - in: path @@ -8320,7 +8656,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancel(order_id) + medusa.admin.orders.retrieve(order_id) .then(({ order }) => { console.log(order.id); @@ -8328,8 +8664,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/cancel' \ + curl --location --request GET + 'https://medusa-url.com/admin/orders/{id}' \ --header 'Authorization: Bearer {api_token}' security: @@ -8359,11 +8695,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/cancel': post: - operationId: PostOrdersSwapCancel - summary: Cancels a Swap - description: Cancels a Swap + operationId: PostOrdersOrder + summary: Update an Order + description: Updates and order x-authenticated: true parameters: - in: path @@ -8372,12 +8707,75 @@ paths: description: The ID of the Order. schema: type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap. - schema: - type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: '#/components/schemas/address_fields' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/address_fields' + items: + description: The Line Items for the order + type: array + items: + $ref: '#/components/schemas/line_item' + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: '#/components/schemas/discount' + customer_id: + description: ID of the customer + type: string + payment_method: + description: payment method chosen for the order + type: object + properties: + provider_id: + type: string + description: ID of the payment provider + data: + description: Data relevant for the given payment method + type: object + shipping_method: + description: The Shipping Method used for shipping the order. + type: object + properties: + provider_id: + type: string + description: The ID of the shipping provider. + profile_id: + type: string + description: The ID of the shipping profile. + price: + type: integer + description: The price of the shipping. + data: + type: object + description: Data relevant to the specific shipping method. + items: + type: array + items: + $ref: '#/components/schemas/line_item' + description: Items to ship + no_notification: + description: >- + A flag to indicate if no notifications should be emitted + related to the updated order. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8389,7 +8787,9 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.cancelSwap(order_id, swap_id) + medusa.admin.orders.update(order_id, { + email: 'user@example.com' + }) .then(({ order }) => { console.log(order.id); @@ -8398,15 +8798,20 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' - \ + 'https://medusa-url.com/admin/orders/adasda' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Order responses: '200': description: OK @@ -8429,42 +8834,249 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/capture': - post: - operationId: PostOrdersOrderCapture - summary: Capture Order's Payment - description: Captures all the Payments associated with an Order. + /orders: + get: + operationId: GetOrders + summary: List Orders + description: Retrieves a list of Orders x-authenticated: true parameters: - - in: path + - in: query + name: q + description: >- + Query used for searching orders by shipping address first name, + orders' email, and orders' display ID + schema: + type: string + - in: query name: id - required: true - description: The ID of the Order. + description: ID of the order to search for. schema: type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orders.capturePayment(order_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/capture' \ - - --header 'Authorization: Bearer {api_token}' + - in: query + name: status + style: form + explode: false + description: Status to search for + 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 + - fulfilled + - partially_fulfilled + - shipped + - partially_shipped + - canceled + - returned + - partially_returned + - requires_action + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + enum: + - captured + - awaiting + - not_paid + - refunded + - partially_refunded + - canceled + - requires_action + - in: query + name: display_id + description: Display ID to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: customer_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Regions to search orders by + schema: + oneOf: + - type: string + description: ID of a Region. + - type: array + items: + type: string + description: ID of a Region. + - in: query + name: currency_code + style: form + explode: false + description: Currency code to search for + 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: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting orders were created. + 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: Date comparison for when resulting orders were updated. + 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: Date comparison for when resulting orders were canceled. + 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: sales_channel_id + style: form + explode: false + description: Filter by Sales Channels + schema: + type: array + items: + type: string + description: The ID of a Sales Channel + - in: query + name: offset + description: How many orders to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of orders returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each order of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each order of + the result. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.list() + + .then(({ orders, limit, offset, count }) => { + console.log(orders.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/orders' + \ + + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -8478,8 +9090,19 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + orders: + type: array + items: + $ref: '#/components/schemas/order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -8492,11 +9115,14 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/complete': + '/orders/{id}/swaps/{swap_id}/process-payment': post: - operationId: PostOrdersOrderComplete - summary: Complete an Order - description: Completes an Order + operationId: PostOrdersOrderSwapsSwapProcessPayment + summary: Process Swap Payment + description: >- + When there are differences between the returned and shipped Products in + a Swap, the difference must be processed. Either a Refund will be issued + or a Payment will be captured. x-authenticated: true parameters: - in: path @@ -8505,6 +9131,12 @@ paths: description: The ID of the Order. schema: type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -8516,7 +9148,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.complete(order_id) + medusa.admin.orders.processSwapPayment(order_id, swap_id) .then(({ order }) => { console.log(order.id); @@ -8525,14 +9157,15 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/complete' \ + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Order + - Swap responses: '200': description: OK @@ -8555,11 +9188,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/shipments': + '/orders/{id}/refund': post: - operationId: PostOrdersOrderClaimsClaimShipments - summary: Create Claim Shipment - description: Registers a Claim Fulfillment as shipped. + operationId: PostOrdersOrderRefunds + summary: Create a Refund + description: Issues a Refund. x-authenticated: true parameters: - in: path @@ -8568,28 +9201,29 @@ paths: description: The ID of the Order. schema: type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim. - schema: - type: string requestBody: content: application/json: schema: type: object required: - - fulfillment_id + - amount + - reason properties: - fulfillment_id: - description: The ID of the Fulfillment. + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + note: + description: A note with additional details about the Refund. + type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Refund. + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -8601,8 +9235,9 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createClaimShipment(order_id, claim_id, { - fulfillment_id + medusa.admin.orders.refundPayment(order_id, { + amount: 1000, + reason: 'Do not like it' }) .then(({ order }) => { @@ -8612,21 +9247,21 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' - \ + 'https://medusa-url.com/admin/orders/adasda/refund' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "fulfillment_id": "{fulfillment_id}" + "amount": 1000, + "reason": "Do not like it" }' security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Order responses: '200': description: OK @@ -8649,11 +9284,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/claims': + '/orders/{id}/return': post: - operationId: PostOrdersOrderClaims - summary: Create a Claim - description: Creates a Claim. + operationId: PostOrdersOrderReturns + summary: Request a Return + description: >- + Requests a Return. If applicable a return label will be created and + other plugins notified. x-authenticated: true parameters: - in: path @@ -8668,21 +9305,10 @@ paths: schema: type: object required: - - type - - claim_items + - items properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. + items: + description: The Line Items that will be returned. type: array items: required: @@ -8690,39 +9316,21 @@ paths: - quantity properties: item_id: - description: The ID of the Line Item that will be claimed. + description: The ID of the Line Item. type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. + reason_id: + description: The ID of the Return Reason to use. type: string - reason: - description: The reason for the Claim + note: + description: An optional note with information about the Return. type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string + quantity: + description: The quantity of the Line Item. + type: integer return_shipping: description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. + The Shipping Method to be used to handle the return + shipment. type: object properties: option_id: @@ -8733,59 +9341,23 @@ paths: price: type: integer description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - $ref: '#/components/schemas/address' - refund_amount: + note: + description: An optional note with information about the Return. + type: string + receive_now: description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer + A flag to indicate if the Return should be registerd as + received immediately. + type: boolean + default: false no_notification: description: >- - If set to true no notification will be send related to this - Claim. + A flag to indicate if no notifications should be emitted + related to the requested Return. type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + refund: + description: The amount to refund. + type: integer x-codeSamples: - lang: JavaScript label: JS Client @@ -8797,9 +9369,8 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createClaim(order_id, { - type: 'refund', - claim_items: [ + medusa.admin.orders.requestReturn(order_id, { + items: [ { item_id, quantity: 1 @@ -8814,17 +9385,16 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims' \ + 'https://medusa-url.com/admin/orders/{id}/return' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "type": "refund", - "claim_items": [ + "items": [ { - "item_id": "asdsd", + "item_id": "{item_id}", "quantity": 1 } ] @@ -8833,7 +9403,8 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Claim + - Return + - Order responses: '200': description: OK @@ -8856,13 +9427,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/fulfillment': + '/order/{id}/claims/{claim_id}': post: - operationId: PostOrdersOrderFulfillments - summary: Create a Fulfillment - description: >- - Creates a Fulfillment of an Order - will notify Fulfillment Providers to - prepare a shipment. + operationId: PostOrdersOrderClaimsClaim + summary: Update a Claim + description: Updates a Claim. x-authenticated: true parameters: - in: path @@ -8871,56 +9440,119 @@ paths: description: The ID of the Order. schema: type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string requestBody: content: application/json: schema: type: object - required: - - items properties: - items: - description: The Line Items to include in the Fulfillment. + claim_items: + description: The Claim Items that the Claim will consist of. type: array items: required: - - item_id - - quantity + - id + - images + - tags properties: + id: + description: The ID of the Claim Item. + type: string item_id: - description: The ID of Line Item to fulfill. + description: The ID of the Line Item that will be claimed. type: string quantity: - description: The quantity of the Line Item to fulfill. + description: The number of items that will be returned type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orders.createFulfillment(order_id, { - items: [ - { - item_id, - quantity: 1 - } - ] + note: + description: >- + Short text describing the Claim Item in further + detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: >- + A list of image URL's that will be associated with the + Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: >- + The ID of the Shipping Option to create a Shipping + Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.updateClaim(order_id, claim_id, { + no_notification: true }) .then(({ order }) => { @@ -8930,25 +9562,20 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "items": [ - { - "item_id": "{item_id}", - "quantity": 1 - } - ] + "no_notification": true }' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Claim responses: '200': description: OK @@ -8971,17 +9598,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/shipment': + '/order-edits/{id}/items': post: - operationId: PostOrdersOrderShipment - summary: Create a Shipment - description: Registers a Fulfillment as shipped. - x-authenticated: true + operationId: PostOrderEditsEditLineItems + summary: Add an line item to an order (edit) + description: Create an OrderEdit LineItem. parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Order Edit. schema: type: string requestBody: @@ -8990,21 +9616,21 @@ paths: schema: type: object required: - - fulfillment_id + - variant_id + - quantity properties: - fulfillment_id: - description: The ID of the Fulfillment. + variant_id: + description: The ID of the variant ID to add type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: + quantity: + description: The quantity to add + type: number + metadata: description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + An optional set of key-value pairs to hold additional + information. + type: object + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -9016,31 +9642,31 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createShipment(order_id, { - fulfillment_id + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity }) - .then(({ order }) => { - console.log(order.id); - }); + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/shipment' \ + 'https://medusa-url.com/admin/order-edits/{id}/items' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ - --data-raw '{ - "fulfillment_id": "{fulfillment_id}" - }' + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", + "quantity": 3 }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - OrderEdit responses: '200': description: OK @@ -9049,8 +9675,8 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -9063,46 +9689,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/shipments': + '/order-edits/{id}/cancel': post: - operationId: PostOrdersOrderSwapsSwapShipments - summary: Create Swap Shipment - description: Registers a Swap Fulfillment as shipped. + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap. + description: The ID of the OrderEdit. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -9114,32 +9713,22 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createSwapShipment(order_id, swap_id, { - fulfillment_id - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.cancel(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ - --data-raw '{ - "fulfillment_id": "{fulfillment_id}" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - OrderEdit responses: '200': description: OK @@ -9148,118 +9737,29 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/swaps': + '/order-edits/{id}/confirm': post: - operationId: PostOrdersOrderSwaps - summary: Create a Swap - description: >- - Creates a Swap. Swaps are used to handle Return of previously purchased - goods and Fulfillment of replacements simultaneously. + operationId: PostOrderEditsOrderEditConfirm + summary: Confirms an OrderEdit + description: Confirms an OrderEdit. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the order edit. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - return_items - properties: - return_items: - description: The Line Items to return as part of the Swap. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: The new items to send to the Customer. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a - custom price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: 'If true, swaps can be completed with items out of stock' - type: boolean - default: true x-codeSamples: - lang: JavaScript label: JS Client @@ -9271,41 +9771,22 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.createSwap(order_id, { - return_items: [ - { - item_id, - quantity: 1 - } - ] - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.confirm(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ - --data-raw '{ - "return_items": [ - { - "item_id": "asfasf", - "quantity": 1 - } - ] - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Swap + - OrderEdit responses: '200': description: OK @@ -9314,55 +9795,36 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/fulfillments': + /order-edits: post: - operationId: PostOrdersOrderClaimsClaimFulfillments - summary: Create Claim Fulfillment - description: Creates a Fulfillment for a Claim. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim. - schema: - type: string + operationId: PostOrderEdits + summary: Create an OrderEdit + description: Creates an OrderEdit. requestBody: content: application/json: schema: type: object + required: + - order_id properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -9374,24 +9836,27 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.fulfillClaim(order_id, claim_id) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.create({ order_id }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' - \ + 'https://medusa-url.com/admin/order-edits' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "order_id": "my_order_id", "internal_note": + "my_optional_note" }' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - OrderEdit responses: '200': description: OK @@ -9400,8 +9865,8 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -9414,41 +9879,44 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/fulfillments': - post: - operationId: PostOrdersOrderSwapsSwapFulfillments - summary: Create Swap Fulfillment - description: Creates a Fulfillment for a Swap. + get: + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true parameters: - - in: path - name: id - required: true - description: The ID of the Order. + - in: query + name: q + description: Query used for searching order edit internal note. schema: type: string - - in: path - name: swap_id - required: true - description: The ID of the Swap. + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -9460,24 +9928,22 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.fulfillSwap(order_id, swap_id) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' - \ + curl --location --request GET + 'https://medusa-url.com/admin/order-edits' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - OrderEdit responses: '200': description: OK @@ -9486,71 +9952,18 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/orders/{id}': - get: - operationId: GetOrdersOrder - summary: Get an Order - description: Retrieves an Order - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orders.retrieve(order_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/orders/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/order' + order_edits: + type: array + $ref: '#/components/schemas/order_edit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -9563,87 +9976,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostOrdersOrder - summary: Update an Order - description: Updates and order + '/order-edits/{id}/items/{item_id}': + delete: + operationId: DeleteOrderEditsOrderEditLineItemsLineItem + summary: Delete line items from an order edit and create change item + description: Delete line items from an order edit and create change item x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Order Edit to delete from. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to delete from order. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: '#/components/schemas/address_fields' - shipping_address: - description: Shipping address - anyOf: - - $ref: '#/components/schemas/address_fields' - items: - description: The Line Items for the order - type: array - items: - $ref: '#/components/schemas/line_item' - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order - type: array - items: - $ref: '#/components/schemas/discount' - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - type: object - properties: - provider_id: - type: string - description: ID of the payment provider - data: - description: Data relevant for the given payment method - type: object - shipping_method: - description: The Shipping Method used for shipping the order. - type: object - properties: - provider_id: - type: string - description: The ID of the shipping provider. - profile_id: - type: string - description: The ID of the shipping profile. - price: - type: integer - description: The price of the shipping. - data: - type: object - description: Data relevant to the specific shipping method. - items: - type: array - items: - $ref: '#/components/schemas/line_item' - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the updated order. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -9655,31 +10006,22 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.update(order_id, { - email: 'user@example.com' - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/adasda' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - --data-raw '{ - "email": "user@example.com" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Order + - OrderEdit responses: '200': description: OK @@ -9688,240 +10030,49 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /orders: - get: - operationId: GetOrders - summary: List Orders - description: Retrieves a list of Orders - x-authenticated: true - parameters: - - in: query - name: q - description: >- - Query used for searching orders by shipping address first name, - orders' email, and orders' display ID - schema: - type: string - - in: query - name: id - description: ID of the order to search for. - schema: - type: string - - in: query - name: status - style: form - explode: false - description: Status to search for - 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 - - fulfilled - - partially_fulfilled - - shipped - - partially_shipped - - canceled - - returned - - partially_returned - - requires_action - - in: query - name: payment_status - style: form - explode: false - description: Payment status to search for. - schema: - type: array - items: - type: string - enum: - - captured - - awaiting - - not_paid - - refunded - - partially_refunded - - canceled - - requires_action - - in: query - name: display_id - description: Display ID to search for. - schema: - type: string - - in: query - name: cart_id - description: to search for. - schema: - type: string - - in: query - name: customer_id - description: to search for. - schema: - type: string - - in: query - name: email - description: to search for. - schema: - type: string - - in: query - name: region_id - style: form - explode: false - description: Regions to search orders by - schema: - oneOf: - - type: string - description: ID of a Region. - - type: array - items: - type: string - description: ID of a Region. - - in: query - name: currency_code - style: form - explode: false - description: Currency code to search for - 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: to search for. - schema: - type: string - - in: query - name: created_at - description: Date comparison for when resulting orders were created. - 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: Date comparison for when resulting orders were updated. - 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: Date comparison for when resulting orders were canceled. - 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: sales_channel_id - style: form - explode: false - description: Filter by Sales Channels - schema: - type: array - items: - type: string - description: The ID of a Sales Channel - - in: query - name: offset - description: How many orders to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of orders returned. - schema: - type: integer - default: 50 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. + order_edit: + $ref: '#/components/schemas/order_edit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsEditLineItemsLineItem + summary: Create or update the order edit change holding the line item changes + description: Create or update the order edit change holding the line item changes + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to update. schema: type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in each order of - the result. + - in: path + name: item_id + required: true + description: The ID of the order edit item to update. schema: type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -9933,23 +10084,29 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.list() - - .then(({ orders, limit, offset, count }) => { - console.log(orders.length); - }); + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, + { + quantity: 5 + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > - curl --location --request GET 'https://medusa-url.com/admin/orders' - \ + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "quantity": 5 }' security: - api_token: [] - cookie_auth: [] tags: - - Order + - OrderEdit responses: '200': description: OK @@ -9958,19 +10115,8 @@ paths: schema: type: object properties: - orders: - type: array - items: - $ref: '#/components/schemas/order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -9983,26 +10129,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/process-payment': - post: - operationId: PostOrdersOrderSwapsSwapProcessPayment - summary: Process Swap Payment - description: >- - When there are differences between the returned and shipped Products in - a Swap, the difference must be processed. Either a Refund will be issued - or a Payment will be captured. + '/order-edits/{id}/changes/{change_id}': + delete: + operationId: DeleteOrderEditsOrderEditItemChange + summary: Delete an Order Edit Item Change + description: Deletes an Order Edit Item Change x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Order Edit to delete. schema: type: string - in: path - name: swap_id + name: change_id required: true - description: The ID of the Swap. + description: The ID of the Order Edit Item Change to delete. schema: type: string x-codeSamples: @@ -10016,16 +10159,16 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.processSwapPayment(order_id, swap_id) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.deleteItemChange(order_edit_id, + item_change_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ --header 'Authorization: Bearer {api_token}' @@ -10033,7 +10176,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Swap + - OrderEdit responses: '200': description: OK @@ -10042,56 +10185,32 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + id: + type: string + description: The ID of the deleted Order Edit Item Change. + object: + type: string + description: The type of the object that was deleted. + format: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/orders/{id}/refund': - post: - operationId: PostOrdersOrderRefunds - summary: Create a Refund - description: Issues a Refund. + '/order-edits/{id}': + delete: + operationId: DeleteOrderEditsOrderEdit + summary: Delete an Order Edit + description: Deletes an Order Edit x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the Order Edit to delete. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -10103,33 +10222,92 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.refundPayment(order_id, { - amount: 1000, - reason: 'Do not like it' - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.delete(order_edit_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/adasda/refund' \ + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}' \ - --header 'Authorization: Bearer {api_token}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Order Edit. + object: + type: string + description: The type of the object that was deleted. + format: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" - --header 'Content-Type: application/json' \ + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.retrieve(orderEditId) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits/{id}' \ - --data-raw '{ - "amount": 1000, - "reason": "Do not like it" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Order + - OrderEdit responses: '200': description: OK @@ -10138,8 +10316,8 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -10152,19 +10330,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/return': post: - operationId: PostOrdersOrderReturns - summary: Request a Return - description: >- - Requests a Return. If applicable a return label will be created and - other plugins notified. + operationId: PostOrderEditsOrderEdit + summary: Updates an OrderEdit + description: Updates a OrderEdit. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. + description: The ID of the OrderEdit. schema: type: string requestBody: @@ -10172,60 +10347,10 @@ paths: application/json: schema: type: object - required: - - items properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. + internal_note: + description: An optional note to create or update for the order edit. type: string - receive_now: - description: >- - A flag to indicate if the Return should be registerd as - received immediately. - type: boolean - default: false - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the requested Return. - type: boolean - refund: - description: The amount to refund. - type: integer x-codeSamples: - lang: JavaScript label: JS Client @@ -10237,42 +10362,30 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.requestReturn(order_id, { - items: [ - { - item_id, - quantity: 1 - } - ] + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" }) - - .then(({ order }) => { - console.log(order.id); - }); + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/return' \ + 'https://medusa-url.com/admin/order-edits/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "items": [ - { - "item_id": "{item_id}", - "quantity": 1 - } - ] + "internal_note": "internal reason XY" }' security: - api_token: [] - cookie_auth: [] tags: - - Return - - Order + - OrderEdit responses: '200': description: OK @@ -10281,8 +10394,8 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': @@ -10295,119 +10408,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/claims/{claim_id}': + '/order-edits/{id}/request': post: - operationId: PostOrdersOrderClaimsClaim - summary: Update a Claim - description: Updates a Claim. + operationId: PostOrderEditsOrderEditRequest + summary: Request order edit confirmation + description: Request customer confirmation of an Order Edit x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The ID of the Claim. + description: The ID of the Order Edit to request confirmation from. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -10419,31 +10432,22 @@ paths: // must be previously logged in or use api token - medusa.admin.orders.updateClaim(order_id, claim_id, { - no_notification: true - }) - - .then(({ order }) => { - console.log(order.id); - }); + medusa.admin.orderEdits.requestConfirmation(order_edit_id) + .then({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + 'https://medusa-url.com/admin/order-edits/{id}/request' \ - --data-raw '{ - "no_notification": true - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Claim + - OrderEdit responses: '200': description: OK @@ -10452,18 +10456,14 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' '/payment-collections/{id}': @@ -14704,7 +14704,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Publishable Api Key + - PublishableApiKey responses: '200': description: OK @@ -14802,7 +14802,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Publishable Api Key + - PublishableApiKey responses: '200': description: OK @@ -14951,7 +14951,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKeys + - PublishableApiKey responses: '200': description: OK @@ -15099,12 +15099,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-keys/:id/sales-channels': + '/publishable-api-keys/{id}/sales-channels': get: operationId: GetPublishableApiKeySalesChannels summary: List PublishableApiKey's SalesChannels description: List PublishableApiKey's SalesChannels x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15132,7 +15139,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKeySalesChannels + - PublishableApiKey responses: '200': description: OK @@ -16656,254 +16663,16 @@ paths: value: description: >- The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returnReasons.update(return_reason_id, { - label: 'Damaged' - }) - - .then(({ return_reason }) => { - console.log(return_reason.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "label": "Damaged" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/returns/{id}/cancel': - post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.cancel(return_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/cancel' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /returns: - get: - operationId: GetReturns - summary: List Returns - description: Retrieves a list of Returns - parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. - schema: - type: number - default: '0' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.list() - - .then(({ returns, limit, offset, count }) => { - console.log(returns.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET 'https://medusa-url.com/admin/returns' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - returns: - type: array - items: - $ref: '#/components/schemas/return' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/returns/{id}/receive': - post: - operationId: PostReturnsReturnReceive - summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + be unique. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -16915,41 +16684,31 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.receive(return_id, { - items: [ - { - item_id, - quantity: 1 - } - ] + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' }) - .then((data) => { - console.log(data.return.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/receive' \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "items": [ - { - "item_id": "asafg", - "quantity": 1 - } - ] + "label": "Damaged" }' security: - api_token: [] - cookie_auth: [] tags: - - Return + - Return Reason responses: '200': description: OK @@ -16958,8 +16717,8 @@ paths: schema: type: object properties: - return: - $ref: '#/components/schemas/return' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -17457,23 +17216,241 @@ paths: // must be previously logged in or use api token - medusa.admin.salesChannels.delete(sales_channel_id) + medusa.admin.salesChannels.delete(sales_channel_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/sales-channels/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted sales channel + object: + type: string + description: The type of the object that was deleted. + default: sales-channel + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetSalesChannelsSalesChannel + summary: Get a Sales Channel + description: Retrieves the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.retrieve(sales_channel_id) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/sales-channels/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + sales_channel: + $ref: '#/components/schemas/sales_channel' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostSalesChannelsSalesChannel + summary: Update a Sales Channel + description: Updates a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the sales channel. + description: + type: string + description: Sales Channel description. + is_disabled: + type: boolean + description: Indication of if the sales channel is active. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.update(sales_channel_id, { + name: 'App' + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/sales-channels/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + sales_channel: + $ref: '#/components/schemas/sales_channel' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/returns/{id}/cancel': + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.cancel(return_id) - .then(({ id, object, deleted }) => { - console.log(id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/sales-channels/{id}' \ + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Return responses: '200': description: OK @@ -17482,17 +17459,8 @@ paths: schema: type: object properties: - id: - type: string - description: The ID of the deleted sales channel - object: - type: string - description: The type of the object that was deleted. - default: sales-channel - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -17505,18 +17473,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /returns: get: - operationId: GetSalesChannelsSalesChannel - summary: Get a Sales Channel - description: Retrieves the sales channel. - x-authenticated: true + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns parameters: - - in: path - name: id - required: true - description: The ID of the Sales channel. + - in: query + name: limit + description: The upper limit for the amount of responses returned. schema: - type: string + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' x-codeSamples: - lang: JavaScript label: JS Client @@ -17528,23 +17502,23 @@ paths: // must be previously logged in or use api token - medusa.admin.salesChannels.retrieve(sales_channel_id) + medusa.admin.returns.list() - .then(({ sales_channel }) => { - console.log(sales_channel.id); + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/sales-channels/{id}' \ + curl --location --request GET 'https://medusa-url.com/admin/returns' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Return responses: '200': description: OK @@ -17553,8 +17527,19 @@ paths: schema: type: object properties: - sales_channel: - $ref: '#/components/schemas/sales_channel' + returns: + type: array + items: + $ref: '#/components/schemas/return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -17567,16 +17552,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/returns/{id}/receive': post: - operationId: PostSalesChannelsSalesChannel - summary: Update a Sales Channel - description: Updates a Sales Channel. - x-authenticated: true + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. parameters: - in: path name: id required: true - description: The ID of the Sales Channel. + description: The ID of the Return. schema: type: string requestBody: @@ -17584,16 +17571,26 @@ paths: application/json: schema: type: object + required: + - items properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -17605,31 +17602,41 @@ paths: // must be previously logged in or use api token - medusa.admin.salesChannels.update(sales_channel_id, { - name: 'App' + medusa.admin.returns.receive(return_id, { + items: [ + { + item_id, + quantity: 1 + } + ] }) - .then(({ sales_channel }) => { - console.log(sales_channel.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/sales-channels/{id}' \ + 'https://medusa-url.com/admin/returns/{id}/receive' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "App" + "items": [ + { + "item_id": "asafg", + "quantity": 1 + } + ] }' security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Return responses: '200': description: OK @@ -17638,8 +17645,8 @@ paths: schema: type: object properties: - sales_channel: - $ref: '#/components/schemas/sales_channel' + return: + $ref: '#/components/schemas/return' '400': $ref: '#/components/responses/400_error' '401': @@ -18728,26 +18735,140 @@ paths: // must be previously logged in or use api token - medusa.admin.store.update({ - name: 'Medusa Store' - }) + medusa.admin.store.update({ + name: 'Medusa Store' + }) + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/admin/store' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Medusa Store" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + store: + $ref: '#/components/schemas/store' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-providers: + get: + operationId: GetStorePaymentProviders + summary: List Payment Providers + description: Retrieves the configured Payment Providers + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.listPaymentProviders() + + .then(({ payment_providers }) => { + console.log(payment_providers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/payment-providers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_providers: + type: array + items: + $ref: '#/components/schemas/payment_provider' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/tax-providers: + get: + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.listTaxProviders() - .then(({ store }) => { - console.log(store.id); + .then(({ tax_providers }) => { + console.log(tax_providers.length); }); - lang: Shell label: cURL source: > - curl --location --request POST 'https://medusa-url.com/admin/store' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/admin/store/tax-providers' \ - --data-raw '{ - "name": "Medusa Store" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -18761,8 +18882,10 @@ paths: schema: type: object properties: - store: - $ref: '#/components/schemas/store' + tax_providers: + type: array + items: + $ref: '#/components/schemas/tax_provider' '400': $ref: '#/components/responses/400_error' '401': @@ -18775,12 +18898,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /store/payment-providers: + '/swaps/{id}': get: - operationId: GetStorePaymentProviders - summary: List Payment Providers - description: Retrieves the configured Payment Providers + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -18792,23 +18922,23 @@ paths: // must be previously logged in or use api token - medusa.admin.store.listPaymentProviders() + medusa.admin.swaps.retrieve(swap_id) - .then(({ payment_providers }) => { - console.log(payment_providers.length); + .then(({ swap }) => { + console.log(swap.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/store/payment-providers' \ + 'https://medusa-url.com/admin/swaps/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Swap responses: '200': description: OK @@ -18817,10 +18947,8 @@ paths: schema: type: object properties: - payment_providers: - type: array - items: - $ref: '#/components/schemas/payment_provider' + swap: + $ref: '#/components/schemas/swap' '400': $ref: '#/components/responses/400_error' '401': @@ -18833,11 +18961,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /store/tax-providers: + /swaps: get: - operationId: GetStoreTaxProviders - summary: List Tax Providers - description: Retrieves the configured Tax Providers + operationId: GetSwaps + summary: List Swaps + description: Retrieves a list of Swaps. + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -18850,23 +18991,21 @@ paths: // must be previously logged in or use api token - medusa.admin.store.listTaxProviders() + medusa.admin.swaps.list() - .then(({ tax_providers }) => { - console.log(tax_providers.length); + .then(({ swaps }) => { + console.log(swaps.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/store/tax-providers' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Store + - Swap responses: '200': description: OK @@ -18875,10 +19014,19 @@ paths: schema: type: object properties: - tax_providers: + swaps: type: array items: - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/swap' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -20081,147 +20229,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/swaps/{id}': - get: - operationId: GetSwapsSwap - summary: Get a Swap - description: Retrieves a Swap. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Swap. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.swaps.retrieve(swap_id) - - .then(({ swap }) => { - console.log(swap.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/swaps/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Swap - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - swap: - $ref: '#/components/schemas/swap' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /swaps: - get: - operationId: GetSwaps - summary: List Swaps - description: Retrieves a list of Swaps. - parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. - schema: - type: number - default: '0' - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.swaps.list() - - .then(({ swaps }) => { - console.log(swaps.length); - }); - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/swaps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Swap - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - swaps: - type: array - items: - $ref: '#/components/schemas/swap' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /uploads/protected: post: operationId: PostUploadsProtected diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/getundefined similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/getundefined diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/getundefined similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/getundefined diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index bbafc38b93757..b762f21692879 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -202,10 +202,6 @@ tags: servers: - url: https://api.medusa-commerce.com/admin paths: - /apps/authorizations: - $ref: paths/apps_authorizations.yaml - /apps: - $ref: paths/apps.yaml /auth: $ref: paths/auth.yaml /currencies: @@ -220,6 +216,12 @@ paths: $ref: paths/batch-jobs.yaml /batch-jobs/{id}: $ref: paths/batch-jobs_{id}.yaml + /collections/{id}/products/batch: + $ref: paths/collections_{id}_products_batch.yaml + /collections: + $ref: paths/collections.yaml + /collections/{id}: + $ref: paths/collections_{id}.yaml /customer-groups/{id}/customers/batch: $ref: paths/customer-groups_{id}_customers_batch.yaml /customer-groups: @@ -228,16 +230,26 @@ paths: $ref: paths/customer-groups_{id}.yaml /customer-groups/{id}/customers: $ref: paths/customer-groups_{id}_customers.yaml - /collections/{id}/products/batch: - $ref: paths/collections_{id}_products_batch.yaml - /collections: - $ref: paths/collections.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml + /apps/authorizations: + $ref: paths/apps_authorizations.yaml + /apps: + $ref: paths/apps.yaml /customers: $ref: paths/customers.yaml /customers/{id}: $ref: paths/customers_{id}.yaml + /draft-orders: + $ref: paths/draft-orders.yaml + /draft-orders/{id}/line-items: + $ref: paths/draft-orders_{id}_line-items.yaml + /draft-orders/{id}: + $ref: paths/draft-orders_{id}.yaml + /draft-orders/{id}/line-items/{line_id}: + $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml + /draft-orders/{id}/pay: + $ref: paths/draft-orders_{id}_pay.yaml + /admin/draft-orders/{id}: + $ref: paths/admin_draft-orders_{id}.yaml /discounts/{id}/regions/{region_id}: $ref: paths/discounts_{id}_regions_{region_id}.yaml /discounts/{discount_id}/conditions/{condition_id}/batch: @@ -256,18 +268,6 @@ paths: $ref: paths/discounts_{id}_dynamic-codes_{code}.yaml /discounts/code/{code}: $ref: paths/discounts_code_{code}.yaml - /draft-orders: - $ref: paths/draft-orders.yaml - /draft-orders/{id}/line-items: - $ref: paths/draft-orders_{id}_line-items.yaml - /draft-orders/{id}: - $ref: paths/draft-orders_{id}.yaml - /draft-orders/{id}/line-items/{line_id}: - $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml - /draft-orders/{id}/pay: - $ref: paths/draft-orders_{id}_pay.yaml - /admin/draft-orders/{id}: - $ref: paths/admin_draft-orders_{id}.yaml /gift-cards: $ref: paths/gift-cards.yaml /gift-cards/{id}: @@ -288,22 +288,6 @@ paths: $ref: paths/notifications.yaml /notifications/{id}/resend: $ref: paths/notifications_{id}_resend.yaml - /order-edits/{id}/items: - $ref: paths/order-edits_{id}_items.yaml - /order-edits/{id}/cancel: - $ref: paths/order-edits_{id}_cancel.yaml - /order-edits/{id}/confirm: - $ref: paths/order-edits_{id}_confirm.yaml - /order-edits: - $ref: paths/order-edits.yaml - /order-edits/{id}/items/{item_id}: - $ref: paths/order-edits_{id}_items_{item_id}.yaml - /order-edits/{id}/changes/{change_id}: - $ref: paths/order-edits_{id}_changes_{change_id}.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml - /order-edits/{id}/request: - $ref: paths/order-edits_{id}_request.yaml /orders/{id}/shipping-methods: $ref: paths/orders_{id}_shipping-methods.yaml /orders/{id}/archive: @@ -354,6 +338,22 @@ paths: $ref: paths/orders_{id}_return.yaml /order/{id}/claims/{claim_id}: $ref: paths/order_{id}_claims_{claim_id}.yaml + /order-edits/{id}/items: + $ref: paths/order-edits_{id}_items.yaml + /order-edits/{id}/cancel: + $ref: paths/order-edits_{id}_cancel.yaml + /order-edits/{id}/confirm: + $ref: paths/order-edits_{id}_confirm.yaml + /order-edits: + $ref: paths/order-edits.yaml + /order-edits/{id}/items/{item_id}: + $ref: paths/order-edits_{id}_items_{item_id}.yaml + /order-edits/{id}/changes/{change_id}: + $ref: paths/order-edits_{id}_changes_{change_id}.yaml + /order-edits/{id}: + $ref: paths/order-edits_{id}.yaml + /order-edits/{id}/request: + $ref: paths/order-edits_{id}_request.yaml /payment-collections/{id}: $ref: paths/payment-collections_{id}.yaml /payment-collections/{id}/authorize: @@ -404,8 +404,8 @@ paths: $ref: paths/publishable-api-keys.yaml /publishable-api-keys/{id}: $ref: paths/publishable-api-keys_{id}.yaml - /publishable-api-keys/:id/sales-channels: - $ref: paths/publishable-api-keys_:id_sales-channels.yaml + /publishable-api-keys/{id}/sales-channels: + $ref: paths/publishable-api-keys_{id}_sales-channels.yaml /publishable-api-keys/{id}/revoke: $ref: paths/publishable-api-keys_{id}_revoke.yaml /publishable-api-key/{id}: @@ -432,18 +432,18 @@ paths: $ref: paths/return-reasons.yaml /return-reasons/{id}: $ref: paths/return-reasons_{id}.yaml - /returns/{id}/cancel: - $ref: paths/returns_{id}_cancel.yaml - /returns: - $ref: paths/returns.yaml - /returns/{id}/receive: - $ref: paths/returns_{id}_receive.yaml /sales-channels/{id}/products/batch: $ref: paths/sales-channels_{id}_products_batch.yaml /sales-channels: $ref: paths/sales-channels.yaml /sales-channels/{id}: $ref: paths/sales-channels_{id}.yaml + /returns/{id}/cancel: + $ref: paths/returns_{id}_cancel.yaml + /returns: + $ref: paths/returns.yaml + /returns/{id}/receive: + $ref: paths/returns_{id}_receive.yaml /shipping-options: $ref: paths/shipping-options.yaml /shipping-options/{id}: @@ -460,6 +460,10 @@ paths: $ref: paths/store_payment-providers.yaml /store/tax-providers: $ref: paths/store_tax-providers.yaml + /swaps/{id}: + $ref: paths/swaps_{id}.yaml + /swaps: + $ref: paths/swaps.yaml /tax-rates/{id}/product-types/batch: $ref: paths/tax-rates_{id}_product-types_batch.yaml /tax-rates/{id}/products/batch: @@ -470,10 +474,6 @@ paths: $ref: paths/tax-rates.yaml /tax-rates/{id}: $ref: paths/tax-rates_{id}.yaml - /swaps/{id}: - $ref: paths/swaps_{id}.yaml - /swaps: - $ref: paths/swaps.yaml /uploads/protected: $ref: paths/uploads_protected.yaml /uploads: diff --git a/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/publishable-api-keys.yaml index c99c88912ce16..3b0fec67e5af8 100644 --- a/docs/api/admin/paths/publishable-api-keys.yaml +++ b/docs/api/admin/paths/publishable-api-keys.yaml @@ -96,7 +96,7 @@ get: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKeys + - PublishableApiKey responses: '200': description: OK diff --git a/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml similarity index 75% rename from docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml rename to docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml index 669ea97dc5fda..e3b2336dd733a 100644 --- a/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml @@ -3,22 +3,29 @@ get: summary: List PublishableApiKey's SalesChannels description: List PublishableApiKey's SalesChannels x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/getundefined - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels/getundefined security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKeySalesChannels + - PublishableApiKey responses: '200': description: OK diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml index 15a34f324deec..6ee16f211410c 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml @@ -43,7 +43,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Publishable Api Key + - PublishableApiKey responses: '200': description: OK @@ -112,7 +112,7 @@ delete: - api_token: [] - cookie_auth: [] tags: - - Publishable Api Key + - PublishableApiKey responses: '200': description: OK diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 3e72e4310e68d..be32e3a13b0cf 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -355,16 +355,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/shipping-methods': - post: - operationId: PostCartsCartShippingMethod - description: Adds a Shipping Method to the Cart. - summary: Add a Shipping Method + '/collections/{id}': + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. parameters: - in: path name: id required: true - description: The cart ID. + description: The id of the Product Collection schema: type: string x-codeSamples: @@ -376,26 +376,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.addShippingMethod(cart_id, { - option_id - }) + medusa.collections.retrieve(collection_id) - .then(({ cart }) => { - console.log(cart.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "option_id": "{option_id}", - }' + curl --location --request GET + 'https://medusa-url.com/store/collections/{id}' tags: - - Cart + - Collection responses: '200': description: OK @@ -404,8 +396,8 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '404': @@ -416,46 +408,91 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/carts/{id}/taxes': - post: - summary: Calculate Cart Taxes - operationId: PostCartsCartTaxes - description: >- - Calculates taxes for a cart. Depending on the cart's region this may - involve making 3rd party API calls to a Tax Provider service. + /collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. parameters: - - in: path - name: id - required: true - description: The Cart ID. + - in: query + name: offset + description: >- + The number of collections to skip before starting to collect the + collections set schema: - type: string + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return + schema: + type: integer + default: 10 + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + 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: Date comparison for when resulting collections were updated. + 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: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/taxes' + curl --location --request GET + 'https://medusa-url.com/store/collections' tags: - - Cart + - Collection responses: '200': description: OK @@ -464,8 +501,19 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + collections: + type: array + items: + $ref: '#/components/schemas/product_collection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '404': @@ -476,24 +524,32 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/complete': + /customers/me/addresses: post: - summary: Complete a Cart - operationId: PostCartsCartComplete - description: >- - Completes a cart. The following steps will be performed. Payment - authorization is attempted and if more work is required, we simply - return the cart for further updates. If payment is authorized and order - is not yet created, we make sure to do so. The completion of a cart can - be performed idempotently with a provided header `Idempotency-Key`. If - not provided, we will generate one for the request. - parameters: - - in: path - name: id - required: true - description: The Cart id. - schema: - type: string + operationId: PostCustomersCustomerAddresses + summary: Add a Shipping Address + description: Adds a Shipping Address to a Customer's saved addresses. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - address + properties: + address: + description: The Address to add to the Customer. + allOf: + - $ref: '#/components/schemas/address_fields' + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code x-codeSamples: - lang: JavaScript label: JS Client @@ -503,66 +559,65 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.complete(cart_id) + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.customers.addresses.addAddress({ + address: { + first_name: 'Celia', + last_name: 'Schumm', + address_1: '225 Bednar Curve', + city: 'Danielville', + country_code: 'US', + postal_code: '85137', + phone: '981-596-6748 x90188', + company: 'Wyman LLC', + address_2: '', + province: 'Georgia', + metadata: {} + } + }) + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/complete' + 'https://medusa-url.com/store/customers/me/addresses' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "address": { + "first_name": "Celia", + "last_name": "Schumm", + "address_1": "225 Bednar Curve", + "city": "Danielville", + "country_code": "US", + "postal_code": "85137" + } + }' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': - description: >- - If a cart was successfully authorized, but requires further action - from the user the response body will contain the cart with an - updated payment session. If the Cart was successfully completed the - response body will contain the newly created Order. + description: A successful response content: application/json: schema: type: object properties: - type: - type: string - description: The type of the data property. - enum: - - order - - cart - - swap - data: - type: object - description: >- - The data of the result object. Its type depends on the - type field. - oneOf: - - type: object - description: >- - Cart was successfully authorized and order was placed - successfully. - properties: - order: - $ref: '#/components/schemas/order' - - type: object - description: >- - Cart was successfully authorized but requires further - actions. - properties: - cart: - $ref: '#/components/schemas/cart' - - type: object - description: >- - When cart is used for a swap and it has been completed - successfully. - properties: - cart: - $ref: '#/components/schemas/swap' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -571,64 +626,39 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /carts: + /customers: post: - summary: Create a Cart - operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. requestBody: content: application/json: schema: type: object + required: + - first_name + - last_name + - email + - password properties: - region_id: + first_name: + description: The Customer's first name. type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: + last_name: + description: The Customer's last name. type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the - Cart in. - country_code: + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + phone: + description: The Customer's phone number. type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome x-codeSamples: - lang: JavaScript label: JS Client @@ -638,27 +668,42 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.create() + medusa.customers.create({ + first_name: 'Alec', + last_name: 'Reynolds', + email: 'user@example.com', + password: 'supersecret' + }) - .then(({ cart }) => { - console.log(cart.id); + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/carts' + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Alec", + "last_name": "Reynolds", + "email": "user@example.com", + "password": "supersecret" + }' tags: - - Cart + - Customer responses: '200': - description: Successfully created a new Cart + description: OK content: application/json: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '404': @@ -666,21 +711,40 @@ paths: '409': $ref: '#/components/responses/invalid_state_error' '422': - $ref: '#/components/responses/invalid_request_error' + 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' - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. + '/customers/me/addresses/{address_id}': + delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresses. + x-authenticated: true parameters: - in: path - name: id + name: address_id required: true - description: The id of the Cart. + description: The id of the Address to remove. schema: type: string x-codeSamples: @@ -692,18 +756,24 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.createPaymentSessions(cart_id) + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.customers.addresses.deleteAddress(address_id) + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' + curl --location --request DELETE + 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': description: OK @@ -712,10 +782,12 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -724,24 +796,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/discounts/{code}': - delete: - operationId: DeleteCartsCartDiscountsDiscount - description: Removes a Discount from a Cart. - summary: Remove Discount + post: + operationId: PostCustomersCustomerAddressesAddress + summary: Update a Shipping Address + description: Updates a Customer's saved Shipping Address. + x-authenticated: true parameters: - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: code + name: address_id required: true - description: The unique Discount code. + description: The id of the Address to update. schema: type: string + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/address_fields' x-codeSamples: - lang: JavaScript label: JS Client @@ -751,18 +823,32 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.deleteDiscount(cart_id, code) + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.customers.addresses.updateAddress(address_id, { + first_name: 'Gina' + }) + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + curl --location --request POST + 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Gina" + }' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': description: OK @@ -771,10 +857,12 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -783,24 +871,14 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items/{line_id}': - delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. - 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 + /customers/me: + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: >- + Retrieves a Customer - the Customer must be logged in to retrieve their + details. + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -810,18 +888,24 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.lineItems.delete(cart_id, line_id) + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.customers.retrieve() + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + curl --location --request GET + 'https://medusa-url.com/store/customers/me' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': description: OK @@ -830,10 +914,12 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -843,22 +929,41 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostCartsCartLineItemsItem - summary: Update a Line Item - description: Updates a Line Item if the desired quantity can be fulfilled. - 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 + operationId: PostCustomersCustomer + summary: Update Customer + description: Updates a Customer's saved details. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address_fields' + description: The full billing address object + - type: string + description: The ID of an existing billing address + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -868,26 +973,32 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.lineItems.update(cart_id, line_id, { - quantity: 1 + // must be previously logged + + medusa.customers.update({ + first_name: 'Laury' }) - .then(({ cart }) => { - console.log(cart.id); + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + 'https://medusa-url.com/store/customers/me' \ + + --header 'Cookie: connect.sid={sid}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "quantity": 1 + "first_name": "Laury" }' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': description: OK @@ -896,10 +1007,12 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -908,39 +1021,15 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': - delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session + /customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Get Payment Methods description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. - 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 + Retrieves a list of a Customer's saved payment methods. Payment methods + are saved with Payment Providers and it is their responsibility to fetch + saved methods. + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -950,18 +1039,24 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.deletePaymentSession(cart_id, 'manual') + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.customers.paymentMethods.list() + + .then(({ payment_methods }) => { + console.log(payment_methods.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + curl --location --request GET + 'https://medusa-url.com/store/customers/me/payment-methods' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': description: OK @@ -970,10 +1065,24 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + payment_methods: + type: array + items: + properties: + provider_id: + type: string + description: >- + The id of the Payment Provider where the payment + method is saved. + data: + type: object + description: >- + The data needed for the Payment Provider to use the + saved payment method. '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -982,94 +1091,175 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. + /customers/me/orders: + get: + operationId: GetCustomersCustomerOrders + summary: List Orders + description: Retrieves a list of a Customer's Orders. + x-authenticated: true parameters: - - in: path - name: id - required: true - description: The id of the Cart. + - in: query + name: q + description: Query used for searching orders. schema: type: string - - in: path - name: provider_id - required: true - description: The id of the payment provider. + - in: query + name: id + description: Id of the order to search for. schema: type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.updatePaymentSession(cart_id, 'manual', { - data: { - } - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "data": {} - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': - get: - operationId: GetCartsCart - summary: Get a Cart - description: Retrieves a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + - in: query + name: display_id + description: Display id to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + description: to search for. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + 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: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + 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: Date comparison for when resulting collections were updated. + 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: Date comparison for when resulting collections were canceled. + 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: How many orders to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The offset in the resulting orders. + schema: + type: integer + default: 0 + - in: query + name: fields + description: >- + (Comma separated string) Which fields should be included in the + resulting orders. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated string) Which relations should be expanded in the + resulting orders. schema: type: string x-codeSamples: @@ -1081,18 +1271,24 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.retrieve(cart_id) + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.customers.listOrders() + + .then(({ orders, limit, offset, count }) => { + console.log(orders); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/carts/{id}' + 'https://medusa-url.com/store/customers/me/orders' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Cart + - Customer responses: '200': description: OK @@ -1101,10 +1297,23 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + orders: + type: array + items: + $ref: '#/components/schemas/order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1113,83 +1322,26 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /customers/password-token: post: - operationId: PostCartsCart - summary: Update a Cart - description: Updates a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string + operationId: PostCustomersCustomerPasswordToken + summary: Request Password Reset + description: >- + Creates a reset password token to be used in a subsequent + /reset-password request. The password token should be sent out of band + e.g. via email and will not be returned. requestBody: content: application/json: schema: type: object - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + required: + - email + properties: email: + description: The email of the customer. type: string - description: An email to be used on the Cart. format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Gift Card is identified by. - type: string - discounts: - description: An array of Discount codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - customer_id: - description: The ID of the Customer to associate the Cart with. - type: string - context: - description: An optional object to provide context to the Cart. - type: object - example: - ip: '::1' - user_agent: Chrome x-codeSamples: - lang: JavaScript label: JS Client @@ -1199,18 +1351,22 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.update(cart_id, { + medusa.customers.generatePasswordToken({ email: 'user@example.com' }) - .then(({ cart }) => { - console.log(cart.id); - }); + .then(() => { + // successful + }) + + .catch(() => { + // failed + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}' \ + 'https://medusa-url.com/store/customers/password-token' \ --header 'Content-Type: application/json' \ @@ -1218,19 +1374,14 @@ paths: "email": "user@example.com" }' tags: - - Cart + - Customer responses: - '200': + '204': description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1239,28 +1390,34 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions/{provider_id}/refresh': + /customers/password-reset: post: - operationId: PostCartsCartPaymentSessionsSession - summary: Refresh a Payment Session + operationId: PostCustomersResetPassword + summary: Reset Password description: >- - Refreshes a Payment Session to ensure that it is in sync with the Cart - - this is usually not necessary. - 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 + Resets a Customer's password using a password token created by a + previous /password-token request. + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + - token + properties: + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + token: + description: The reset password token + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1270,18 +1427,30 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.refreshPaymentSession(cart_id, 'manual') + medusa.customers.resetPassword({ + email: 'user@example.com', + password: 'supersecret', + token: 'supersecrettoken' + }) - .then(({ cart }) => { - console.log(cart.id); + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + 'https://medusa-url.com/store/customers/password-reset' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "password": "supersecret", + "token": "supersecrettoken" + }' tags: - - Cart + - Customer responses: '200': description: OK @@ -1290,10 +1459,12 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1302,18 +1473,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-session': + '/carts/{id}/shipping-methods': post: - operationId: PostCartsCartPaymentSession - summary: Select a Payment Session - description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method parameters: - in: path name: id required: true - description: The ID of the Cart. + description: The cart ID. schema: type: string x-codeSamples: @@ -1325,8 +1494,8 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.setPaymentSession(cart_id, { - provider_id: 'manual' + medusa.carts.addShippingMethod(cart_id, { + option_id }) .then(({ cart }) => { @@ -1336,12 +1505,12 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ --header 'Content-Type: application/json' \ --data-raw '{ - "provider_id": "manual" + "option_id": "{option_id}", }' tags: - Cart @@ -1371,44 +1540,40 @@ paths: schema: type: object required: - - provider_id + - option_id properties: - provider_id: + option_id: type: string - description: The ID of the Payment Provider. - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to + process the fulfillment of the order. Look at the + documentation for your installed fulfillment providers to + find out what to send. + '/carts/{id}/taxes': + post: + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: >- + Calculates taxes for a cart. Depending on the cart's region this may + involve making 3rd party API calls to a Tax Provider service. parameters: - in: path - name: code + name: id required: true - description: The unique Gift Card code. + description: The Cart ID. schema: type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/taxes' tags: - - Gift Card + - Cart responses: '200': description: OK @@ -1417,8 +1582,8 @@ paths: schema: type: object properties: - gift_card: - $ref: '#/components/schemas/gift_card' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1429,32 +1594,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/me/addresses: + '/carts/{id}/complete': post: - operationId: PostCustomersCustomerAddresses - summary: Add a Shipping Address - description: Adds a Shipping Address to a Customer's saved addresses. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: '#/components/schemas/address_fields' - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + summary: Complete a Cart + operationId: PostCartsCartComplete + description: >- + Completes a cart. The following steps will be performed. Payment + authorization is attempted and if more work is required, we simply + return the cart for further updates. If payment is authorized and order + is not yet created, we make sure to do so. The completion of a cart can + be performed idempotently with a provided header `Idempotency-Key`. If + not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -1464,65 +1621,66 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.addresses.addAddress({ - address: { - first_name: 'Celia', - last_name: 'Schumm', - address_1: '225 Bednar Curve', - city: 'Danielville', - country_code: 'US', - postal_code: '85137', - phone: '981-596-6748 x90188', - company: 'Wyman LLC', - address_2: '', - province: 'Georgia', - metadata: {} - } - }) + medusa.carts.complete(cart_id) - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/customers/me/addresses' \ - - --header 'Cookie: connect.sid={sid}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "address": { - "first_name": "Celia", - "last_name": "Schumm", - "address_1": "225 Bednar Curve", - "city": "Danielville", - "country_code": "US", - "postal_code": "85137" - } - }' - security: - - cookie_auth: [] + 'https://medusa-url.com/store/carts/{id}/complete' tags: - - Customer + - Cart responses: '200': - description: A successful response + description: >- + If a cart was successfully authorized, but requires further action + from the user the response body will contain the cart with an + updated payment session. If the Cart was successfully completed the + response body will contain the newly created Order. content: application/json: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + type: + type: string + description: The type of the data property. + enum: + - order + - cart + - swap + data: + type: object + description: >- + The data of the result object. Its type depends on the + type field. + oneOf: + - type: object + description: >- + Cart was successfully authorized and order was placed + successfully. + properties: + order: + $ref: '#/components/schemas/order' + - type: object + description: >- + Cart was successfully authorized but requires further + actions. + properties: + cart: + $ref: '#/components/schemas/cart' + - type: object + description: >- + When cart is used for a swap and it has been completed + successfully. + properties: + cart: + $ref: '#/components/schemas/swap' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1531,39 +1689,64 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers: + /carts: post: - operationId: PostCustomers - summary: Create a Customer - description: Creates a Customer account. + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. requestBody: content: application/json: schema: type: object - required: - - first_name - - last_name - - email - - password properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. + region_id: type: string - format: email - password: - description: The Customer's password. + description: The ID of the Region to create the Cart in. + sales_channel_id: type: string - format: password - phone: - description: The Customer's phone number. + description: >- + [EXPERIMENTAL] The ID of the Sales channel to create the + Cart in. + country_code: type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to + generate Line Items from. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: >- + The id of the Product Variant to generate a Line Item + from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The + `context` field is automatically populated with `ip` and + `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome x-codeSamples: - lang: JavaScript label: JS Client @@ -1573,42 +1756,27 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.customers.create({ - first_name: 'Alec', - last_name: 'Reynolds', - email: 'user@example.com', - password: 'supersecret' - }) + medusa.carts.create() - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Alec", - "last_name": "Reynolds", - "email": "user@example.com", - "password": "supersecret" - }' + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' tags: - - Customer + - Cart responses: '200': - description: OK + description: Successfully created a new Cart content: application/json: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1616,40 +1784,80 @@ paths: '409': $ref: '#/components/responses/invalid_state_error' '422': - description: A customer with the same email exists - content: - application/json: - schema: - type: object - properties: - code: - type: string - description: The error code - type: - type: string - description: The type of error - message: - type: string - description: Human-readable message with details about the error - example: - code: invalid_request_error - type: duplicate_error - message: >- - A customer with the given email already has an account. Log in - instead + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions': + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.createPaymentSessions(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customers/me/addresses/{address_id}': + '/carts/{id}/discounts/{code}': delete: - operationId: DeleteCustomersCustomerAddressesAddress - summary: Delete an Address - description: Removes an Address from the Customer's saved addresses. - x-authenticated: true + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount parameters: - in: path - name: address_id + name: id required: true - description: The id of the Address to remove. + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. schema: type: string x-codeSamples: @@ -1661,24 +1869,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.addresses.deleteAddress(address_id) + medusa.carts.deleteDiscount(cart_id, code) - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + 'https://medusa-url.com/store/carts/{id}/discounts/{code}' tags: - - Customer + - Cart responses: '200': description: OK @@ -1687,12 +1889,10 @@ paths: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1701,24 +1901,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostCustomersCustomerAddressesAddress - summary: Update a Shipping Address - description: Updates a Customer's saved Shipping Address. - x-authenticated: true + '/carts/{id}/line-items/{line_id}': + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. parameters: - in: path - name: address_id + name: id required: true - description: The id of the Address to update. + 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: - anyOf: - - $ref: '#/components/schemas/address_fields' x-codeSamples: - lang: JavaScript label: JS Client @@ -1728,32 +1928,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.addresses.updateAddress(address_id, { - first_name: 'Gina' - }) + medusa.carts.lineItems.delete(cart_id, line_id) - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - - --header 'Cookie: connect.sid={sid}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Gina" - }' - security: - - cookie_auth: [] + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' tags: - - Customer + - Cart responses: '200': description: OK @@ -1762,12 +1948,10 @@ paths: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1776,14 +1960,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/me: - get: - operationId: GetCustomersCustomer - summary: Get a Customer - description: >- - Retrieves a Customer - the Customer must be logged in to retrieve their - details. - x-authenticated: true + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + 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-codeSamples: - lang: JavaScript label: JS Client @@ -1793,24 +1986,26 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.retrieve() + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me' \ + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' tags: - - Customer + - Cart responses: '200': description: OK @@ -1819,12 +2014,10 @@ paths: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1833,42 +2026,39 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostCustomersCustomer - summary: Update Customer - description: Updates a Customer's saved details. - x-authenticated: true requestBody: content: application/json: schema: type: object + required: + - quantity properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object + quantity: + type: integer + description: The quantity to set the Line Item to. + '/carts/{id}/payment-sessions/{provider_id}': + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: >- + Deletes a Payment Session on a Cart. May be useful if a payment has + failed. + 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-codeSamples: - lang: JavaScript label: JS Client @@ -1878,32 +2068,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.update({ - first_name: 'Laury' - }) + medusa.carts.deletePaymentSession(cart_id, 'manual') - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me' \ - - --header 'Cookie: connect.sid={sid}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Laury" - }' - security: - - cookie_auth: [] + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' tags: - - Customer + - Cart responses: '200': description: OK @@ -1912,12 +2088,10 @@ paths: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1926,15 +2100,23 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/me/payment-methods: - get: - operationId: GetCustomersCustomerPaymentMethods - summary: Get Payment Methods - description: >- - Retrieves a list of a Customer's saved payment methods. Payment methods - are saved with Payment Providers and it is their responsibility to fetch - saved methods. - x-authenticated: true + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + 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 x-codeSamples: - lang: JavaScript label: JS Client @@ -1944,24 +2126,27 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.paymentMethods.list() + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) - .then(({ payment_methods }) => { - console.log(payment_methods.length); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me/payment-methods' \ + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + --header 'Content-Type: application/json' \ + + --data-raw '{ + "data": {} + }' tags: - - Customer + - Cart responses: '200': description: OK @@ -1970,24 +2155,10 @@ paths: schema: type: object properties: - payment_methods: - type: array - items: - properties: - provider_id: - type: string - description: >- - The id of the Payment Provider where the payment - method is saved. - data: - type: object - description: >- - The data needed for the Payment Provider to use the - saved payment method. + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -1996,175 +2167,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/me/orders: - get: - operationId: GetCustomersCustomerOrders - summary: List Orders - description: Retrieves a list of a Customer's Orders. - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching orders. - schema: - type: string - - in: query - name: id - description: Id of the order to search for. - schema: - type: string - - in: query - name: status - style: form - explode: false - description: Status to search for. - schema: - type: array - items: - type: string - - in: query - name: fulfillment_status - style: form - explode: false - description: Fulfillment status to search for. - schema: - type: array - items: - type: string - - in: query - name: payment_status - style: form - explode: false - description: Payment status to search for. - schema: - type: array - items: - type: string - - in: query - name: display_id - description: Display id to search for. - schema: - type: string - - in: query - name: cart_id - description: to search for. - schema: - type: string - - in: query - name: email - description: to search for. - schema: - type: string - - in: query - name: region_id - description: to search for. - schema: - type: string - - in: query - name: currency_code - style: form - explode: false - description: The 3 character ISO currency code to set prices based on. - 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: to search for. - schema: - type: string - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - 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: Date comparison for when resulting collections were updated. - 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: Date comparison for when resulting collections were canceled. - 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: How many orders to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The offset in the resulting orders. - schema: - type: integer - default: 0 - - in: query - name: fields - description: >- - (Comma separated string) Which fields should be included in the - resulting orders. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated string) Which relations should be expanded in the - resulting orders. + requestBody: + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + '/carts/{id}': + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. schema: type: string x-codeSamples: @@ -2176,24 +2199,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.listOrders() + medusa.carts.retrieve(cart_id) - .then(({ orders, limit, offset, count }) => { - console.log(orders); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/customers/me/orders' \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + 'https://medusa-url.com/store/carts/{id}' tags: - - Customer + - Cart responses: '200': description: OK @@ -2202,23 +2219,10 @@ paths: schema: type: object properties: - orders: - type: array - items: - $ref: '#/components/schemas/order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2227,26 +2231,83 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/password-token: post: - operationId: PostCustomersCustomerPasswordToken - summary: Request Password Reset - description: >- - Creates a reset password token to be used in a subsequent - /reset-password request. The password token should be sent out of band - e.g. via email and will not be returned. + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string requestBody: content: application/json: schema: type: object - required: - - email properties: + region_id: + type: string + description: The id of the Region to create the Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. email: - description: The email of the customer. type: string + description: An email to be used on the Cart. format: email + sales_channel_id: + type: string + description: The ID of the Sales channel to update the Cart with. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome x-codeSamples: - lang: JavaScript label: JS Client @@ -2256,37 +2317,164 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.customers.generatePasswordToken({ + medusa.carts.update(cart_id, { email: 'user@example.com' }) - .then(() => { - // successful - }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}' \ - .catch(() => { - // failed + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions/{provider_id}/refresh': + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the Cart - + this is usually not necessary. + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.refreshPaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' }) + + .then(({ cart }) => { + console.log(cart.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/customers/password-token' \ + 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com" + "provider_id": "manual" }' tags: - - Customer + - Cart responses: - '204': + '200': description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2295,34 +2483,29 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/password-reset: - post: - operationId: PostCustomersResetPassword - summary: Reset Password - description: >- - Resets a Customer's password using a password token created by a - previous /password-token request. requestBody: content: application/json: schema: type: object required: - - email - - password - - token + - provider_id properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token + provider_id: type: string + description: The ID of the Payment Provider. + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -2332,30 +2515,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.customers.resetPassword({ - email: 'user@example.com', - password: 'supersecret', - token: 'supersecrettoken' - }) + medusa.giftCards.retrieve(code) - .then(({ customer }) => { - console.log(customer.id); + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/password-reset' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com", - "password": "supersecret", - "token": "supersecrettoken" - }' + curl --location --request GET + 'https://medusa-url.com/store/gift-cards/{code}' tags: - - Customer + - Gift Card responses: '200': description: OK @@ -2364,12 +2535,10 @@ paths: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2810,181 +2979,11 @@ paths: required: - order_ids properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.orders.claimOrders({ - display_ids, - }) - - .then(() => { - // successful - }) - - .catch(() => { - // an error occurred - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/batch/customer/token' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "display_ids": ["id"], - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Invite - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/collections/{id}': - get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. - parameters: - - in: path - name: id - required: true - description: The id of the Product Collection - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.collections.retrieve(collection_id) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/collections/{id}' - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /collections: - get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. - parameters: - - in: query - name: offset - description: >- - The number of collections to skip before starting to collect the - collections set - schema: - type: integer - default: 0 - - in: query - name: limit - description: The number of collections to return - schema: - type: integer - default: 10 - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - 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: Date comparison for when resulting collections were updated. - 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 + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -2994,41 +2993,42 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.collections.list() + // must be previously logged in or use api token - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); + medusa.orders.claimOrders({ + display_ids, + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/collections' + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] tags: - - Collection + - Invite responses: '200': description: OK - content: - application/json: - schema: - type: object - properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -4190,107 +4190,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/return-reasons/{id}': - get: - operationId: GetReturnReasonsReason - summary: Get a Return Reason - description: Retrieves a Return Reason. - parameters: - - in: path - name: id - required: true - description: The id of the Return Reason. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.returnReasons.retrieve(reason_id) - - .then(({ return_reason }) => { - console.log(return_reason.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/return-reasons/{id}' - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /return-reasons: - get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.returnReasons.list() - - .then(({ return_reasons }) => { - console.log(return_reasons.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/return-reasons' - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - return_reasons: - type: array - items: - $ref: '#/components/schemas/return_reason' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /returns: post: operationId: PostReturns @@ -4403,6 +4302,107 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/return-reasons/{id}': + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.returnReasons.retrieve(reason_id) + + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/return-reasons/{id}' + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + return_reason: + $ref: '#/components/schemas/return_reason' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons: + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.returnReasons.list() + + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/return-reasons' + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/return_reason' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /shipping-options: get: operationId: GetShippingOptions diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 44c93cf5228f7..5f35d6cf56876 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -145,18 +145,14 @@ tags: servers: - url: 'https://api.medusa-commerce.com/store' paths: - '/carts/{id}/shipping-methods': + /auth: post: - operationId: PostCartsCartShippingMethod - description: Adds a Shipping Method to the Cart. - summary: Add a Shipping Method - parameters: - - in: path - name: id - required: true - description: The cart ID. - schema: - type: string + operationId: PostAuth + summary: Customer Login + description: >- + Logs a Customer in and authorizes them to view their details. Successful + authentication will set a session cookie in the Customer's browser. + parameters: [] x-codeSamples: - lang: JavaScript label: JS Client @@ -166,26 +162,25 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.addShippingMethod(cart_id, { - option_id + medusa.auth.authenticate({ + email: 'user@example.com', + password: 'user@example.com' }) - .then(({ cart }) => { - console.log(cart.id); + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/auth' \ --header 'Content-Type: application/json' \ - --data-raw '{ - "option_id": "{option_id}", + "email": "user@example.com", + "password": "supersecret" }' tags: - - Cart + - Auth responses: '200': description: OK @@ -194,10 +189,12 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' '404': $ref: '#/components/responses/not_found_error' '409': @@ -212,52 +209,39 @@ paths: schema: type: object required: - - option_id + - email + - password properties: - option_id: + email: type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/carts/{id}/taxes': - post: - summary: Calculate Cart Taxes - operationId: PostCartsCartTaxes - description: >- - Calculates taxes for a cart. Depending on the cart's region this may - involve making 3rd party API calls to a Tax Provider service. - parameters: - - in: path - name: id - required: true - description: The Cart ID. - schema: - type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + delete: + operationId: DeleteAuth + summary: Customer Log out + description: Destroys a Customer's authenticated session. + x-authenticated: true x-codeSamples: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/taxes' + curl --location --request DELETE 'https://medusa-url.com/store/auth' + \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Cart + - Auth responses: '200': description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -266,24 +250,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/complete': - post: - summary: Complete a Cart - operationId: PostCartsCartComplete - description: >- - Completes a cart. The following steps will be performed. Payment - authorization is attempted and if more work is required, we simply - return the cart for further updates. If payment is authorized and order - is not yet created, we make sure to do so. The completion of a cart can - be performed idempotently with a provided header `Idempotency-Key`. If - not provided, we will generate one for the request. - parameters: - - in: path - name: id - required: true - description: The Cart id. - schema: - type: string + get: + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -293,66 +264,36 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.complete(cart_id) + // must be previously logged - .then(({ cart }) => { - console.log(cart.id); + medusa.auth.getSession() + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/complete' + source: | + curl --location --request GET 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Cart + - Auth responses: '200': - description: >- - If a cart was successfully authorized, but requires further action - from the user the response body will contain the cart with an - updated payment session. If the Cart was successfully completed the - response body will contain the newly created Order. + description: OK content: application/json: schema: type: object properties: - type: - type: string - description: The type of the data property. - enum: - - order - - cart - - swap - data: - type: object - description: >- - The data of the result object. Its type depends on the - type field. - oneOf: - - type: object - description: >- - Cart was successfully authorized and order was placed - successfully. - properties: - order: - $ref: '#/components/schemas/order' - - type: object - description: >- - Cart was successfully authorized but requires further - actions. - properties: - cart: - $ref: '#/components/schemas/cart' - - type: object - description: >- - When cart is used for a swap and it has been completed - successfully. - properties: - cart: - $ref: '#/components/schemas/swap' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -361,64 +302,19 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /carts: - post: - summary: Create a Cart - operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. - requestBody: - content: - application/json: - schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the - Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome + '/auth/{email}': + get: + operationId: GetAuthEmail + summary: Check if email exists + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + schema: + type: string + format: email + required: true + description: The email to check if exists. x-codeSamples: - lang: JavaScript label: JS Client @@ -428,27 +324,27 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.create() - - .then(({ cart }) => { - console.log(cart.id); - }); + medusa.auth.exists('user@example.com') - lang: Shell label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/carts' + source: > + curl --location --request GET + 'https://medusa-url.com/store/auth/user@example.com' \ + + --header 'Cookie: connect.sid={sid}' tags: - - Cart + - Auth responses: '200': - description: Successfully created a new Cart + description: OK content: application/json: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + exists: + type: boolean + description: Whether email exists or not. '400': $ref: '#/components/responses/400_error' '404': @@ -459,18 +355,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. + '/collections/{id}': + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. parameters: - in: path name: id required: true - description: The id of the Cart. + description: The id of the Product Collection schema: type: string x-codeSamples: @@ -482,18 +376,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.createPaymentSessions(cart_id) + medusa.collections.retrieve(collection_id) - .then(({ cart }) => { - console.log(cart.id); + .then(({ collection }) => { + console.log(collection.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' + curl --location --request GET + 'https://medusa-url.com/store/collections/{id}' tags: - - Cart + - Collection responses: '200': description: OK @@ -502,8 +396,8 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + collection: + $ref: '#/components/schemas/product_collection' '400': $ref: '#/components/responses/400_error' '404': @@ -514,24 +408,70 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/discounts/{code}': - delete: - operationId: DeleteCartsCartDiscountsDiscount - description: Removes a Discount from a Cart. - summary: Remove Discount + /collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. parameters: - - in: path - name: id - required: true - description: The id of the Cart. + - in: query + name: offset + description: >- + The number of collections to skip before starting to collect the + collections set schema: - type: string - - in: path - name: code - required: true - description: The unique Discount code. + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return schema: - type: string + type: integer + default: 10 + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + 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: Date comparison for when resulting collections were updated. + 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 @@ -541,18 +481,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.deleteDiscount(cart_id, code) + medusa.collections.list() - .then(({ cart }) => { - console.log(cart.id); + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); }); - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + curl --location --request GET + 'https://medusa-url.com/store/collections' tags: - - Cart + - Collection responses: '200': description: OK @@ -561,8 +501,19 @@ paths: schema: type: object properties: - cart: - $ref: '#/components/schemas/cart' + collections: + type: array + items: + $ref: '#/components/schemas/product_collection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '404': @@ -573,22 +524,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items/{line_id}': - delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. + '/carts/{id}/shipping-methods': + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method 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. + description: The cart ID. schema: type: string x-codeSamples: @@ -600,7 +545,9 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.lineItems.delete(cart_id, line_id) + medusa.carts.addShippingMethod(cart_id, { + option_id + }) .then(({ cart }) => { console.log(cart.id); @@ -608,8 +555,14 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "option_id": "{option_id}", + }' tags: - Cart responses: @@ -632,50 +585,44 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to + process the fulfillment of the order. Look at the + documentation for your installed fulfillment providers to + find out what to send. + '/carts/{id}/taxes': post: - operationId: PostCartsCartLineItemsItem - summary: Update a Line Item - description: Updates a Line Item if the desired quantity can be fulfilled. + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: >- + Calculates taxes for a cart. Depending on the cart's region this may + involve making 3rd party API calls to a Tax Provider service. 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. + description: The Cart ID. schema: type: string x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.update(cart_id, line_id, { - quantity: 1 - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "quantity": 1 - }' + 'https://medusa-url.com/store/carts/{id}/taxes' tags: - Cart responses: @@ -698,37 +645,22 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': - delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session + '/carts/{id}/complete': + post: + summary: Complete a Cart + operationId: PostCartsCartComplete description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. + Completes a cart. The following steps will be performed. Payment + authorization is attempted and if more work is required, we simply + return the cart for further updates. If payment is authorized and order + is not yet created, we make sure to do so. The completion of a cart can + be performed idempotently with a provided header `Idempotency-Key`. If + not provided, we will generate one for the request. 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. + description: The Cart id. schema: type: string x-codeSamples: @@ -740,7 +672,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.deletePaymentSession(cart_id, 'manual') + medusa.carts.complete(cart_id) .then(({ cart }) => { console.log(cart.id); @@ -748,13 +680,147 @@ paths: - lang: Shell label: cURL source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/complete' tags: - Cart responses: '200': - description: OK + description: >- + If a cart was successfully authorized, but requires further action + from the user the response body will contain the cart with an + updated payment session. If the Cart was successfully completed the + response body will contain the newly created Order. + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The type of the data property. + enum: + - order + - cart + - swap + data: + type: object + description: >- + The data of the result object. Its type depends on the + type field. + oneOf: + - type: object + description: >- + Cart was successfully authorized and order was placed + successfully. + properties: + order: + $ref: '#/components/schemas/order' + - type: object + description: >- + Cart was successfully authorized but requires further + actions. + properties: + cart: + $ref: '#/components/schemas/cart' + - type: object + description: >- + When cart is used for a swap and it has been completed + successfully. + properties: + cart: + $ref: '#/components/schemas/swap' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. + requestBody: + content: + application/json: + schema: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: >- + [EXPERIMENTAL] The ID of the Sales channel to create the + Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to + generate Line Items from. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: >- + The id of the Product Variant to generate a Line Item + from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The + `context` field is automatically populated with `ip` and + `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.create() + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart content: application/json: schema: @@ -772,10 +838,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions': post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. parameters: - in: path name: id @@ -783,12 +852,6 @@ paths: 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 x-codeSamples: - lang: JavaScript label: JS Client @@ -798,10 +861,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.updatePaymentSession(cart_id, 'manual', { - data: { - } - }) + medusa.carts.createPaymentSessions(cart_id) .then(({ cart }) => { console.log(cart.id); @@ -810,13 +870,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "data": {} - }' + 'https://medusa-url.com/store/carts/{id}/payment-sessions' tags: - Cart responses: @@ -839,22 +893,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': - get: - operationId: GetCartsCart - summary: Get a Cart - description: Retrieves a Cart. + '/carts/{id}/discounts/{code}': + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount parameters: - in: path name: id @@ -862,6 +905,12 @@ paths: description: The id of the Cart. schema: type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -871,7 +920,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.retrieve(cart_id) + medusa.carts.deleteDiscount(cart_id, code) .then(({ cart }) => { console.log(cart.id); @@ -879,8 +928,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/carts/{id}' + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/discounts/{code}' tags: - Cart responses: @@ -903,10 +952,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCart - summary: Update a Cart - description: Updates a Cart. + '/carts/{id}/line-items/{line_id}': + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. parameters: - in: path name: id @@ -914,72 +964,12 @@ paths: description: The id of the Cart. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Gift Card is identified by. - type: string - discounts: - description: An array of Discount codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - customer_id: - description: The ID of the Customer to associate the Cart with. - type: string - context: - description: An optional object to provide context to the Cart. - type: object - example: - ip: '::1' - user_agent: Chrome + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -989,9 +979,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.update(cart_id, { - email: 'user@example.com' - }) + medusa.carts.lineItems.delete(cart_id, line_id) .then(({ cart }) => { console.log(cart.id); @@ -999,14 +987,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com" - }' + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' tags: - Cart responses: @@ -1029,13 +1011,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions/{provider_id}/refresh': post: - operationId: PostCartsCartPaymentSessionsSession - summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the Cart - - this is usually not necessary. + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. parameters: - in: path name: id @@ -1044,11 +1023,9 @@ paths: schema: type: string - in: path - name: provider_id + name: line_id required: true - description: >- - The id of the Payment Provider that created the Payment Session to - be refreshed. + description: The id of the Line Item. schema: type: string x-codeSamples: @@ -1060,7 +1037,9 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.refreshPaymentSession(cart_id, 'manual') + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) .then(({ cart }) => { console.log(cart.id); @@ -1069,7 +1048,13 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' tags: - Cart responses: @@ -1092,18 +1077,37 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-session': - post: - operationId: PostCartsCartPaymentSession - summary: Select a Payment Session + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + type: integer + description: The quantity to set the Line Item to. + '/carts/{id}/payment-sessions/{provider_id}': + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. + Deletes a Payment Session on a Cart. May be useful if a payment has + failed. parameters: - in: path name: id required: true - description: The ID of the Cart. + 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-codeSamples: @@ -1115,9 +1119,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.carts.setPaymentSession(cart_id, { - provider_id: 'manual' - }) + medusa.carts.deletePaymentSession(cart_id, 'manual') .then(({ cart }) => { console.log(cart.id); @@ -1125,14 +1127,8 @@ paths: - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "provider_id": "manual" - }' + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' tags: - Cart responses: @@ -1155,27 +1151,21 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. parameters: - in: path - name: code + name: id required: true - description: The unique Gift Card code. + 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 x-codeSamples: @@ -1187,18 +1177,27 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.giftCards.retrieve(code) + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) - .then(({ gift_card }) => { - console.log(gift_card.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "data": {} + }' tags: - - Gift Card + - Cart responses: '200': description: OK @@ -1207,8 +1206,8 @@ paths: schema: type: object properties: - gift_card: - $ref: '#/components/schemas/gift_card' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1219,16 +1218,27 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}': + requestBody: + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + '/carts/{id}': get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. parameters: - in: path name: id required: true - description: The id of the Product Collection + description: The id of the Cart. schema: type: string x-codeSamples: @@ -1240,18 +1250,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.collections.retrieve(collection_id) + medusa.carts.retrieve(cart_id) - .then(({ collection }) => { - console.log(collection.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/collections/{id}' + 'https://medusa-url.com/store/carts/{id}' tags: - - Collection + - Cart responses: '200': description: OK @@ -1260,8 +1270,8 @@ paths: schema: type: object properties: - collection: - $ref: '#/components/schemas/product_collection' + cart: + $ref: '#/components/schemas/cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1272,148 +1282,83 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /collections: - get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. + post: + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. parameters: - - in: query - name: offset - description: >- - The number of collections to skip before starting to collect the - collections set - schema: - type: integer - default: 0 - - in: query - name: limit - description: The number of collections to return + - in: path + name: id + required: true + description: The id of the Cart. schema: - type: integer - default: 10 - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - 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: Date comparison for when resulting collections were updated. - 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: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.collections.list() - - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/collections' - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customers/me/addresses: - post: - operationId: PostCustomersCustomerAddresses - summary: Add a Shipping Address - description: Adds a Shipping Address to a Customer's saved addresses. - x-authenticated: true + type: string requestBody: content: application/json: schema: type: object - required: - - address properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: '#/components/schemas/address_fields' - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + region_id: + type: string + description: The id of the Region to create the Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Cart. + format: email + sales_channel_id: + type: string + description: The ID of the Sales channel to update the Cart with. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome x-codeSamples: - lang: JavaScript label: JS Client @@ -1423,707 +1368,121 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.customers.addresses.addAddress({ - address: { - first_name: 'Celia', - last_name: 'Schumm', - address_1: '225 Bednar Curve', - city: 'Danielville', - country_code: 'US', - postal_code: '85137', - phone: '981-596-6748 x90188', - company: 'Wyman LLC', - address_2: '', - province: 'Georgia', - metadata: {} - } + medusa.carts.update(cart_id, { + email: 'user@example.com' }) - .then(({ customer }) => { - console.log(customer.id); + .then(({ cart }) => { + console.log(cart.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/customers/me/addresses' \ - - --header 'Cookie: connect.sid={sid}' \ + 'https://medusa-url.com/store/carts/{id}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "address": { - "first_name": "Celia", - "last_name": "Schumm", - "address_1": "225 Bednar Curve", - "city": "Danielville", - "country_code": "US", - "postal_code": "85137" - } + "email": "user@example.com" }' - security: - - cookie_auth: [] tags: - - Customer + - Cart responses: '200': - description: A successful response + description: OK content: application/json: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + cart: + $ref: '#/components/schemas/cart' '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customers: - post: - operationId: PostCustomers - summary: Create a Customer - description: Creates a Customer account. - requestBody: - content: - application/json: - schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.customers.create({ - first_name: 'Alec', - last_name: 'Reynolds', - email: 'user@example.com', - password: 'supersecret' - }) - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Alec", - "last_name": "Reynolds", - "email": "user@example.com", - "password": "supersecret" - }' - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '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' - '/customers/me/addresses/{address_id}': - delete: - operationId: DeleteCustomersCustomerAddressesAddress - summary: Delete an Address - description: Removes 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.customers.addresses.deleteAddress(address_id) - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCustomersCustomerAddressesAddress - summary: Update a Shipping Address - description: Updates a Customer's saved Shipping Address. - x-authenticated: true - parameters: - - in: path - name: address_id - required: true - description: The id of the Address to update. - schema: - type: string - requestBody: - content: - application/json: - schema: - anyOf: - - $ref: '#/components/schemas/address_fields' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.customers.addresses.updateAddress(address_id, { - first_name: 'Gina' - }) - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - - --header 'Cookie: connect.sid={sid}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Gina" - }' - security: - - cookie_auth: [] - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customers/me: - get: - operationId: GetCustomersCustomer - summary: Get a Customer - description: >- - Retrieves a Customer - the Customer must be logged in to retrieve their - details. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.customers.retrieve() - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me' \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCustomersCustomer - summary: Update Customer - description: Updates a Customer's saved details. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.customers.update({ - first_name: 'Laury' - }) - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me' \ - - --header 'Cookie: connect.sid={sid}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Laury" - }' - security: - - cookie_auth: [] - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customers/me/payment-methods: - get: - operationId: GetCustomersCustomerPaymentMethods - summary: Get Payment Methods - description: >- - Retrieves a list of a Customer's saved payment methods. Payment methods - are saved with Payment Providers and it is their responsibility to fetch - saved methods. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.customers.paymentMethods.list() - - .then(({ payment_methods }) => { - console.log(payment_methods.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me/payment-methods' \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment_methods: - type: array - items: - properties: - provider_id: - type: string - description: >- - The id of the Payment Provider where the payment - method is saved. - data: - type: object - description: >- - The data needed for the Payment Provider to use the - saved payment method. - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customers/me/orders: - get: - operationId: GetCustomersCustomerOrders - summary: List Orders - description: Retrieves a list of a Customer's Orders. - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching orders. - schema: - type: string - - in: query - name: id - description: Id of the order to search for. - schema: - type: string - - in: query - name: status - style: form - explode: false - description: Status to search for. - schema: - type: array - items: - type: string - - in: query - name: fulfillment_status - style: form - explode: false - description: Fulfillment status to search for. - schema: - type: array - items: - type: string - - in: query - name: payment_status - style: form - explode: false - description: Payment status to search for. - schema: - type: array - items: - type: string - - in: query - name: display_id - description: Display id to search for. - schema: - type: string - - in: query - name: cart_id - description: to search for. - schema: - type: string - - in: query - name: email - description: to search for. - schema: - type: string - - in: query - name: region_id - description: to search for. - schema: - type: string - - in: query - name: currency_code - style: form - explode: false - description: The 3 character ISO currency code to set prices based on. - 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: to search for. - schema: - type: string - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - 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: Date comparison for when resulting collections were updated. - 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: Date comparison for when resulting collections were canceled. - 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: How many orders to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The offset in the resulting orders. + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions/{provider_id}/refresh': + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the Cart - + this is usually not necessary. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. schema: - type: integer - default: 0 - - in: query - name: fields + type: string + - in: path + name: provider_id + required: true description: >- - (Comma separated string) Which fields should be included in the - resulting orders. + The id of the Payment Provider that created the Payment Session to + be refreshed. schema: type: string - - in: query - name: expand - description: >- - (Comma separated string) Which relations should be expanded in the - resulting orders. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.refreshPaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. schema: type: string x-codeSamples: @@ -2135,24 +1494,90 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) - medusa.customers.listOrders() + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - .then(({ orders, limit, offset, count }) => { - console.log(orders); + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.giftCards.retrieve(code) + + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/customers/me/orders' \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + 'https://medusa-url.com/store/gift-cards/{code}' tags: - - Customer + - Gift Card responses: '200': description: OK @@ -2161,23 +1586,10 @@ paths: schema: type: object properties: - orders: - type: array - items: - $ref: '#/components/schemas/order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2186,26 +1598,32 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/password-token: + /customers/me/addresses: post: - operationId: PostCustomersCustomerPasswordToken - summary: Request Password Reset - description: >- - Creates a reset password token to be used in a subsequent - /reset-password request. The password token should be sent out of band - e.g. via email and will not be returned. + operationId: PostCustomersCustomerAddresses + summary: Add a Shipping Address + description: Adds a Shipping Address to a Customer's saved addresses. + x-authenticated: true requestBody: content: application/json: schema: type: object required: - - email + - address properties: - email: - description: The email of the customer. - type: string - format: email + address: + description: The Address to add to the Customer. + allOf: + - $ref: '#/components/schemas/address_fields' + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code x-codeSamples: - lang: JavaScript label: JS Client @@ -2215,33 +1633,61 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.customers.generatePasswordToken({ - email: 'user@example.com' - }) + // must be previously logged - .then(() => { - // successful + medusa.customers.addresses.addAddress({ + address: { + first_name: 'Celia', + last_name: 'Schumm', + address_1: '225 Bednar Curve', + city: 'Danielville', + country_code: 'US', + postal_code: '85137', + phone: '981-596-6748 x90188', + company: 'Wyman LLC', + address_2: '', + province: 'Georgia', + metadata: {} + } }) - .catch(() => { - // failed - }) + .then(({ customer }) => { + console.log(customer.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/customers/password-token' \ + 'https://medusa-url.com/store/customers/me/addresses' \ + + --header 'Cookie: connect.sid={sid}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "email": "user@example.com" + "address": { + "first_name": "Celia", + "last_name": "Schumm", + "address_1": "225 Bednar Curve", + "city": "Danielville", + "country_code": "US", + "postal_code": "85137" + } }' + security: + - cookie_auth: [] tags: - Customer responses: - '204': - description: OK + '200': + description: A successful response + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2254,23 +1700,28 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /customers/password-reset: + /customers: post: - operationId: PostCustomersResetPassword - summary: Reset Password - description: >- - Resets a Customer's password using a password token created by a - previous /password-token request. + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. requestBody: content: application/json: schema: type: object required: + - first_name + - last_name - email - password - - token properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string email: description: The email of the customer. type: string @@ -2279,8 +1730,8 @@ paths: description: The Customer's password. type: string format: password - token: - description: The reset password token + phone: + description: The Customer's phone number. type: string x-codeSamples: - lang: JavaScript @@ -2291,10 +1742,11 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.customers.resetPassword({ + medusa.customers.create({ + first_name: 'Alec', + last_name: 'Reynolds', email: 'user@example.com', - password: 'supersecret', - token: 'supersecrettoken' + password: 'supersecret' }) .then(({ customer }) => { @@ -2304,14 +1756,15 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/customers/password-reset' \ + 'https://medusa-url.com/store/customers' \ --header 'Content-Type: application/json' \ --data-raw '{ + "first_name": "Alec", + "last_name": "Reynolds", "email": "user@example.com", - "password": "supersecret", - "token": "supersecrettoken" + "password": "supersecret" }' tags: - Customer @@ -2327,26 +1780,45 @@ paths: $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': $ref: '#/components/responses/invalid_state_error' '422': - $ref: '#/components/responses/invalid_request_error' + 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' - '/order-edits/{id}/complete': - post: - operationId: PostOrderEditsOrderEditComplete - summary: Completes an OrderEdit - description: Completes an OrderEdit. + '/customers/me/addresses/{address_id}': + delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresses. + x-authenticated: true parameters: - in: path - name: id + name: address_id required: true - description: The ID of the Order Edit. + description: The id of the Address to remove. schema: type: string x-codeSamples: @@ -2358,17 +1830,24 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.complete(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + // must be previously logged + + medusa.customers.addresses.deleteAddress(address_id) + + .then(({ customer }) => { + console.log(customer.id); + }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/order-edits/{id}/complete' + curl --location --request DELETE + 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - OrderEdit + - Customer responses: '200': description: OK @@ -2377,37 +1856,38 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/decline': post: - operationId: PostOrderEditsOrderEditDecline - summary: Decline an OrderEdit - description: Declines an OrderEdit. + operationId: PostCustomersCustomerAddressesAddress + summary: Update a Shipping Address + description: Updates a Customer's saved Shipping Address. + x-authenticated: true parameters: - in: path - name: id + name: address_id required: true - description: The ID of the OrderEdit. + description: The id of the Address to update. schema: type: string requestBody: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + anyOf: + - $ref: '#/components/schemas/address_fields' x-codeSamples: - lang: JavaScript label: JS Client @@ -2417,17 +1897,32 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.decline(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id); - }) + // must be previously logged + + medusa.customers.addresses.updateAddress(address_id, { + first_name: 'Gina' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/order-edits/{id}/decline' + 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Gina" + }' + security: + - cookie_auth: [] tags: - - OrderEdit + - Customer responses: '200': description: OK @@ -2436,28 +1931,113 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}': + /customers/me: get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string + operationId: GetCustomersCustomer + summary: Get a Customer + description: >- + Retrieves a Customer - the Customer must be logged in to retrieve their + details. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.retrieve() + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/customers/me' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update Customer + description: Updates a Customer's saved details. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address_fields' + description: The full billing address object + - type: string + description: The ID of an existing billing address + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -2467,18 +2047,32 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.retrieve(order_edit_id) + // must be previously logged - .then(({ order_edit }) => { - console.log(order_edit.id); + medusa.customers.update({ + first_name: 'Laury' + }) + + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/order-edits/{id}' + curl --location --request POST + 'https://medusa-url.com/store/customers/me' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Laury" + }' + security: + - cookie_auth: [] tags: - - OrderEdit + - Customer responses: '200': description: OK @@ -2487,8 +2081,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2501,23 +2095,15 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /orders/customer/confirm: - post: - operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept - summary: Verify a claim to orders + /customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Get Payment Methods description: >- - Verifies the claim order token provided to the customer upon request of - order ownership - requestBody: - content: - application/json: - schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + Retrieves a list of a Customer's saved payment methods. Payment methods + are saved with Payment Providers and it is their responsibility to fetch + saved methods. + x-authenticated: true x-codeSamples: - lang: JavaScript label: JS Client @@ -2527,38 +2113,46 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - - medusa.orders.confirmRequest( - token, - ) + // must be previously logged - .then(() => { - // successful - }) + medusa.customers.paymentMethods.list() - .catch(() => { - // an error occurred + .then(({ payment_methods }) => { + console.log(payment_methods.length); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/orders/customer/confirm' \ - - --header 'Content-Type: application/json' \ + curl --location --request GET + 'https://medusa-url.com/store/customers/me/payment-methods' \ - --data-raw '{ - "token": "{token}", - }' + --header 'Cookie: connect.sid={sid}' security: - - api_token: [] - cookie_auth: [] tags: - - Invite + - Customer responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + payment_methods: + type: array + items: + properties: + provider_id: + type: string + description: >- + The id of the Payment Provider where the payment + method is saved. + data: + type: object + description: >- + The data needed for the Payment Provider to use the + saved payment method. '400': $ref: '#/components/responses/400_error' '401': @@ -2571,71 +2165,175 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/cart/{cart_id}': + /customers/me/orders: get: - operationId: GetOrdersOrderCartId - summary: Get by Cart ID - description: >- - Retrieves an Order by the id of the Cart that was used to create the - Order. + operationId: GetCustomersCustomerOrders + summary: List Orders + description: Retrieves a list of a Customer's Orders. + x-authenticated: true parameters: - - in: path + - in: query + name: q + description: Query used for searching orders. + schema: + type: string + - in: query + name: id + description: Id of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + - in: query + name: display_id + description: Display id to search for. + schema: + type: string + - in: query name: cart_id - required: true - description: The ID of Cart. + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + description: to search for. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + 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: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + 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: Date comparison for when resulting collections were updated. + 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: Date comparison for when resulting collections were canceled. + 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: How many orders to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The offset in the resulting orders. + schema: + type: integer + default: 0 + - in: query + name: fields + description: >- + (Comma separated string) Which fields should be included in the + resulting orders. schema: type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.orders.retrieveByCartId(cart_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/orders/cart/{id}' - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/orders/{id}': - get: - operationId: GetOrdersOrder - summary: Get an Order - description: Retrieves an Order - parameters: - - in: path - name: id - required: true - description: The id of the Order. + - in: query + name: expand + description: >- + (Comma separated string) Which relations should be expanded in the + resulting orders. schema: type: string x-codeSamples: @@ -2647,18 +2345,24 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.retrieve(order_id) + // must be previously logged - .then(({ order }) => { - console.log(order.id); + medusa.customers.listOrders() + + .then(({ orders, limit, offset, count }) => { + console.log(orders); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/orders/{id}' + 'https://medusa-url.com/store/customers/me/orders' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] tags: - - Order + - Customer responses: '200': description: OK @@ -2667,10 +2371,23 @@ paths: schema: type: object properties: - order: - $ref: '#/components/schemas/order' + orders: + type: array + items: + $ref: '#/components/schemas/order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2679,38 +2396,26 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /orders: - get: - operationId: GetOrders - summary: Look Up an Order - description: Look up an order using filters. - parameters: - - in: query - name: display_id - required: true - description: The display id given to the Order. - schema: - type: number - - in: query - name: email - style: form - explode: false - description: The email associated with this order. - required: true - schema: - type: string - format: email - - in: query - name: shipping_address - style: form - explode: false - description: The shipping address associated with this order. - schema: - type: object - properties: - postal_code: - type: string - description: The postal code of the shipping address + /customers/password-token: + post: + operationId: PostCustomersCustomerPasswordToken + summary: Request Password Reset + description: >- + Creates a reset password token to be used in a subsequent + /reset-password request. The password token should be sent out of band + e.g. via email and will not be returned. + requestBody: + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + description: The email of the customer. + type: string + format: email x-codeSamples: - lang: JavaScript label: JS Client @@ -2720,33 +2425,37 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orders.lookupOrder({ - display_id: 1, + medusa.customers.generatePasswordToken({ email: 'user@example.com' }) - .then(({ order }) => { - console.log(order.id); - }); + .then(() => { + // successful + }) + + .catch(() => { + // failed + }) - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + curl --location --request POST + 'https://medusa-url.com/store/customers/password-token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' tags: - - Order + - Customer responses: - '200': + '204': description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2755,25 +2464,34 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /orders/batch/customer/token: + /customers/password-reset: post: - operationId: PostOrdersCustomerOrderClaim - summary: Claim orders for signed in account + operationId: PostCustomersResetPassword + summary: Reset Password description: >- - Sends an email to emails registered to orders provided with link to - transfer order ownership + Resets a Customer's password using a password token created by a + previous /password-token request. requestBody: content: application/json: schema: + type: object required: - - order_ids + - email + - password + - token properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + token: + description: The reset password token + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -2783,38 +2501,40 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - - medusa.orders.claimOrders({ - display_ids, - }) - - .then(() => { - // successful + medusa.customers.resetPassword({ + email: 'user@example.com', + password: 'supersecret', + token: 'supersecrettoken' }) - .catch(() => { - // an error occurred + .then(({ customer }) => { + console.log(customer.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/batch/customer/token' \ + 'https://medusa-url.com/store/customers/password-reset' \ --header 'Content-Type: application/json' \ --data-raw '{ - "display_ids": ["id"], + "email": "user@example.com", + "password": "supersecret", + "token": "supersecrettoken" }' - security: - - api_token: [] - - cookie_auth: [] tags: - - Invite + - Customer responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '401': @@ -3266,19 +2986,273 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.paymentCollections.refreshPaymentSession(payment_collection_id, - session_id, payload) + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id, payload) + + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.confirmRequest( + token, + ) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/orders/customer/confirm' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/cart/{cart_id}': + get: + operationId: GetOrdersOrderCartId + summary: Get by Cart ID + description: >- + Retrieves an Order 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieveByCartId(cart_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/cart/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieve(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/order' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: Look up an order using filters. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: email + style: form + explode: false + description: The email associated with this order. + required: true + schema: + type: string + format: email + - in: query + name: shipping_address + style: form + explode: false + description: The shipping address associated with this order. + schema: + type: object + properties: + postal_code: + type: string + description: The postal code of the shipping address + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.lookupOrder({ + display_id: 1, + email: 'user@example.com' + }) - .then(({ payment_session }) => { - console.log(payment_session.id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + curl --location --request GET + 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' tags: - - PaymentCollection + - Order responses: '200': description: OK @@ -3287,8 +3261,8 @@ paths: schema: type: object properties: - payment_session: - $ref: '#/components/schemas/payment_session' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '404': @@ -3299,14 +3273,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /auth: + /orders/batch/customer/token: post: - operationId: PostAuth - summary: Customer Login + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account description: >- - Logs a Customer in and authorizes them to view their details. Successful - authentication will set a session cookie in the Customer's browser. - parameters: [] + Sends an email to emails registered to orders provided with link to + transfer order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3316,39 +3301,42 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.auth.authenticate({ - email: 'user@example.com', - password: 'user@example.com' + // must be previously logged in or use api token + + medusa.orders.claimOrders({ + display_ids, }) - .then(({ customer }) => { - console.log(customer.id); + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred }); - lang: Shell label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/auth' \ + source: > + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + --header 'Content-Type: application/json' \ + --data-raw '{ - "email": "user@example.com", - "password": "supersecret" + "display_ids": ["id"], }' + security: + - api_token: [] + - cookie_auth: [] tags: - - Auth + - Invite responses: '200': description: OK - content: - application/json: - schema: - type: object - properties: - customer: - $ref: '#/components/schemas/customer' '400': $ref: '#/components/responses/400_error' '401': - $ref: '#/components/responses/incorrect_credentials' + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -3357,58 +3345,77 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. - delete: - operationId: DeleteAuth - summary: Customer Log out - description: Destroys a Customer's authenticated session. - x-authenticated: true + '/order-edits/{id}/complete': + post: + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orderEdits.complete(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > - curl --location --request DELETE 'https://medusa-url.com/store/auth' - \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + curl --location --request POST + 'https://medusa-url.com/store/order-edits/{id}/complete' tags: - - Auth + - OrderEdit responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - get: - operationId: GetAuth - summary: Get Current Customer - description: Gets the currently logged in Customer. - x-authenticated: true + '/order-edits/{id}/decline': + post: + operationId: PostOrderEditsOrderEditDecline + summary: Decline an OrderEdit + description: Declines an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. x-codeSamples: - lang: JavaScript label: JS Client @@ -3418,22 +3425,17 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged - - medusa.auth.getSession() - - .then(({ customer }) => { - console.log(customer.id); - }); + medusa.orderEdits.decline(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }) - lang: Shell label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/store/auth' \ - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] + source: > + curl --location --request POST + 'https://medusa-url.com/store/order-edits/{id}/decline' tags: - - Auth + - OrderEdit responses: '200': description: OK @@ -3442,33 +3444,28 @@ paths: schema: type: object properties: - customer: - $ref: '#/components/schemas/customer' + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/auth/{email}': + '/order-edits/{id}': get: - operationId: GetAuthEmail - summary: Check if email exists - description: Checks if a Customer with the given email has signed up. + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. parameters: - in: path - name: email + name: id + required: true + description: The ID of the OrderEdit. schema: type: string - format: email - required: true - description: The email to check if exists. x-codeSamples: - lang: JavaScript label: JS Client @@ -3478,16 +3475,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.auth.exists('user@example.com') + medusa.orderEdits.retrieve(order_edit_id) + + .then(({ order_edit }) => { + console.log(order_edit.id); + }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/auth/user@example.com' \ - - --header 'Cookie: connect.sid={sid}' + 'https://medusa-url.com/store/order-edits/{id}' tags: - - Auth + - OrderEdit responses: '200': description: OK @@ -3496,11 +3495,12 @@ paths: schema: type: object properties: - exists: - type: boolean - description: Whether email exists or not. + order_edit: + $ref: '#/components/schemas/order_edit' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index e379327bc364f..791c72fb6a360 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -145,6 +145,14 @@ tags: servers: - url: https://api.medusa-commerce.com/store paths: + /auth: + $ref: paths/auth.yaml + /auth/{email}: + $ref: paths/auth_{email}.yaml + /collections/{id}: + $ref: paths/collections_{id}.yaml + /collections: + $ref: paths/collections.yaml /carts/{id}/shipping-methods: $ref: paths/carts_{id}_shipping-methods.yaml /carts/{id}/taxes: @@ -169,10 +177,6 @@ paths: $ref: paths/carts_{id}_payment-session.yaml /gift-cards/{code}: $ref: paths/gift-cards_{code}.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /collections: - $ref: paths/collections.yaml /customers/me/addresses: $ref: paths/customers_me_addresses.yaml /customers: @@ -189,22 +193,6 @@ paths: $ref: paths/customers_password-token.yaml /customers/password-reset: $ref: paths/customers_password-reset.yaml - /order-edits/{id}/complete: - $ref: paths/order-edits_{id}_complete.yaml - /order-edits/{id}/decline: - $ref: paths/order-edits_{id}_decline.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml - /orders/customer/confirm: - $ref: paths/orders_customer_confirm.yaml - /orders/cart/{cart_id}: - $ref: paths/orders_cart_{cart_id}.yaml - /orders/{id}: - $ref: paths/orders_{id}.yaml - /orders: - $ref: paths/orders.yaml - /orders/batch/customer/token: - $ref: paths/orders_batch_customer_token.yaml /payment-collections/{id}/sessions/batch/authorize: $ref: paths/payment-collections_{id}_sessions_batch_authorize.yaml /payment-collections/{id}/sessions/{session_id}/authorize: @@ -217,10 +205,22 @@ paths: $ref: paths/payment-collections_{id}_sessions.yaml /payment-collections/{id}/sessions/{session_id}: $ref: paths/payment-collections_{id}_sessions_{session_id}.yaml - /auth: - $ref: paths/auth.yaml - /auth/{email}: - $ref: paths/auth_{email}.yaml + /orders/customer/confirm: + $ref: paths/orders_customer_confirm.yaml + /orders/cart/{cart_id}: + $ref: paths/orders_cart_{cart_id}.yaml + /orders/{id}: + $ref: paths/orders_{id}.yaml + /orders: + $ref: paths/orders.yaml + /orders/batch/customer/token: + $ref: paths/orders_batch_customer_token.yaml + /order-edits/{id}/complete: + $ref: paths/order-edits_{id}_complete.yaml + /order-edits/{id}/decline: + $ref: paths/order-edits_{id}_decline.yaml + /order-edits/{id}: + $ref: paths/order-edits_{id}.yaml /product-types: $ref: paths/product-types.yaml /products/{id}: From fef2d997b2225168f9e2f51b4940d58881e15fc9 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 14 Dec 2022 14:59:11 +0200 Subject: [PATCH 13/18] chore: removed reference directory (#2800) --- www/reference/.cache/.eslintrc.json | 9 - .../$virtual/async-requires.js | 8 - .../$virtual/loading-indicator.js | 6 - .../$virtual/match-paths.json | 1 - .../$virtual/ssr-sync-requires | 10 - .../$virtual/sync-requires.js | 10 - .../.cache/api-runner-browser-plugins.js | 13 - www/reference/.cache/api-runner-browser.js | 52 - www/reference/.cache/api-runner-ssr.js | 105 - www/reference/.cache/api-ssr-docs.js | 205 - www/reference/.cache/app.js | 257 - www/reference/.cache/async-requires.js | 8 - www/reference/.cache/babelState.json | 188 - www/reference/.cache/blank.css | 0 .../commonjs/api-runner-browser-plugins.js | 15 - .../.cache/commonjs/api-runner-browser.js | 55 - .../.cache/commonjs/api-runner-ssr.js | 101 - www/reference/.cache/commonjs/api-ssr-docs.js | 207 - www/reference/.cache/commonjs/app.js | 217 - .../.cache/commonjs/css-to-object.js | 21 - www/reference/.cache/commonjs/debug-log.js | 10 - www/reference/.cache/commonjs/default-html.js | 37 - www/reference/.cache/commonjs/dev-loader.js | 197 - .../.cache/commonjs/develop-static-entry.js | 149 - www/reference/.cache/commonjs/dummy.js | 7 - www/reference/.cache/commonjs/emitter.js | 12 - .../.cache/commonjs/ensure-resources.js | 126 - .../.cache/commonjs/error-overlay-handler.js | 42 - .../components/accordion.js | 93 - .../components/build-error.js | 52 - .../components/code-frame.js | 42 - .../components/dev-ssr-error.js | 58 - .../components/error-boundary.js | 33 - .../components/graphql-errors.js | 88 - .../fast-refresh-overlay/components/hooks.js | 55 - .../components/overlay.js | 161 - .../components/runtime-errors.js | 95 - .../fast-refresh-overlay/components/use-id.js | 56 - .../helpers/focus-trap.js | 3214 - .../fast-refresh-overlay/helpers/keys.js | 81 - .../fast-refresh-overlay/helpers/lock-body.js | 54 - .../fast-refresh-overlay/helpers/match.js | 47 - .../commonjs/fast-refresh-overlay/index.js | 182 - .../commonjs/fast-refresh-overlay/style.js | 423 - .../commonjs/fast-refresh-overlay/utils.js | 88 - www/reference/.cache/commonjs/find-path.js | 167 - .../.cache/commonjs/gatsby-browser-entry.js | 107 - www/reference/.cache/commonjs/loader.js | 592 - .../commonjs/loading-indicator/index.js | 34 - .../commonjs/loading-indicator/indicator.js | 72 - .../commonjs/loading-indicator/style.js | 107 - www/reference/.cache/commonjs/navigation.js | 323 - .../.cache/commonjs/normalize-page-path.js | 22 - .../.cache/commonjs/page-renderer.js | 54 - www/reference/.cache/commonjs/pages.json | 1 - .../.cache/commonjs/polyfill-entry.js | 7 - www/reference/.cache/commonjs/prefetch.js | 79 - .../.cache/commonjs/production-app.js | 208 - .../commonjs/public-page-renderer-dev.js | 33 - .../commonjs/public-page-renderer-prod.js | 38 - .../.cache/commonjs/public-page-renderer.js | 11 - .../.cache/commonjs/query-result-store.js | 144 - .../commonjs/react-lifecycles-compat.js | 3 - .../.cache/commonjs/redirect-utils.js | 30 - www/reference/.cache/commonjs/redirects.json | 1 - .../commonjs/register-service-worker.js | 66 - www/reference/.cache/commonjs/root.js | 113 - .../.cache/commonjs/route-announcer-props.js | 23 - .../server-utils/writable-as-promise.js | 41 - .../.cache/commonjs/shadow-portal.js | 41 - www/reference/.cache/commonjs/socketIo.js | 66 - .../ssr-builtin-trackers/child_process.js | 8 - .../commonjs/ssr-builtin-trackers/fs.js | 7 - .../commonjs/ssr-builtin-trackers/http.js | 9 - .../commonjs/ssr-builtin-trackers/http2.js | 7 - .../commonjs/ssr-builtin-trackers/https.js | 9 - .../tracking-unsafe-module-wrapper.js | 64 - .../commonjs/ssr-develop-static-entry.js | 339 - www/reference/.cache/commonjs/static-entry.js | 478 - www/reference/.cache/commonjs/strip-prefix.js | 24 - www/reference/.cache/css-to-object.js | 19 - www/reference/.cache/debug-log.js | 13 - www/reference/.cache/default-html.js | 36 - www/reference/.cache/dev-404-page.js | 275 - www/reference/.cache/dev-loader.js | 205 - www/reference/.cache/develop-static-entry.js | 127 - www/reference/.cache/dummy.js | 2 - www/reference/.cache/emitter.js | 4 - www/reference/.cache/ensure-resources.js | 110 - www/reference/.cache/error-overlay-handler.js | 36 - .../components/accordion.js | 83 - .../components/build-error.js | 46 - .../components/code-frame.js | 38 - .../components/dev-ssr-error.js | 66 - .../components/error-boundary.js | 14 - .../components/graphql-errors.js | 100 - .../fast-refresh-overlay/components/hooks.js | 47 - .../components/overlay.js | 143 - .../components/runtime-errors.js | 95 - .../fast-refresh-overlay/components/use-id.js | 56 - .../helpers/focus-trap.js | 3561 - .../fast-refresh-overlay/helpers/keys.js | 80 - .../fast-refresh-overlay/helpers/lock-body.js | 52 - .../fast-refresh-overlay/helpers/match.js | 42 - .../.cache/fast-refresh-overlay/index.js | 127 - .../.cache/fast-refresh-overlay/style.js | 413 - .../.cache/fast-refresh-overlay/utils.js | 77 - www/reference/.cache/find-path.js | 153 - www/reference/.cache/functions/manifest.json | 1 - www/reference/.cache/gatsby-browser-entry.js | 114 - www/reference/.cache/json/_api_store.json | 1 - www/reference/.cache/json/_dev-404-page_.json | 1 - www/reference/.cache/loader.js | 584 - .../.cache/loading-indicator/index.js | 19 - .../.cache/loading-indicator/indicator.js | 65 - .../.cache/loading-indicator/style.js | 99 - www/reference/.cache/match-paths.json | 1 - www/reference/.cache/navigation.js | 262 - www/reference/.cache/normalize-page-path.js | 12 - www/reference/.cache/page-renderer.js | 42 - www/reference/.cache/page-ssr/index.d.ts | 75 - www/reference/.cache/pages.json | 1 - www/reference/.cache/polyfill-entry.js | 5 - www/reference/.cache/prefetch.js | 80 - www/reference/.cache/production-app.js | 235 - .../.cache/public-page-renderer-dev.js | 21 - .../.cache/public-page-renderer-prod.js | 25 - www/reference/.cache/public-page-renderer.js | 9 - www/reference/.cache/query-engine/index.d.ts | 31 - www/reference/.cache/query-result-store.js | 132 - .../.cache/react-lifecycles-compat.js | 1 - www/reference/.cache/redirect-utils.js | 22 - www/reference/.cache/redirects.json | 1 - www/reference/.cache/redux/redux.node.state_0 | Bin 3342085 -> 0 bytes www/reference/.cache/redux/redux.page.state_0 | Bin 824587 -> 0 bytes www/reference/.cache/redux/redux.rest.state | Bin 55200 -> 0 bytes .../.cache/register-service-worker.js | 64 - www/reference/.cache/root.js | 117 - www/reference/.cache/route-announcer-props.js | 18 - .../server-utils/writable-as-promise.js | 35 - www/reference/.cache/shadow-portal.js | 28 - www/reference/.cache/socketIo.js | 58 - .../ssr-builtin-trackers/child_process.js | 4 - .../.cache/ssr-builtin-trackers/fs.js | 3 - .../.cache/ssr-builtin-trackers/http.js | 3 - .../.cache/ssr-builtin-trackers/http2.js | 3 - .../.cache/ssr-builtin-trackers/https.js | 3 - .../tracking-unsafe-module-wrapper.js | 64 - .../.cache/ssr-develop-static-entry.js | 355 - www/reference/.cache/static-entry.js | 481 - www/reference/.cache/strip-prefix.js | 20 - www/reference/.cache/sync-requires.js | 10 - www/reference/.cache/test-require-error.js | 21 - .../015d4113a846caf2e93a4b97632910ae.json.gz | Bin 2999 -> 0 bytes .../033623075e92ca619a468bfce29b535f.json.gz | Bin 301 -> 0 bytes .../042b377be7b58acf7805cadc0fb4783b.json.gz | Bin 3491 -> 0 bytes .../04b713345d648968639c0e50f70d8a46.json.gz | Bin 797 -> 0 bytes .../04c7dcf2293ee4315cf5462e7ea31824.json.gz | Bin 4183 -> 0 bytes .../082352dd786a29e89fba11666ebbba7f.json.gz | Bin 5956 -> 0 bytes .../0cfc6596f669cd9b43e2f5cfc0c3ce61.json.gz | Bin 3353 -> 0 bytes .../0dc39a1c2d7c95d9dd688d0095ac60c7.json.gz | Bin 3651 -> 0 bytes .../0dd8b2f60d6074c52cfa4421ef24d4bd.json.gz | Bin 1573 -> 0 bytes .../0f094606fe72b6645c674e803a248604.json.gz | Bin 1402 -> 0 bytes .../0f14a4dcb7a4f8b0ef7d61a2025452e3.json.gz | Bin 520 -> 0 bytes .../1104524969fcc601b76de217d140eec3.json.gz | Bin 3596 -> 0 bytes .../111d4db092fef209598e709af9fb89b3.json.gz | Bin 3517 -> 0 bytes .../11b47786d96b18ea1c4827329536d7af.json.gz | Bin 747 -> 0 bytes .../11c347ce6fcb2f1e88512dbe1342db01.json.gz | Bin 301 -> 0 bytes .../128cfe8d02bd0482537de26fd62af853.json.gz | Bin 594 -> 0 bytes .../13a4531c64b3980b78f112dddaa3e4bc.json.gz | Bin 6964 -> 0 bytes .../162e19c6d9f44b79cc7efa2be4430c05.json.gz | Bin 73276 -> 0 bytes .../17eaa1b073eb37c2a5e5b1b42cb0da49.json.gz | Bin 701 -> 0 bytes .../185ec746bfd4c2efc4326c0343761734.json.gz | Bin 1927 -> 0 bytes .../1917f4ad6cb9e8b58485e259f966ef14.json.gz | Bin 1109 -> 0 bytes .../1b9f95a0a633ed8c1b60818c1bf46195.json.gz | Bin 369 -> 0 bytes .../1fd94b5738e8791bc4ee00ff552a4e63.json.gz | Bin 611 -> 0 bytes .../205a8f6ddf7de5f8f5a9d11d4624a901.json.gz | Bin 298 -> 0 bytes .../209de03ec01bde2848ea4e60af98e18d.json.gz | Bin 2110 -> 0 bytes .../21c46e62f0a4660224b7257ac6b9be99.json.gz | Bin 777 -> 0 bytes .../2263ea0f81f0a3d6b0e2638e41c16e3d.json.gz | Bin 2939 -> 0 bytes .../2329716104d163d226a0b799fba1a8f3.json.gz | Bin 5641 -> 0 bytes .../258f2ee9e9b7d4c55bf936db9498533d.json.gz | Bin 4515 -> 0 bytes .../265256e4348446f37a810fb6e7611646.json.gz | Bin 672 -> 0 bytes .../288869b6b1907844df69dd5398513cbb.json.gz | Bin 1111 -> 0 bytes .../28a94d1ba85dc4df89a00a1ba2b7c862.json.gz | Bin 1975 -> 0 bytes .../28ef191545c8cdec6998d59f9ce1eac8.json.gz | Bin 984 -> 0 bytes .../2b4580bc115988115db813b155f9b275.json.gz | Bin 6316 -> 0 bytes .../2ceda5ab8c07240b231226213e520d1f.json.gz | Bin 4214 -> 0 bytes .../2e5b1f91df66b1636d175a805d66e50f.json.gz | Bin 6553 -> 0 bytes .../2eadea0fe2e1ac9459bbf787543d6342.json.gz | Bin 1323 -> 0 bytes .../2f0ed12cc58df02f1a7f9560574d6dba.json.gz | Bin 623 -> 0 bytes .../31d7e15cc611dca2416ed410ea084300.json.gz | Bin 617 -> 0 bytes .../3337ddda66f3f95fd1b2f6726f345a5c.json.gz | Bin 1111 -> 0 bytes .../339670e2d65f988e7c2a807da9dbe239.json.gz | Bin 2510 -> 0 bytes .../34ea0a4c90b4fc694ea43717f3ad18d2.json.gz | Bin 665 -> 0 bytes .../3857a26c52535bed5cfbfc6b3f6bdaad.json.gz | Bin 1446 -> 0 bytes .../38844de65b3300352d9d3d41e6ab9fc4.json.gz | Bin 1077 -> 0 bytes .../3a3c7f9634ada52564c78e58bb7d761e.json.gz | Bin 6613 -> 0 bytes .../3ec3a8c6719bbd89298e249b04c7e3af.json.gz | Bin 1955 -> 0 bytes .../41cf92fcfdf6d1a2300b705178cc9ea5.json.gz | Bin 312 -> 0 bytes .../439f60bb07a55522e1abf155af799f75.json.gz | Bin 594 -> 0 bytes .../45d200bad3dd82eb53510f108a468eec.json.gz | Bin 706 -> 0 bytes .../4619c29d4ff2f7bb9b899c6aa8e29bb1.json.gz | Bin 483 -> 0 bytes .../46de4af9d6f5037d89c8c4d9dad3e534.json.gz | Bin 1006 -> 0 bytes .../48aad34de990cc6e55430bf7227af431.json.gz | Bin 1760 -> 0 bytes .../49151f522eb3b4b276f4824949218a5e.json.gz | Bin 3133 -> 0 bytes .../49650eb1a64472d5f27123e9e2aec5d2.json.gz | Bin 1886 -> 0 bytes .../49829c2b8571610cca4ed525b3bb6bf0.json.gz | Bin 367 -> 0 bytes .../4999ecae964e780b6f890644a4b0c8f0.json.gz | Bin 2408 -> 0 bytes .../4afddafbc509bc6e2132394454621ac6.json.gz | Bin 701 -> 0 bytes .../4bf4a252212f8bef34df8fca2ad401d6.json.gz | Bin 2383 -> 0 bytes .../4c3127a24abddd90209ec0e4642b990a.json.gz | Bin 880 -> 0 bytes .../4de01715a52dc15a43a7917e19c84be4.json.gz | Bin 1114 -> 0 bytes .../50be3670e94e58a54b1ca24938b482ac.json.gz | Bin 362 -> 0 bytes .../52dbd9dd1dad7cb9265a3475790f9239.json.gz | Bin 362 -> 0 bytes .../55a3cd2d856ae99d7940e51531be08de.json.gz | Bin 4938 -> 0 bytes .../5649d348e6a1652d4355290c701fe68e.json.gz | Bin 980 -> 0 bytes .../59a161ec51fc62754d4804266b9eb858.json.gz | Bin 428 -> 0 bytes .../5a75b58c643413349e56fe6c0df50e33.json.gz | Bin 4452 -> 0 bytes .../5a8a71c3a1409b99e99bb080b820c673.json.gz | Bin 1786 -> 0 bytes .../5c09f6f69aee8437da60dcd9832a7d6d.json.gz | Bin 294 -> 0 bytes .../5de5f1c55b28f7e7874640e486762e5d.json.gz | Bin 428 -> 0 bytes .../5edb8c2e7a3ac3aa8ce9c8d8c9ca5395.json.gz | Bin 3411 -> 0 bytes .../5f92ee7d308cdec508b508197e487990.json.gz | Bin 2489 -> 0 bytes .../6102f6c1d7e4c7575ee0196e0d1d5391.json.gz | Bin 6102 -> 0 bytes .../6462f083f75c6c4822e8211b7dd1a893.json.gz | Bin 1949 -> 0 bytes .../65af28fc4948830eeac8944cef0c05d3.json.gz | Bin 2638 -> 0 bytes .../6da4c20065cef1bafc541a77eb66ad1f.json.gz | Bin 1101 -> 0 bytes .../71f99052274e4b538f07ee6dd57bf3b3.json.gz | Bin 291 -> 0 bytes .../7336eaa82ba8f8da23de435540c95874.json.gz | Bin 1114 -> 0 bytes .../738a55a6f23813b9e4c79ad09c6e3f3f.json.gz | Bin 639 -> 0 bytes .../769e867ce8baa4e83c10b7c1e63961b3.json.gz | Bin 2759 -> 0 bytes .../7a1cb938dbff90501bb2f29ba953aa01.json.gz | Bin 301 -> 0 bytes .../7b15b0ca049317ddda551a64a0afffea.json.gz | Bin 1983 -> 0 bytes .../7b6f5fbb4765295e31c21af8be9c5f70.json.gz | Bin 1735 -> 0 bytes .../7b8a2582af99139cacdb5ed9ae4c2d07.json.gz | Bin 1975 -> 0 bytes .../7c3e6f470f30004d3eae85171c0c6b6f.json.gz | Bin 623 -> 0 bytes .../808b667b73d4794a145885e7a8013540.json.gz | Bin 2043 -> 0 bytes .../81b26366217372ece7b99cf465cdb438.json.gz | Bin 6725 -> 0 bytes .../82fc230169c2860956990cd828bb12df.json.gz | Bin 2801 -> 0 bytes .../8492ae5290ca62814f4672c22bf5dfb8.json.gz | Bin 3536 -> 0 bytes .../8557bd3ec630fff82032853ed6642b62.json.gz | Bin 5372 -> 0 bytes .../859262b6bc3547fc050646af2f609ce7.json.gz | Bin 3396 -> 0 bytes .../878027adfc713cb098cfbefd78190e13.json.gz | Bin 846 -> 0 bytes .../8974b93c49a627f79308e4a826a459e0.json.gz | Bin 837 -> 0 bytes .../8a3bc1aa1759a4c00299a5a61787782f.json.gz | Bin 5359 -> 0 bytes .../8ab1589aa4b7b3bedc44020d887e6340.json.gz | Bin 500 -> 0 bytes .../8b1013d1b6d7f3e28dfc78af54e26b11.json.gz | Bin 797 -> 0 bytes .../8bcff0c9f5db20f40690b1f3d08e6ad1.json.gz | Bin 482 -> 0 bytes .../8c90c5754771f40d0148eeddeafc35f4.json.gz | Bin 1809 -> 0 bytes .../8cc11b904afbe3b8fc4d3ace1af08e7a.json.gz | Bin 623 -> 0 bytes .../8d16dbb83e0e55bc6348910248ef66b6.json.gz | Bin 617 -> 0 bytes .../91f450b5c53f8eb21a114d207ce8228f.json.gz | Bin 635 -> 0 bytes .../961894d6f9f3175b19a36502ec152678.json.gz | Bin 482 -> 0 bytes .../994bd5759529f890674b38481553faba.json.gz | Bin 796 -> 0 bytes .../9983e3eb9453aa34e7036abc492a2382.json.gz | Bin 1007 -> 0 bytes .../9bca92fc82ce98939961c50ecc7d83ca.json.gz | Bin 3518 -> 0 bytes .../9cfdea6857ce10e42802c4f6335f341a.json.gz | Bin 5641 -> 0 bytes .../9e8d613c20ef8ae1fd1f894c6acc751d.json.gz | Bin 312 -> 0 bytes .../9f5415d66a5a897e0c46963826c8e57b.json.gz | Bin 1696 -> 0 bytes .../a0057c46114ab16d2b4c711c6824ca9d.json.gz | Bin 651 -> 0 bytes .../a2c4265da17cdd3fa2f62891682efff3.json.gz | Bin 1536 -> 0 bytes .../a54a560ce1e1e4ce99bbd0f2e3065cd0.json.gz | Bin 3070 -> 0 bytes .../a74d745aa5f64c031f6a5a43aa662428.json.gz | Bin 1596 -> 0 bytes .../a85758c501fd3ec762ef06df35f19795.json.gz | Bin 3174 -> 0 bytes .../a9f5888250934bef1630b2538421deb7.json.gz | Bin 789 -> 0 bytes .../aa3c509d5b4d77eeb44cea2c21f85fa7.json.gz | Bin 1101 -> 0 bytes .../aa96cbd56c9dda2800e116d04e51df27.json.gz | Bin 1319 -> 0 bytes .../aacb46fdd2ee30dcc83ad5ee634e5cf0.json.gz | Bin 1342 -> 0 bytes .../ab7804944d0d185f1598abd099841997.json.gz | Bin 973 -> 0 bytes .../abe7dbe692ffe5ff2df2cd1113639cd5.json.gz | Bin 1758 -> 0 bytes .../aef0525fa6d08f81d71ea2b6fdf06864.json.gz | Bin 1053 -> 0 bytes .../aef662e91d99f2c56c24293da20641e2.json.gz | Bin 7357 -> 0 bytes .../b170bfc51b0858c13876930937bc5faf.json.gz | Bin 1128 -> 0 bytes .../b1d06f92d0f83c8e2f2feb3908b41936.json.gz | Bin 1077 -> 0 bytes .../b4e0d96f2a6524cf984c890175065d8f.json.gz | Bin 2346 -> 0 bytes .../bbadb51c186d52483a99eaf7e0ea5b47.json.gz | Bin 926 -> 0 bytes .../bc416a4f0d72d7aeaaa45f906e939817.json.gz | Bin 737 -> 0 bytes .../bfd3632fcc0a071ae490139a10c58ec9.json.gz | Bin 1062 -> 0 bytes .../c0461c206253887b507114b458638ec8.json.gz | Bin 1402 -> 0 bytes .../c3893159629a583cbc60adc0289879a2.json.gz | Bin 79558 -> 0 bytes .../c5b170cac3ec6d1eb37e50b4415bbbee.json.gz | Bin 14717 -> 0 bytes .../c5d5a81e8ae2b57b152d8c490388f0df.json.gz | Bin 2848 -> 0 bytes .../c643e2b0b6e8f6bf39f7f1a5f92fdff0.json.gz | Bin 2427 -> 0 bytes .../c7a085d8bcb4fdb71783e235bb926ccd.json.gz | Bin 10426 -> 0 bytes .../c86f66a2ae8e1da6d1cc540192a575be.json.gz | Bin 7511 -> 0 bytes .../ccc971bc8192fc92e9fbd3fc0b3ec6fc.json.gz | Bin 904 -> 0 bytes .../cd92ac8fb5476122f409b4819203b814.json.gz | Bin 1128 -> 0 bytes .../cfa06cee1250b7792f6b761083b4451b.json.gz | Bin 2043 -> 0 bytes .../cfe490f58a2f22dbcae9cdbef53a174f.json.gz | Bin 1158 -> 0 bytes .../d0a5bbdd13909da8f5839cec78ba3cdb.json.gz | Bin 4036 -> 0 bytes .../d1bcf168280357330f9096b590b6a577.json.gz | Bin 2149 -> 0 bytes .../d26ce0b8d793eea220b18009f4f3bd7c.json.gz | Bin 3471 -> 0 bytes .../d2e500f5578938c6e3f8dfc2800e1049.json.gz | Bin 2628 -> 0 bytes .../d6d6c6c6fa2fbd800cf3b2f71398d164.json.gz | Bin 2408 -> 0 bytes .../d78e8b03614106187f976be288f568e3.json.gz | Bin 505 -> 0 bytes .../daf7b58850b32af347b6f1467abdeaed.json.gz | Bin 301 -> 0 bytes .../db94db310c993364a8c35fdd25da865e.json.gz | Bin 789 -> 0 bytes .../df73e6ffaf29344e85586639481c0b37.json.gz | Bin 2848 -> 0 bytes .../e052568174650e14819eaf568a5cb3c1.json.gz | Bin 791 -> 0 bytes .../e123a3ab0851119dffcaf7eb049eeede.json.gz | Bin 1483 -> 0 bytes .../e32da57a17f8cb0900871a94fd06ec5e.json.gz | Bin 1575 -> 0 bytes .../e442334cd73e7b1bbd5d1d9d804d10b0.json.gz | Bin 7005 -> 0 bytes .../e461728c41df5365dacacb73eea670d3.json.gz | Bin 1155 -> 0 bytes .../e9de0244e20c6ad95e1ff42ee766b40b.json.gz | Bin 3301 -> 0 bytes .../ec3ac3b25c577d1004a1219b4d92abb0.json.gz | Bin 14717 -> 0 bytes .../ed88b3b414c98d321ebeef6124ed8a21.json.gz | Bin 1777 -> 0 bytes .../ef08c568b369f39a349072987ad73f0a.json.gz | Bin 1862 -> 0 bytes .../f3ccf7d5d8609871ebce32654a0c787a.json.gz | Bin 1123 -> 0 bytes .../f458c1320332085979d84d4e0d122926.json.gz | Bin 271 -> 0 bytes .../f4c8e3c1fce231cc3a716073ac82657e.json.gz | Bin 1450 -> 0 bytes .../f50374de8da48c5c0dfac51805dbcac1.json.gz | Bin 294 -> 0 bytes .../f7205672617f392250b753f186843989.json.gz | Bin 483 -> 0 bytes .../f759692c01585294a2ce8b6f840876a6.json.gz | Bin 1171 -> 0 bytes .../f7fede78e9464ab66446f38efa26b815.json.gz | Bin 2560 -> 0 bytes .../f8f77632a070d73858dd0bc4546a80bf.json.gz | Bin 1015 -> 0 bytes .../f95ead83cf063e25a87c96945af9a5a9.json.gz | Bin 6289 -> 0 bytes .../f9e69a4a542446dad6d89ef82a8bec09.json.gz | Bin 505 -> 0 bytes .../fbcd95d66e9f007908635adcde3aaa58.json.gz | Bin 614 -> 0 bytes .../.cache/webpack/stage-develop-html/0.pack | Bin 3677220 -> 0 bytes .../.cache/webpack/stage-develop-html/1.pack | Bin 6660375 -> 0 bytes .../.cache/webpack/stage-develop-html/2.pack | Bin 30929552 -> 0 bytes .../webpack/stage-develop-html/index.pack | Bin 3615994 -> 0 bytes .../webpack/stage-develop-html/index.pack.old | Bin 3394510 -> 0 bytes .../.cache/webpack/stage-develop/0.pack | Bin 51794424 -> 0 bytes .../.cache/webpack/stage-develop/index.pack | Bin 3722687 -> 0 bytes www/reference/public/chunk-map.json | 1 - www/reference/public/favicon.ico | Bin 3407 -> 0 bytes .../public/page-data/api/store/page-data.json | 5 - .../page-data/dev-404-page/page-data.json | 5 - .../public/page-data/sq/d/2744905544.json | 1 - www/reference/public/render-page.js | 73439 ---------------- www/reference/public/render-page.js.map | 1 - www/reference/public/webpack.stats.json | 1 - 334 files changed, 92817 deletions(-) delete mode 100644 www/reference/.cache/.eslintrc.json delete mode 100644 www/reference/.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js delete mode 100644 www/reference/.cache/_this_is_virtual_fs_path_/$virtual/loading-indicator.js delete mode 100644 www/reference/.cache/_this_is_virtual_fs_path_/$virtual/match-paths.json delete mode 100644 www/reference/.cache/_this_is_virtual_fs_path_/$virtual/ssr-sync-requires delete mode 100644 www/reference/.cache/_this_is_virtual_fs_path_/$virtual/sync-requires.js delete mode 100644 www/reference/.cache/api-runner-browser-plugins.js delete mode 100644 www/reference/.cache/api-runner-browser.js delete mode 100644 www/reference/.cache/api-runner-ssr.js delete mode 100644 www/reference/.cache/api-ssr-docs.js delete mode 100644 www/reference/.cache/app.js delete mode 100644 www/reference/.cache/async-requires.js delete mode 100644 www/reference/.cache/babelState.json delete mode 100644 www/reference/.cache/blank.css delete mode 100644 www/reference/.cache/commonjs/api-runner-browser-plugins.js delete mode 100644 www/reference/.cache/commonjs/api-runner-browser.js delete mode 100644 www/reference/.cache/commonjs/api-runner-ssr.js delete mode 100644 www/reference/.cache/commonjs/api-ssr-docs.js delete mode 100644 www/reference/.cache/commonjs/app.js delete mode 100644 www/reference/.cache/commonjs/css-to-object.js delete mode 100644 www/reference/.cache/commonjs/debug-log.js delete mode 100644 www/reference/.cache/commonjs/default-html.js delete mode 100644 www/reference/.cache/commonjs/dev-loader.js delete mode 100644 www/reference/.cache/commonjs/develop-static-entry.js delete mode 100644 www/reference/.cache/commonjs/dummy.js delete mode 100644 www/reference/.cache/commonjs/emitter.js delete mode 100644 www/reference/.cache/commonjs/ensure-resources.js delete mode 100644 www/reference/.cache/commonjs/error-overlay-handler.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/accordion.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/build-error.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/code-frame.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/dev-ssr-error.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/error-boundary.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/graphql-errors.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/hooks.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/overlay.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/runtime-errors.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/components/use-id.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/helpers/focus-trap.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/helpers/keys.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/helpers/lock-body.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/helpers/match.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/index.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/style.js delete mode 100644 www/reference/.cache/commonjs/fast-refresh-overlay/utils.js delete mode 100644 www/reference/.cache/commonjs/find-path.js delete mode 100644 www/reference/.cache/commonjs/gatsby-browser-entry.js delete mode 100644 www/reference/.cache/commonjs/loader.js delete mode 100644 www/reference/.cache/commonjs/loading-indicator/index.js delete mode 100644 www/reference/.cache/commonjs/loading-indicator/indicator.js delete mode 100644 www/reference/.cache/commonjs/loading-indicator/style.js delete mode 100644 www/reference/.cache/commonjs/navigation.js delete mode 100644 www/reference/.cache/commonjs/normalize-page-path.js delete mode 100644 www/reference/.cache/commonjs/page-renderer.js delete mode 100644 www/reference/.cache/commonjs/pages.json delete mode 100644 www/reference/.cache/commonjs/polyfill-entry.js delete mode 100644 www/reference/.cache/commonjs/prefetch.js delete mode 100644 www/reference/.cache/commonjs/production-app.js delete mode 100644 www/reference/.cache/commonjs/public-page-renderer-dev.js delete mode 100644 www/reference/.cache/commonjs/public-page-renderer-prod.js delete mode 100644 www/reference/.cache/commonjs/public-page-renderer.js delete mode 100644 www/reference/.cache/commonjs/query-result-store.js delete mode 100644 www/reference/.cache/commonjs/react-lifecycles-compat.js delete mode 100644 www/reference/.cache/commonjs/redirect-utils.js delete mode 100644 www/reference/.cache/commonjs/redirects.json delete mode 100644 www/reference/.cache/commonjs/register-service-worker.js delete mode 100644 www/reference/.cache/commonjs/root.js delete mode 100644 www/reference/.cache/commonjs/route-announcer-props.js delete mode 100644 www/reference/.cache/commonjs/server-utils/writable-as-promise.js delete mode 100644 www/reference/.cache/commonjs/shadow-portal.js delete mode 100644 www/reference/.cache/commonjs/socketIo.js delete mode 100644 www/reference/.cache/commonjs/ssr-builtin-trackers/child_process.js delete mode 100644 www/reference/.cache/commonjs/ssr-builtin-trackers/fs.js delete mode 100644 www/reference/.cache/commonjs/ssr-builtin-trackers/http.js delete mode 100644 www/reference/.cache/commonjs/ssr-builtin-trackers/http2.js delete mode 100644 www/reference/.cache/commonjs/ssr-builtin-trackers/https.js delete mode 100644 www/reference/.cache/commonjs/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js delete mode 100644 www/reference/.cache/commonjs/ssr-develop-static-entry.js delete mode 100644 www/reference/.cache/commonjs/static-entry.js delete mode 100644 www/reference/.cache/commonjs/strip-prefix.js delete mode 100644 www/reference/.cache/css-to-object.js delete mode 100644 www/reference/.cache/debug-log.js delete mode 100644 www/reference/.cache/default-html.js delete mode 100644 www/reference/.cache/dev-404-page.js delete mode 100644 www/reference/.cache/dev-loader.js delete mode 100644 www/reference/.cache/develop-static-entry.js delete mode 100644 www/reference/.cache/dummy.js delete mode 100644 www/reference/.cache/emitter.js delete mode 100644 www/reference/.cache/ensure-resources.js delete mode 100644 www/reference/.cache/error-overlay-handler.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/accordion.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/build-error.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/code-frame.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/dev-ssr-error.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/error-boundary.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/graphql-errors.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/hooks.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/overlay.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/runtime-errors.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/components/use-id.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/helpers/focus-trap.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/helpers/keys.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/helpers/lock-body.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/helpers/match.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/index.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/style.js delete mode 100644 www/reference/.cache/fast-refresh-overlay/utils.js delete mode 100644 www/reference/.cache/find-path.js delete mode 100644 www/reference/.cache/functions/manifest.json delete mode 100644 www/reference/.cache/gatsby-browser-entry.js delete mode 100644 www/reference/.cache/json/_api_store.json delete mode 100644 www/reference/.cache/json/_dev-404-page_.json delete mode 100644 www/reference/.cache/loader.js delete mode 100644 www/reference/.cache/loading-indicator/index.js delete mode 100644 www/reference/.cache/loading-indicator/indicator.js delete mode 100644 www/reference/.cache/loading-indicator/style.js delete mode 100644 www/reference/.cache/match-paths.json delete mode 100644 www/reference/.cache/navigation.js delete mode 100644 www/reference/.cache/normalize-page-path.js delete mode 100644 www/reference/.cache/page-renderer.js delete mode 100644 www/reference/.cache/page-ssr/index.d.ts delete mode 100644 www/reference/.cache/pages.json delete mode 100644 www/reference/.cache/polyfill-entry.js delete mode 100644 www/reference/.cache/prefetch.js delete mode 100644 www/reference/.cache/production-app.js delete mode 100644 www/reference/.cache/public-page-renderer-dev.js delete mode 100644 www/reference/.cache/public-page-renderer-prod.js delete mode 100644 www/reference/.cache/public-page-renderer.js delete mode 100644 www/reference/.cache/query-engine/index.d.ts delete mode 100644 www/reference/.cache/query-result-store.js delete mode 100644 www/reference/.cache/react-lifecycles-compat.js delete mode 100644 www/reference/.cache/redirect-utils.js delete mode 100644 www/reference/.cache/redirects.json delete mode 100644 www/reference/.cache/redux/redux.node.state_0 delete mode 100644 www/reference/.cache/redux/redux.page.state_0 delete mode 100644 www/reference/.cache/redux/redux.rest.state delete mode 100644 www/reference/.cache/register-service-worker.js delete mode 100644 www/reference/.cache/root.js delete mode 100644 www/reference/.cache/route-announcer-props.js delete mode 100644 www/reference/.cache/server-utils/writable-as-promise.js delete mode 100644 www/reference/.cache/shadow-portal.js delete mode 100644 www/reference/.cache/socketIo.js delete mode 100644 www/reference/.cache/ssr-builtin-trackers/child_process.js delete mode 100644 www/reference/.cache/ssr-builtin-trackers/fs.js delete mode 100644 www/reference/.cache/ssr-builtin-trackers/http.js delete mode 100644 www/reference/.cache/ssr-builtin-trackers/http2.js delete mode 100644 www/reference/.cache/ssr-builtin-trackers/https.js delete mode 100644 www/reference/.cache/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js delete mode 100644 www/reference/.cache/ssr-develop-static-entry.js delete mode 100644 www/reference/.cache/static-entry.js delete mode 100644 www/reference/.cache/strip-prefix.js delete mode 100644 www/reference/.cache/sync-requires.js delete mode 100644 www/reference/.cache/test-require-error.js delete mode 100644 www/reference/.cache/webpack/babel/015d4113a846caf2e93a4b97632910ae.json.gz delete mode 100644 www/reference/.cache/webpack/babel/033623075e92ca619a468bfce29b535f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/042b377be7b58acf7805cadc0fb4783b.json.gz delete mode 100644 www/reference/.cache/webpack/babel/04b713345d648968639c0e50f70d8a46.json.gz delete mode 100644 www/reference/.cache/webpack/babel/04c7dcf2293ee4315cf5462e7ea31824.json.gz delete mode 100644 www/reference/.cache/webpack/babel/082352dd786a29e89fba11666ebbba7f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/0cfc6596f669cd9b43e2f5cfc0c3ce61.json.gz delete mode 100644 www/reference/.cache/webpack/babel/0dc39a1c2d7c95d9dd688d0095ac60c7.json.gz delete mode 100644 www/reference/.cache/webpack/babel/0dd8b2f60d6074c52cfa4421ef24d4bd.json.gz delete mode 100644 www/reference/.cache/webpack/babel/0f094606fe72b6645c674e803a248604.json.gz delete mode 100644 www/reference/.cache/webpack/babel/0f14a4dcb7a4f8b0ef7d61a2025452e3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/1104524969fcc601b76de217d140eec3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/111d4db092fef209598e709af9fb89b3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/11b47786d96b18ea1c4827329536d7af.json.gz delete mode 100644 www/reference/.cache/webpack/babel/11c347ce6fcb2f1e88512dbe1342db01.json.gz delete mode 100644 www/reference/.cache/webpack/babel/128cfe8d02bd0482537de26fd62af853.json.gz delete mode 100644 www/reference/.cache/webpack/babel/13a4531c64b3980b78f112dddaa3e4bc.json.gz delete mode 100644 www/reference/.cache/webpack/babel/162e19c6d9f44b79cc7efa2be4430c05.json.gz delete mode 100644 www/reference/.cache/webpack/babel/17eaa1b073eb37c2a5e5b1b42cb0da49.json.gz delete mode 100644 www/reference/.cache/webpack/babel/185ec746bfd4c2efc4326c0343761734.json.gz delete mode 100644 www/reference/.cache/webpack/babel/1917f4ad6cb9e8b58485e259f966ef14.json.gz delete mode 100644 www/reference/.cache/webpack/babel/1b9f95a0a633ed8c1b60818c1bf46195.json.gz delete mode 100644 www/reference/.cache/webpack/babel/1fd94b5738e8791bc4ee00ff552a4e63.json.gz delete mode 100644 www/reference/.cache/webpack/babel/205a8f6ddf7de5f8f5a9d11d4624a901.json.gz delete mode 100644 www/reference/.cache/webpack/babel/209de03ec01bde2848ea4e60af98e18d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/21c46e62f0a4660224b7257ac6b9be99.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2263ea0f81f0a3d6b0e2638e41c16e3d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2329716104d163d226a0b799fba1a8f3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/258f2ee9e9b7d4c55bf936db9498533d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/265256e4348446f37a810fb6e7611646.json.gz delete mode 100644 www/reference/.cache/webpack/babel/288869b6b1907844df69dd5398513cbb.json.gz delete mode 100644 www/reference/.cache/webpack/babel/28a94d1ba85dc4df89a00a1ba2b7c862.json.gz delete mode 100644 www/reference/.cache/webpack/babel/28ef191545c8cdec6998d59f9ce1eac8.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2b4580bc115988115db813b155f9b275.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2ceda5ab8c07240b231226213e520d1f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2e5b1f91df66b1636d175a805d66e50f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2eadea0fe2e1ac9459bbf787543d6342.json.gz delete mode 100644 www/reference/.cache/webpack/babel/2f0ed12cc58df02f1a7f9560574d6dba.json.gz delete mode 100644 www/reference/.cache/webpack/babel/31d7e15cc611dca2416ed410ea084300.json.gz delete mode 100644 www/reference/.cache/webpack/babel/3337ddda66f3f95fd1b2f6726f345a5c.json.gz delete mode 100644 www/reference/.cache/webpack/babel/339670e2d65f988e7c2a807da9dbe239.json.gz delete mode 100644 www/reference/.cache/webpack/babel/34ea0a4c90b4fc694ea43717f3ad18d2.json.gz delete mode 100644 www/reference/.cache/webpack/babel/3857a26c52535bed5cfbfc6b3f6bdaad.json.gz delete mode 100644 www/reference/.cache/webpack/babel/38844de65b3300352d9d3d41e6ab9fc4.json.gz delete mode 100644 www/reference/.cache/webpack/babel/3a3c7f9634ada52564c78e58bb7d761e.json.gz delete mode 100644 www/reference/.cache/webpack/babel/3ec3a8c6719bbd89298e249b04c7e3af.json.gz delete mode 100644 www/reference/.cache/webpack/babel/41cf92fcfdf6d1a2300b705178cc9ea5.json.gz delete mode 100644 www/reference/.cache/webpack/babel/439f60bb07a55522e1abf155af799f75.json.gz delete mode 100644 www/reference/.cache/webpack/babel/45d200bad3dd82eb53510f108a468eec.json.gz delete mode 100644 www/reference/.cache/webpack/babel/4619c29d4ff2f7bb9b899c6aa8e29bb1.json.gz delete mode 100644 www/reference/.cache/webpack/babel/46de4af9d6f5037d89c8c4d9dad3e534.json.gz delete mode 100644 www/reference/.cache/webpack/babel/48aad34de990cc6e55430bf7227af431.json.gz delete mode 100644 www/reference/.cache/webpack/babel/49151f522eb3b4b276f4824949218a5e.json.gz delete mode 100644 www/reference/.cache/webpack/babel/49650eb1a64472d5f27123e9e2aec5d2.json.gz delete mode 100644 www/reference/.cache/webpack/babel/49829c2b8571610cca4ed525b3bb6bf0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/4999ecae964e780b6f890644a4b0c8f0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/4afddafbc509bc6e2132394454621ac6.json.gz delete mode 100644 www/reference/.cache/webpack/babel/4bf4a252212f8bef34df8fca2ad401d6.json.gz delete mode 100644 www/reference/.cache/webpack/babel/4c3127a24abddd90209ec0e4642b990a.json.gz delete mode 100644 www/reference/.cache/webpack/babel/4de01715a52dc15a43a7917e19c84be4.json.gz delete mode 100644 www/reference/.cache/webpack/babel/50be3670e94e58a54b1ca24938b482ac.json.gz delete mode 100644 www/reference/.cache/webpack/babel/52dbd9dd1dad7cb9265a3475790f9239.json.gz delete mode 100644 www/reference/.cache/webpack/babel/55a3cd2d856ae99d7940e51531be08de.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5649d348e6a1652d4355290c701fe68e.json.gz delete mode 100644 www/reference/.cache/webpack/babel/59a161ec51fc62754d4804266b9eb858.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5a75b58c643413349e56fe6c0df50e33.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5a8a71c3a1409b99e99bb080b820c673.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5c09f6f69aee8437da60dcd9832a7d6d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5de5f1c55b28f7e7874640e486762e5d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5edb8c2e7a3ac3aa8ce9c8d8c9ca5395.json.gz delete mode 100644 www/reference/.cache/webpack/babel/5f92ee7d308cdec508b508197e487990.json.gz delete mode 100644 www/reference/.cache/webpack/babel/6102f6c1d7e4c7575ee0196e0d1d5391.json.gz delete mode 100644 www/reference/.cache/webpack/babel/6462f083f75c6c4822e8211b7dd1a893.json.gz delete mode 100644 www/reference/.cache/webpack/babel/65af28fc4948830eeac8944cef0c05d3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/6da4c20065cef1bafc541a77eb66ad1f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/71f99052274e4b538f07ee6dd57bf3b3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/7336eaa82ba8f8da23de435540c95874.json.gz delete mode 100644 www/reference/.cache/webpack/babel/738a55a6f23813b9e4c79ad09c6e3f3f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/769e867ce8baa4e83c10b7c1e63961b3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/7a1cb938dbff90501bb2f29ba953aa01.json.gz delete mode 100644 www/reference/.cache/webpack/babel/7b15b0ca049317ddda551a64a0afffea.json.gz delete mode 100644 www/reference/.cache/webpack/babel/7b6f5fbb4765295e31c21af8be9c5f70.json.gz delete mode 100644 www/reference/.cache/webpack/babel/7b8a2582af99139cacdb5ed9ae4c2d07.json.gz delete mode 100644 www/reference/.cache/webpack/babel/7c3e6f470f30004d3eae85171c0c6b6f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/808b667b73d4794a145885e7a8013540.json.gz delete mode 100644 www/reference/.cache/webpack/babel/81b26366217372ece7b99cf465cdb438.json.gz delete mode 100644 www/reference/.cache/webpack/babel/82fc230169c2860956990cd828bb12df.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8492ae5290ca62814f4672c22bf5dfb8.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8557bd3ec630fff82032853ed6642b62.json.gz delete mode 100644 www/reference/.cache/webpack/babel/859262b6bc3547fc050646af2f609ce7.json.gz delete mode 100644 www/reference/.cache/webpack/babel/878027adfc713cb098cfbefd78190e13.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8974b93c49a627f79308e4a826a459e0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8a3bc1aa1759a4c00299a5a61787782f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8ab1589aa4b7b3bedc44020d887e6340.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8b1013d1b6d7f3e28dfc78af54e26b11.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8bcff0c9f5db20f40690b1f3d08e6ad1.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8c90c5754771f40d0148eeddeafc35f4.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8cc11b904afbe3b8fc4d3ace1af08e7a.json.gz delete mode 100644 www/reference/.cache/webpack/babel/8d16dbb83e0e55bc6348910248ef66b6.json.gz delete mode 100644 www/reference/.cache/webpack/babel/91f450b5c53f8eb21a114d207ce8228f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/961894d6f9f3175b19a36502ec152678.json.gz delete mode 100644 www/reference/.cache/webpack/babel/994bd5759529f890674b38481553faba.json.gz delete mode 100644 www/reference/.cache/webpack/babel/9983e3eb9453aa34e7036abc492a2382.json.gz delete mode 100644 www/reference/.cache/webpack/babel/9bca92fc82ce98939961c50ecc7d83ca.json.gz delete mode 100644 www/reference/.cache/webpack/babel/9cfdea6857ce10e42802c4f6335f341a.json.gz delete mode 100644 www/reference/.cache/webpack/babel/9e8d613c20ef8ae1fd1f894c6acc751d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/9f5415d66a5a897e0c46963826c8e57b.json.gz delete mode 100644 www/reference/.cache/webpack/babel/a0057c46114ab16d2b4c711c6824ca9d.json.gz delete mode 100644 www/reference/.cache/webpack/babel/a2c4265da17cdd3fa2f62891682efff3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/a54a560ce1e1e4ce99bbd0f2e3065cd0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/a74d745aa5f64c031f6a5a43aa662428.json.gz delete mode 100644 www/reference/.cache/webpack/babel/a85758c501fd3ec762ef06df35f19795.json.gz delete mode 100644 www/reference/.cache/webpack/babel/a9f5888250934bef1630b2538421deb7.json.gz delete mode 100644 www/reference/.cache/webpack/babel/aa3c509d5b4d77eeb44cea2c21f85fa7.json.gz delete mode 100644 www/reference/.cache/webpack/babel/aa96cbd56c9dda2800e116d04e51df27.json.gz delete mode 100644 www/reference/.cache/webpack/babel/aacb46fdd2ee30dcc83ad5ee634e5cf0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/ab7804944d0d185f1598abd099841997.json.gz delete mode 100644 www/reference/.cache/webpack/babel/abe7dbe692ffe5ff2df2cd1113639cd5.json.gz delete mode 100644 www/reference/.cache/webpack/babel/aef0525fa6d08f81d71ea2b6fdf06864.json.gz delete mode 100644 www/reference/.cache/webpack/babel/aef662e91d99f2c56c24293da20641e2.json.gz delete mode 100644 www/reference/.cache/webpack/babel/b170bfc51b0858c13876930937bc5faf.json.gz delete mode 100644 www/reference/.cache/webpack/babel/b1d06f92d0f83c8e2f2feb3908b41936.json.gz delete mode 100644 www/reference/.cache/webpack/babel/b4e0d96f2a6524cf984c890175065d8f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/bbadb51c186d52483a99eaf7e0ea5b47.json.gz delete mode 100644 www/reference/.cache/webpack/babel/bc416a4f0d72d7aeaaa45f906e939817.json.gz delete mode 100644 www/reference/.cache/webpack/babel/bfd3632fcc0a071ae490139a10c58ec9.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c0461c206253887b507114b458638ec8.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c3893159629a583cbc60adc0289879a2.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c5b170cac3ec6d1eb37e50b4415bbbee.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c5d5a81e8ae2b57b152d8c490388f0df.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c643e2b0b6e8f6bf39f7f1a5f92fdff0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c7a085d8bcb4fdb71783e235bb926ccd.json.gz delete mode 100644 www/reference/.cache/webpack/babel/c86f66a2ae8e1da6d1cc540192a575be.json.gz delete mode 100644 www/reference/.cache/webpack/babel/ccc971bc8192fc92e9fbd3fc0b3ec6fc.json.gz delete mode 100644 www/reference/.cache/webpack/babel/cd92ac8fb5476122f409b4819203b814.json.gz delete mode 100644 www/reference/.cache/webpack/babel/cfa06cee1250b7792f6b761083b4451b.json.gz delete mode 100644 www/reference/.cache/webpack/babel/cfe490f58a2f22dbcae9cdbef53a174f.json.gz delete mode 100644 www/reference/.cache/webpack/babel/d0a5bbdd13909da8f5839cec78ba3cdb.json.gz delete mode 100644 www/reference/.cache/webpack/babel/d1bcf168280357330f9096b590b6a577.json.gz delete mode 100644 www/reference/.cache/webpack/babel/d26ce0b8d793eea220b18009f4f3bd7c.json.gz delete mode 100644 www/reference/.cache/webpack/babel/d2e500f5578938c6e3f8dfc2800e1049.json.gz delete mode 100644 www/reference/.cache/webpack/babel/d6d6c6c6fa2fbd800cf3b2f71398d164.json.gz delete mode 100644 www/reference/.cache/webpack/babel/d78e8b03614106187f976be288f568e3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/daf7b58850b32af347b6f1467abdeaed.json.gz delete mode 100644 www/reference/.cache/webpack/babel/db94db310c993364a8c35fdd25da865e.json.gz delete mode 100644 www/reference/.cache/webpack/babel/df73e6ffaf29344e85586639481c0b37.json.gz delete mode 100644 www/reference/.cache/webpack/babel/e052568174650e14819eaf568a5cb3c1.json.gz delete mode 100644 www/reference/.cache/webpack/babel/e123a3ab0851119dffcaf7eb049eeede.json.gz delete mode 100644 www/reference/.cache/webpack/babel/e32da57a17f8cb0900871a94fd06ec5e.json.gz delete mode 100644 www/reference/.cache/webpack/babel/e442334cd73e7b1bbd5d1d9d804d10b0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/e461728c41df5365dacacb73eea670d3.json.gz delete mode 100644 www/reference/.cache/webpack/babel/e9de0244e20c6ad95e1ff42ee766b40b.json.gz delete mode 100644 www/reference/.cache/webpack/babel/ec3ac3b25c577d1004a1219b4d92abb0.json.gz delete mode 100644 www/reference/.cache/webpack/babel/ed88b3b414c98d321ebeef6124ed8a21.json.gz delete mode 100644 www/reference/.cache/webpack/babel/ef08c568b369f39a349072987ad73f0a.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f3ccf7d5d8609871ebce32654a0c787a.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f458c1320332085979d84d4e0d122926.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f4c8e3c1fce231cc3a716073ac82657e.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f50374de8da48c5c0dfac51805dbcac1.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f7205672617f392250b753f186843989.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f759692c01585294a2ce8b6f840876a6.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f7fede78e9464ab66446f38efa26b815.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f8f77632a070d73858dd0bc4546a80bf.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f95ead83cf063e25a87c96945af9a5a9.json.gz delete mode 100644 www/reference/.cache/webpack/babel/f9e69a4a542446dad6d89ef82a8bec09.json.gz delete mode 100644 www/reference/.cache/webpack/babel/fbcd95d66e9f007908635adcde3aaa58.json.gz delete mode 100644 www/reference/.cache/webpack/stage-develop-html/0.pack delete mode 100644 www/reference/.cache/webpack/stage-develop-html/1.pack delete mode 100644 www/reference/.cache/webpack/stage-develop-html/2.pack delete mode 100644 www/reference/.cache/webpack/stage-develop-html/index.pack delete mode 100644 www/reference/.cache/webpack/stage-develop-html/index.pack.old delete mode 100644 www/reference/.cache/webpack/stage-develop/0.pack delete mode 100644 www/reference/.cache/webpack/stage-develop/index.pack delete mode 100644 www/reference/public/chunk-map.json delete mode 100644 www/reference/public/favicon.ico delete mode 100644 www/reference/public/page-data/api/store/page-data.json delete mode 100644 www/reference/public/page-data/dev-404-page/page-data.json delete mode 100644 www/reference/public/page-data/sq/d/2744905544.json delete mode 100644 www/reference/public/render-page.js delete mode 100644 www/reference/public/render-page.js.map delete mode 100644 www/reference/public/webpack.stats.json diff --git a/www/reference/.cache/.eslintrc.json b/www/reference/.cache/.eslintrc.json deleted file mode 100644 index 7396d0ec0c261..0000000000000 --- a/www/reference/.cache/.eslintrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "env": { - "browser": true - }, - "globals": { - "__PATH_PREFIX__": false, - "___emitter": false - } -} diff --git a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js b/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js deleted file mode 100644 index c0e552177e7ec..0000000000000 --- a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js +++ /dev/null @@ -1,8 +0,0 @@ -// prefer default export if available -const preferDefault = m => (m && m.default) || m - -exports.components = { - "component---cache-dev-404-page-js": () => import("./../../dev-404-page.js" /* webpackChunkName: "component---cache-dev-404-page-js" */), - "component---src-templates-reference-page-js": () => import("./../../../src/templates/reference-page.js" /* webpackChunkName: "component---src-templates-reference-page-js" */) -} - diff --git a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/loading-indicator.js b/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/loading-indicator.js deleted file mode 100644 index 4e10d23a97259..0000000000000 --- a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/loading-indicator.js +++ /dev/null @@ -1,6 +0,0 @@ - - export function isLoadingIndicatorEnabled() { - return `Cypress` in window - ? false - : true - } \ No newline at end of file diff --git a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/match-paths.json b/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/match-paths.json deleted file mode 100644 index 0637a088a01e8..0000000000000 --- a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/match-paths.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/ssr-sync-requires b/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/ssr-sync-requires deleted file mode 100644 index fea9261c1254c..0000000000000 --- a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/ssr-sync-requires +++ /dev/null @@ -1,10 +0,0 @@ - - // prefer default export if available - const preferDefault = m => (m && m.default) || m - - -exports.ssrComponents = { - "component---cache-dev-404-page-js": preferDefault(require("/Users/oliverjuhl/Desktop/medusa/core/www/reference/.cache/dev-404-page.js")), - "component---src-templates-reference-page-js": preferDefault(require("/Users/oliverjuhl/Desktop/medusa/core/www/reference/src/templates/reference-page.js")) - } - diff --git a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/sync-requires.js b/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/sync-requires.js deleted file mode 100644 index af1eeaa156fbc..0000000000000 --- a/www/reference/.cache/_this_is_virtual_fs_path_/$virtual/sync-requires.js +++ /dev/null @@ -1,10 +0,0 @@ - -// prefer default export if available -const preferDefault = m => (m && m.default) || m - - -exports.components = { - "component---cache-dev-404-page-js": preferDefault(require("/Users/oliverjuhl/Desktop/medusa/core/www/reference/.cache/dev-404-page.js")), - "component---src-templates-reference-page-js": preferDefault(require("/Users/oliverjuhl/Desktop/medusa/core/www/reference/src/templates/reference-page.js")) -} - diff --git a/www/reference/.cache/api-runner-browser-plugins.js b/www/reference/.cache/api-runner-browser-plugins.js deleted file mode 100644 index 679d65f3c8997..0000000000000 --- a/www/reference/.cache/api-runner-browser-plugins.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = [{ - plugin: require('../node_modules/gatsby-plugin-anchor-links/gatsby-browser.js'), - options: {"plugins":[],"offset":-100,"duration":1000}, - },{ - plugin: require('../node_modules/gatsby-remark-autolink-headers/gatsby-browser.js'), - options: {"plugins":[],"elements":["h2","h3","h4"],"offsetY":0,"className":"anchor"}, - },{ - plugin: require('../node_modules/gatsby-plugin-theme-ui/gatsby-browser.js'), - options: {"plugins":[]}, - },{ - plugin: require('../gatsby-browser.js'), - options: {"plugins":[]}, - }] diff --git a/www/reference/.cache/api-runner-browser.js b/www/reference/.cache/api-runner-browser.js deleted file mode 100644 index c65337c9a37cf..0000000000000 --- a/www/reference/.cache/api-runner-browser.js +++ /dev/null @@ -1,52 +0,0 @@ -const plugins = require(`./api-runner-browser-plugins`) -const { getResourceURLsForPathname, loadPage, loadPageSync } = - require(`./loader`).publicLoader - -exports.apiRunner = (api, args = {}, defaultReturn, argTransform) => { - // Hooks for gatsby-cypress's API handler - if (process.env.CYPRESS_SUPPORT) { - if (window.___apiHandler) { - window.___apiHandler(api) - } else if (window.___resolvedAPIs) { - window.___resolvedAPIs.push(api) - } else { - window.___resolvedAPIs = [api] - } - } - - let results = plugins.map(plugin => { - if (!plugin.plugin[api]) { - return undefined - } - - args.getResourceURLsForPathname = getResourceURLsForPathname - args.loadPage = loadPage - args.loadPageSync = loadPageSync - - const result = plugin.plugin[api](args, plugin.options) - if (result && argTransform) { - args = argTransform({ args, result, plugin }) - } - return result - }) - - // Filter out undefined results. - results = results.filter(result => typeof result !== `undefined`) - - if (results.length > 0) { - return results - } else if (defaultReturn) { - return [defaultReturn] - } else { - return [] - } -} - -exports.apiRunnerAsync = (api, args, defaultReturn) => - plugins.reduce( - (previous, next) => - next.plugin[api] - ? previous.then(() => next.plugin[api](args, next.options)) - : previous, - Promise.resolve() - ) diff --git a/www/reference/.cache/api-runner-ssr.js b/www/reference/.cache/api-runner-ssr.js deleted file mode 100644 index 5a6f60fff899c..0000000000000 --- a/www/reference/.cache/api-runner-ssr.js +++ /dev/null @@ -1,105 +0,0 @@ -var plugins = [{ - name: 'gatsby-plugin-react-helmet', - plugin: require('/Users/oliverjuhl/Desktop/medusa/core/www/reference/node_modules/gatsby-plugin-react-helmet/gatsby-ssr'), - options: {"plugins":[]}, - },{ - name: 'gatsby-remark-autolink-headers', - plugin: require('/Users/oliverjuhl/Desktop/medusa/core/www/reference/node_modules/gatsby-remark-autolink-headers/gatsby-ssr'), - options: {"plugins":[],"elements":["h2","h3","h4"],"offsetY":0,"className":"anchor"}, - },{ - name: 'gatsby-plugin-theme-ui', - plugin: require('/Users/oliverjuhl/Desktop/medusa/core/www/reference/node_modules/gatsby-plugin-theme-ui/gatsby-ssr'), - options: {"plugins":[]}, - },{ - name: 'default-site-plugin', - plugin: require('/Users/oliverjuhl/Desktop/medusa/core/www/reference/gatsby-ssr'), - options: {"plugins":[]}, - }] -/* global plugins */ -// During bootstrap, we write requires at top of this file which looks like: -// var plugins = [ -// { -// plugin: require("/path/to/plugin1/gatsby-ssr.js"), -// options: { ... }, -// }, -// { -// plugin: require("/path/to/plugin2/gatsby-ssr.js"), -// options: { ... }, -// }, -// ] - -const apis = require(`./api-ssr-docs`) - -function augmentErrorWithPlugin(plugin, err) { - if (plugin.name !== `default-site-plugin`) { - // default-site-plugin is user code and will print proper stack trace, - // so no point in annotating error message pointing out which plugin is root of the problem - err.message += ` (from plugin: ${plugin.name})` - } - - throw err -} - -export function apiRunner(api, args, defaultReturn, argTransform) { - if (!apis[api]) { - console.log(`This API doesn't exist`, api) - } - - const results = [] - plugins.forEach(plugin => { - const apiFn = plugin.plugin[api] - if (!apiFn) { - return - } - - try { - const result = apiFn(args, plugin.options) - - if (result && argTransform) { - args = argTransform({ args, result }) - } - - // This if case keeps behaviour as before, we should allow undefined here as the api is defined - // TODO V4 - if (typeof result !== `undefined`) { - results.push(result) - } - } catch (e) { - augmentErrorWithPlugin(plugin, e) - } - }) - - return results.length ? results : [defaultReturn] -} - -export async function apiRunnerAsync(api, args, defaultReturn, argTransform) { - if (!apis[api]) { - console.log(`This API doesn't exist`, api) - } - - const results = [] - for (const plugin of plugins) { - const apiFn = plugin.plugin[api] - if (!apiFn) { - continue - } - - try { - const result = await apiFn(args, plugin.options) - - if (result && argTransform) { - args = argTransform({ args, result }) - } - - // This if case keeps behaviour as before, we should allow undefined here as the api is defined - // TODO V4 - if (typeof result !== `undefined`) { - results.push(result) - } - } catch (e) { - augmentErrorWithPlugin(plugin, e) - } - } - - return results.length ? results : [defaultReturn] -} diff --git a/www/reference/.cache/api-ssr-docs.js b/www/reference/.cache/api-ssr-docs.js deleted file mode 100644 index 2fead5cdf1a58..0000000000000 --- a/www/reference/.cache/api-ssr-docs.js +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Object containing options defined in `gatsby-config.js` - * @typedef {object} pluginOptions - */ - -/** - * Replace the default server renderer. This is useful for integration with - * Redux, css-in-js libraries, etc. that need custom setups for server - * rendering. - * @param {object} $0 - * @param {string} $0.pathname The pathname of the page currently being rendered. - * @param {ReactNode} $0.bodyComponent The React element to be rendered as the page body - * @param {function} $0.replaceBodyHTMLString Call this with the HTML string - * you render. **WARNING** if multiple plugins implement this API it's the - * last plugin that "wins". TODO implement an automated warning against this. - * @param {function} $0.setHeadComponents Takes an array of components as its - * first argument which are added to the `headComponents` array which is passed - * to the `html.js` component. - * @param {function} $0.setHtmlAttributes Takes an object of props which will - * spread into the `` component. - * @param {function} $0.setBodyAttributes Takes an object of props which will - * spread into the `` component. - * @param {function} $0.setPreBodyComponents Takes an array of components as its - * first argument which are added to the `preBodyComponents` array which is passed - * to the `html.js` component. - * @param {function} $0.setPostBodyComponents Takes an array of components as its - * first argument which are added to the `postBodyComponents` array which is passed - * to the `html.js` component. - * @param {function} $0.setBodyProps Takes an object of data which - * is merged with other body props and passed to `html.js` as `bodyProps`. - * @param {pluginOptions} pluginOptions - * @example - * // From gatsby-plugin-glamor - * const { renderToString } = require("react-dom/server") - * const inline = require("glamor-inline") - * - * exports.replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => { - * const bodyHTML = renderToString(bodyComponent) - * const inlinedHTML = inline(bodyHTML) - * - * replaceBodyHTMLString(inlinedHTML) - * } - */ -exports.replaceRenderer = true - -/** - * Called after every page Gatsby server renders while building HTML so you can - * set head and body components to be rendered in your `html.js`. - * - * Gatsby does a two-pass render for HTML. It loops through your pages first - * rendering only the body and then takes the result body HTML string and - * passes it as the `body` prop to your `html.js` to complete the render. - * - * It's often handy to be able to send custom components to your `html.js`. - * For example, it's a very common pattern for React.js libraries that - * support server rendering to pull out data generated during the render to - * add to your HTML. - * - * Using this API over [`replaceRenderer`](#replaceRenderer) is preferable as - * multiple plugins can implement this API where only one plugin can take - * over server rendering. However, if your plugin requires taking over server - * rendering then that's the one to - * use - * @param {object} $0 - * @param {string} $0.pathname The pathname of the page currently being rendered. - * @param {function} $0.setHeadComponents Takes an array of components as its - * first argument which are added to the `headComponents` array which is passed - * to the `html.js` component. - * @param {function} $0.setHtmlAttributes Takes an object of props which will - * spread into the `` component. - * @param {function} $0.setBodyAttributes Takes an object of props which will - * spread into the `` component. - * @param {function} $0.setPreBodyComponents Takes an array of components as its - * first argument which are added to the `preBodyComponents` array which is passed - * to the `html.js` component. - * @param {function} $0.setPostBodyComponents Takes an array of components as its - * first argument which are added to the `postBodyComponents` array which is passed - * to the `html.js` component. - * @param {function} $0.setBodyProps Takes an object of data which - * is merged with other body props and passed to `html.js` as `bodyProps`. - * @param {pluginOptions} pluginOptions - * @example - * // Import React so that you can use JSX in HeadComponents - * const React = require("react") - * - * const HtmlAttributes = { - * lang: "en" - * } - * - * const HeadComponents = [ - *