diff --git a/.github/workflows/generate-reference.yml b/.github/workflows/generate-reference.yml index 5e6c5531c5..4390f995be 100644 --- a/.github/workflows/generate-reference.yml +++ b/.github/workflows/generate-reference.yml @@ -1,6 +1,8 @@ name: Generate References -on: - push: +on: + pull_request: + types: + - closed branches: - "master" paths: @@ -17,6 +19,7 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.5 with: + token: ${{ secrets.REFERENCE_PAT }} fetch-depth: 0 - name: Setup Node.js environment @@ -37,7 +40,7 @@ jobs: run: yarn generate:services - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Automatically Generated Services Reference + with: + commit_message: "docs: automatically Generated Services Reference" file_pattern: docs/content/* skip_dirty_check: false diff --git a/.github/workflows/test-cli-with-database.yml b/.github/workflows/test-cli-with-database.yml index f189c859b6..3709de2eff 100644 --- a/.github/workflows/test-cli-with-database.yml +++ b/.github/workflows/test-cli-with-database.yml @@ -1,5 +1,9 @@ name: CLI Pipeline -on: [pull_request] +on: + pull_request: + paths-ignore: + - "docs/**" + - "www/**" jobs: test-cli-with-database: diff --git a/README.md b/README.md index cb63e7a0d3..c1c85552ce 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,13 @@

- Medusa Admin | - Website | - Blog | - LinkedIn | - Twitter | Documentation | - Notion + Medusa Admin Demo | + Website

-Medusa is an open-source headless commerce engine that enables developers to create amazing digital commerce experiences. +An open-source composable commerce engine built for developers.

@@ -39,106 +35,113 @@ Medusa is an open-source headless commerce engine that enables developers to cre

-## Quickstart +## Getting Started + +### Deploy in 5 minutes + +You can deploy your Medusa server in 5 minutes just by clicking the button below. + +

+ + Deploy + +

+ +### Install Locally + +You can install Medusa locally or manually on your server by either following our [Quickstart guide](https://docs.medusajs.com/quickstart/quick-start) or the following steps: 1. **Install Medusa CLI** - ```bash - npm install -g @medusajs/medusa-cli - ``` + + ```bash + npm install -g @medusajs/medusa-cli + ``` + 2. **Create a new Medusa project** - ``` - medusa new my-medusa-store --seed - ``` + + ```bash + medusa new my-medusa-store --seed + ``` + 3. **Start your Medusa engine** - ```bash - medusa develop - ``` -4. **Use the API** - ```bash - curl localhost:9000/store/products | python -m json.tool - ``` -We have a prebuilt admin dashboard that you can use to configure and manage your store find it here: [Medusa Admin](https://github.com/medusajs/admin) + ```bash + medusa develop + ``` -After these four steps and only a couple of minutes, you now have a complete commerce engine running locally. You may now explore [the documentation](https://docs.medusajs.com/api) to learn how to interact with the Medusa API. You may also add [plugins](https://github.com/medusajs/medusa/tree/master/packages) to your Medusa store by specifying them in your `medusa-config.js` file. +### Requirements -## Roadmap 2022 +- Node v14.0 or higher. +- SQLite or PostgreSQL (SQLite is only for getting started; PostgreSQL is recommended) +- Redis -Write-ups for all features will be made available in [Github discussions](https://github.com/medusajs/medusa/discussions) prior to starting the implementation process. +You can check out [this documentation for more details about setting up your environment](https://docs.medusajs.com/tutorial/set-up-your-development-environment). -### H1 2022 -- [x] Admin revamp -- [x] Tax API -- [x] Tax Calculation Strategy -- [x] Cart Calculation Strategy -- [x] Customer Groups API -- [x] Promotions API -- [x] Price Lists API -- [x] Price Selection Strategy -- [ ] Bulk import / export -- [ ] Extended Product API (custom fields, publishing control, and more) -- [ ] Extended Order API (managing placed orders, improved inventory control, and more) -- [ ] Sales Channel API -- [ ] Multi-warehouse support -- [ ] GraphQL API +## What is Medusa? -## Setting up a storefront for your Medusa project +Medusa is an open source composable commerce engine built with Node.js. Medusa enables developers to build scalable and sophisticated commerce setups with low effort and great developer experience. -Medusa is a headless commerce engine which means that it can be used for any type of digital commerce experience - you may use it as the backend for an app, a voice application, social commerce experiences or a traditional e-commerce website, you may even want to integrate Medusa into your own software to enable commerce functionality. All of these are use cases that Medusa supports - to learn more read the documentation or reach out. +You can learn more about [Medusa’s architecture in our documentation](https://docs.medusajs.com/introduction). -To provide a quick way to get you started with a storefront install one of our traditional e-commerce starters: +### Features -- [Gatsby Starter](https://github.com/medusajs/gatsby-starter-medusa) - ``` - npm install -g gatsby-cli - gatsby new my-medusa-storefront https://github.com/medusajs/gatsby-starter-medusa - ``` -- [Nextjs Starter](https://github.com/medusajs/nextjs-starter-medusa) - ``` - npx create-next-app -e https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront - ``` +- **Orders, Exchanges, and Returns APIs:** Aside from the standard order management that comes with ecommerce platforms, Medusa also provides an easy and automated way to manage swaps, returns, and claims. +- **Products and Collections APIs:** Add products with extensive customization settings and sort them into collections. +- **Region API:** Configure and manage multiple regions and currencies all from one platform. +- **Plugin API:** Easily integrate fulfillment providers, payment providers, notification services, and many other custom tools and third-party services. +- ****PriceList and Promotions APIs:**** Advanced pricing for products with conditions based on its amount in the cart or promotions and discounts. +- **Tax API:** Advanced tax configurations specific to multiple regions, with capability of specifying taxes for specific products. -With your starter and your Medusa store running you can open http://localhost:8000 (for Gatsby) or http://localhost:3000 (for Nextjs) in your browser and view the products in your store, build a cart, add shipping details and pay and complete an order. +See more of the [ecommerce features on our documentation](https://docs.medusajs.com/#features). -## Features +## Roadmap -Medusa comes with a set of building blocks that allow you to create amazing digital commerce experiences, below is a list of some of the features that Medusa come with out of the box: +Write-ups for all features will be made available in [Github discussions](https://github.com/medusajs/medusa/discussions) prior to starting the implementation process. -- **Headless**: Medusa is a highly customizable commerce API which means that you may use any presentation layer such as a website, app, chatbots, etc. -- **Regions** allow you to specify currencies, payment providers, shipping providers, tax rates and more for one or more countries for truly international sales. -- **Orders** come with all the functionality necessary to perform powerful customer service operations with ease. -- **Carts** allow customers to collect products for purchase, add shipping details and complete payments. -- **Products** come with relevant fields for customs, stock keeping and sales. Medusa supports multiple options and unlimited variants. -- **Swaps** allow customers to exchange products after purchase (e.g. for incorrect sizes). Accounting, payment and fulfillment plugins handle all the tedious work for you for automated customer service. -- **Claims** can be created if customers experience problems with one of their products. Plugins make sure to automate sending out replacements, handling refunds and collecting valuable data for analysis. -- **Returns** allow customers to send back products and can be configured to function in a 100% automated flow through accounting and payment plugins. -- **Fulfillment API** makes it easy to integrate with any fulfillment provider by creating fulfillment plugins, check the `/packages` directory for a full list of plugins. -- **Payments API** makes it easy to integrate with any payment provider by creating payment plugins, we already support Stripe, Paypal and Klarna. -- **Notification API** allow integrations with email providers, chatbots, Slack channels, etc. -- **Customer Login** to give customers a way of managing their data, viewing their orders and saving payment details. -- **Shipping Options & Profiles** enable powerful rules for free shipping limits, multiple fulfillment methods and more. -- **Medusa's Plugin Architecture** makes it intuitive and easy to manage your integrations, switch providers and grow with ease. -- **Customization** is supported for those special use cases that all the other e-commerce platforms can't accommodate. +### **2022** -## Database support +- [x] Admin revamp +- [x] Tax API +- [x] Tax Calculation Strategy +- [x] Cart Calculation Strategy +- [x] Customer Groups API +- [x] Promotions API +- [x] Price Lists API +- [x] Price Selection Strategy +- [ ] Import / Export API +- [ ] Sales Channel API +- [ ] Extended Product API (custom fields, publishing control, and more) +- [ ] Extended Order API (managing placed orders, improved inventory control, and more) +- [ ] Multi-warehouse support +- [ ] GraphQL API -In production Medusa requires Postgres and Redis, but SQLite is supported for development and testing purposes. If you plan on using Medusa for a project it is recommended that you install Postgres and Redis on your dev machine. +## Plugins -- [Install PostgreSQL](https://www.postgresql.org/download/) -- [Install Redis](https://redis.io/download) +As a headless and extendible solution, Medusa allows you to integrate third-party services or add custom features into Medusa by installing Plugins. -To use Postgres and Redis you should provide a `database_url` and `redis_url` in your `medusa-config.js`. +Check out [our available plugins](https://github.com/medusajs/medusa/tree/master/packages) that you can install and use instantly on your Medusa server. -## Contribution +## Contributions -Medusa is all about the community. Therefore, we would love for you to help us build the most robust and powerful commerce engine on the market. Whether it is fixing bugs, improving our documentation or simply spreading the word, please feel free to join in. Please check [our contribution guide](https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md) for further details about how to contribute. +Medusa is all about the community. Therefore, we would love for you to help us build the most robust and powerful commerce engine on the market. -## Repository structure +Whether it is fixing bugs, improving our documentation or simply spreading the word, please feel free to join in. Please check [our contribution guide](https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md) for further details about how to contribute. -The Medusa repository is a mono-repository managed using Lerna. Lerna allows us to have all Medusa packages in one place, and still distribute them as separate NPM packages. +## Community & Support -## Licensed +Use these channels to be part of the community, ask for help while using Medusa, or just learn more about Medusa: -Licensed under the [MIT License](https://github.com/medusajs/medusa/blob/master/LICENSE) +- [Discord](https://discord.gg/medusajs): This is the main channel to join the community. You can ask for help, showcase your work with Medusa, and stay up to date with everything Medusa. +- [GitHub Issues](https://github.com/medusajs/medusa/issues): for sending in any issues you face or bugs you find while using Medusa. +- [GitHub Discussions](https://github.com/medusajs/medusa/discussions): for joining discussions and submitting your ideas. +- [Medusa Blog](https://medusajs.com/blog/): find diverse tutorials and company news. +- [Twitter](https://twitter.com/medusajs) +- [LinkedIn](https://www.linkedin.com/company/medusajs) -## Thank you! +## Upgrade Guides + +Follow our [upgrade guides](https://docs.medusajs.com/advanced/backend/upgrade-guides/) on the documentation to keep your Medusa project up-to-date. + +## License + +Licensed under the [MIT License](https://github.com/medusajs/medusa/blob/master/LICENSE) \ No newline at end of file diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/README.md b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/README.md new file mode 100644 index 0000000000..db7fa1e8db --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/README.md @@ -0,0 +1,35 @@ +# typedoc-frontmatter-plugin + +A Typedoc plugin that allows inserting frontmatter key-value pairs at the top of the exported Markdown files. + +## Configurations + +The following options are optional and can be used to customize the configurations of the plugin. + +### frontmatterData + +`frontmatterData` is an object of key-value pairs. If none provided, no frontmatter variables will be added to the Markdown files. + +An example of passing it in a JavaScript configuration file: + +```js +frontmatterData: { + displayed_sidebar: "jsClientSidebar", +}, +``` + +If passing the option in the command line the value should be a JSON object. + +### pagesPattern + +`pagesPattern` is a string that contains a regular expression. This allows you to limit the pages the frontmatter variables should be added to. + +By default, the frontmatter variables will be added to all files. + +An example of passing it in a JavaScript configuration file: + +```js +frontmatterData: { + pagesPattern: "internal\\.", +}, +``` diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/dist/index.js b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/dist/index.js new file mode 100644 index 0000000000..10bbf68223 --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/dist/index.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.load = void 0; +const typedoc_1 = require("typedoc"); +function load(app) { + app.options.addDeclaration({ + name: "frontmatterData", + help: "An object of key-value pairs to be added to frontmatter", + type: typedoc_1.ParameterType.Mixed, + defaultValue: {}, + validate: (value) => { + if (typeof value === 'string') { + //decode it with JSON to check if it's an object + value = JSON.parse(value); + } + if (!(typeof value === 'object' && + !Array.isArray(value) && + value !== null)) { + throw new Error("Value should be an object"); + } + } + }); + app.options.addDeclaration({ + name: "pagesPattern", + help: "A string of pages pattern. The pattern will be tested using RegExp to determine whether the frontmatterData will be added or not.", + type: typedoc_1.ParameterType.String, + defaultValue: "" + }); + app.renderer.on(typedoc_1.PageEvent.END, (page) => { + const patternStr = app.options.getValue("pagesPattern"); + const pattern = new RegExp(patternStr); + let frontmatterData = app.options.getValue("frontmatterData"); + if (typeof frontmatterData === 'string') { + frontmatterData = JSON.parse(frontmatterData); + } + const frontmatterDataEntries = Object.entries(frontmatterData); + if (!frontmatterDataEntries.length || !pattern.test(page.filename)) { + return; + } + let frontmatterStr = `---\n`; + for (const [key, value] of frontmatterDataEntries) { + frontmatterStr += `${key}: ${value}\n`; + } + frontmatterStr += `---\n\n`; + page.contents = frontmatterStr + page.contents; + }); +} +exports.load = load; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/dist/index.js.map b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/dist/index.js.map new file mode 100644 index 0000000000..b99a5fae84 --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgE;AAEhE,SAAgB,IAAI,CAAC,GAAgB;IACjC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC;QACvB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,yDAAyD;QAC/D,IAAI,EAAE,uBAAa,CAAC,KAAK;QACzB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,CAAC,KAAU,EAAE,EAAE;YACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,gDAAgD;gBAChD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aAC3B;YAED,IAAI,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;gBAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACrB,KAAK,KAAK,IAAI,CAAC,EAAE;gBACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;aAC7C;QACH,CAAC;KACJ,CAAC,CAAC;IAEH,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC;QACzB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,mIAAmI;QACzI,IAAI,EAAE,uBAAa,CAAC,MAAM;QAC1B,YAAY,EAAE,EAAE;KACjB,CAAC,CAAA;IAEF,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,mBAAS,CAAC,GAAG,EAAE,CAAC,IAAe,EAAE,EAAE;QAC/C,MAAM,UAAU,GAAiB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAA;QACrE,MAAM,OAAO,GAAW,IAAI,MAAM,CAAC,UAAU,CAAC,CAAA;QAC9C,IAAI,eAAe,GAAiB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAA;QAC3E,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE;YACvC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;SAC/C;QACD,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAE9D,IAAI,CAAC,sBAAsB,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAClE,OAAO;SACR;QAED,IAAI,cAAc,GAAG,OAAO,CAAA;QAE5B,KAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,sBAAsB,EAAE;YAChD,cAAc,IAAI,GAAG,GAAG,KAAK,KAAK,IAAI,CAAA;SACvC;QAED,cAAc,IAAI,SAAS,CAAA;QAE3B,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAA;IAClD,CAAC,CAAC,CAAC;AACP,CAAC;AAlDD,oBAkDC"} \ No newline at end of file diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/package.json b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/package.json new file mode 100644 index 0000000000..1eb19affdd --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/package.json @@ -0,0 +1,32 @@ +{ + "name": "typedoc-frontmatter-plugin", + "version": "1.0.0", + "description": "Plugin to add frontmatter key-values at the top of pages", + "main": "./dist/index.js", + "exports": "./dist/index.js", + "files": [ + "dist" + ], + "author": "Shahed Nasser", + "license": "MIT", + "scripts": { + "build": "tsc" + }, + "peerDependencies": { + "typedoc": "0.22.x" + }, + "devDependencies": { + "@types/node": "^16.11.10", + "typedoc": "^0.22.10", + "@typescript-eslint/eslint-plugin": "5.6.0", + "@typescript-eslint/parser": "5.6.0", + "typescript": "4.5.2" + }, + "keywords": [ + "typedocplugin", + "packages", + "monorepo", + "lerna", + "typedoc" + ] +} diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/src/index.ts b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/src/index.ts new file mode 100644 index 0000000000..9edf89e24f --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/src/index.ts @@ -0,0 +1,53 @@ +import { Application, PageEvent, ParameterType } from "typedoc"; + +export function load(app: Application) { + app.options.addDeclaration({ + name: "frontmatterData", + help: "An object of key-value pairs to be added to frontmatter", + type: ParameterType.Mixed, // The default + defaultValue: {}, + validate: (value: any) => { + if (typeof value === 'string') { + //decode it with JSON to check if it's an object + value = JSON.parse(value); + } + + if (!(typeof value === 'object' && + !Array.isArray(value) && + value !== null)) { + throw new Error("Value should be an object") + } + } + }); + + app.options.addDeclaration({ + name: "pagesPattern", + help: "A string of pages pattern. The pattern will be tested using RegExp to determine whether the frontmatterData will be added or not.", + type: ParameterType.String, + defaultValue: "" + }) + + app.renderer.on(PageEvent.END, (page: PageEvent) => { + const patternStr: String | any = app.options.getValue("pagesPattern") + const pattern: RegExp = new RegExp(patternStr) + let frontmatterData: Object | any = app.options.getValue("frontmatterData") + if (typeof frontmatterData === 'string') { + frontmatterData = JSON.parse(frontmatterData); + } + const frontmatterDataEntries = Object.entries(frontmatterData) + + if (!frontmatterDataEntries.length || !pattern.test(page.filename)) { + return; + } + + let frontmatterStr = `---\n` + + for(const [key, value] of frontmatterDataEntries) { + frontmatterStr += `${key}: ${value}\n` + } + + frontmatterStr += `---\n\n` + + page.contents = frontmatterStr + page.contents + }); +} \ No newline at end of file diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/tsconfig.json b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/tsconfig.json new file mode 100644 index 0000000000..55f28c3714 --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "outDir": "./dist", + "isolatedModules": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "sourceMap": true + }, + "include": ["src"] +} \ No newline at end of file diff --git a/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/yarn.lock b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/yarn.lock new file mode 100644 index 0000000000..ba670dcc91 --- /dev/null +++ b/docs-util/typedoc-plugins/typedoc-frontmatter-plugin/yarn.lock @@ -0,0 +1,446 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + +"@types/node@^16.11.10": + version "16.11.39" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.39.tgz#07223cd2bc332ad9d92135e3a522eebdee3b060e" + integrity sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw== + +"@typescript-eslint/eslint-plugin@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.6.0.tgz#efd8668b3d6627c46ce722c2afe813928fe120a0" + integrity sha512-MIbeMy5qfLqtgs1hWd088k1hOuRsN9JrHUPwVVKCD99EOUqScd7SrwoZl4Gso05EAP9w1kvLWUVGJOVpRPkDPA== + dependencies: + "@typescript-eslint/experimental-utils" "5.6.0" + "@typescript-eslint/scope-manager" "5.6.0" + debug "^4.3.2" + functional-red-black-tree "^1.0.1" + ignore "^5.1.8" + regexpp "^3.2.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.6.0.tgz#f3a5960f2004abdcac7bb81412bafc1560841c23" + integrity sha512-VDoRf3Qj7+W3sS/ZBXZh3LBzp0snDLEgvp6qj0vOAIiAPM07bd5ojQ3CTzF/QFl5AKh7Bh1ycgj6lFBJHUt/DA== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.6.0" + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/typescript-estree" "5.6.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.6.0.tgz#11677324659641400d653253c03dcfbed468d199" + integrity sha512-YVK49NgdUPQ8SpCZaOpiq1kLkYRPMv9U5gcMrywzI8brtwZjr/tG3sZpuHyODt76W/A0SufNjYt9ZOgrC4tLIQ== + dependencies: + "@typescript-eslint/scope-manager" "5.6.0" + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/typescript-estree" "5.6.0" + debug "^4.3.2" + +"@typescript-eslint/scope-manager@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz#9dd7f007dc8f3a34cdff6f79f5eaab27ae05157e" + integrity sha512-1U1G77Hw2jsGWVsO2w6eVCbOg0HZ5WxL/cozVSTfqnL/eB9muhb8THsP0G3w+BB5xAHv9KptwdfYFAUfzcIh4A== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + +"@typescript-eslint/types@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" + integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== + +"@typescript-eslint/typescript-estree@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" + integrity sha512-92vK5tQaE81rK7fOmuWMrSQtK1IMonESR+RJR2Tlc7w4o0MeEdjgidY/uO2Gobh7z4Q1hhS94Cr7r021fMVEeA== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" + integrity sha512-1p7hDp5cpRFUyE3+lvA74egs+RWSgumrBpzBCDzfTFv0aQ7lIeay80yU0hIxgAhwQ6PcasW35kaOCyDOv6O/Ng== + dependencies: + "@typescript-eslint/types" "5.6.0" + eslint-visitor-keys "^3.0.0" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +debug@^4.3.2: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" + integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +globby@^11.0.4: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +ignore@^5.1.8, ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +jsonc-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.0.0.tgz#abdd785701c7e7eaca8a9ec8cf070ca51a745a22" + integrity sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lunr@^2.3.9: + version "2.3.9" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" + integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== + +marked@^4.0.16: + version "4.0.16" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.16.tgz#9ec18fc1a723032eb28666100344d9428cf7a264" + integrity sha512-wahonIQ5Jnyatt2fn8KqF/nIqZM8mh3oRu2+l5EANGMhu6RFjiSG52QNE2eWzFMI94HqYSgN184NurgNG6CztA== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +minimatch@^5.0.1, minimatch@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7" + integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== + dependencies: + brace-expansion "^2.0.1" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +semver@^7.3.5: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + +shiki@^0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.10.1.tgz#6f9a16205a823b56c072d0f1a0bcd0f2646bef14" + integrity sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng== + dependencies: + jsonc-parser "^3.0.0" + vscode-oniguruma "^1.6.1" + vscode-textmate "5.2.0" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +typedoc@^0.22.10: + version "0.22.17" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.17.tgz#bc51cc95f569040112504300831cdac4f8089b7b" + integrity sha512-h6+uXHVVCPDaANzjwzdsj9aePBjZiBTpiMpBBeyh1zcN2odVsDCNajz8zyKnixF93HJeGpl34j/70yoEE5BfNg== + dependencies: + glob "^8.0.3" + lunr "^2.3.9" + marked "^4.0.16" + minimatch "^5.1.0" + shiki "^0.10.1" + +typescript@4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== + +vscode-oniguruma@^1.6.1: + version "1.6.2" + resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz#aeb9771a2f1dbfc9083c8a7fdd9cccaa3f386607" + integrity sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA== + +vscode-textmate@5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e" + integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index af5df7beb5..782008c052 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -154,25 +154,177 @@ } } }, - "/customer-groups": { + "/auth": { "post": { - "operationId": "PostCustomerGroups", - "summary": "Create a CustomerGroup", - "description": "Creates a CustomerGroup.", + "operationId": "PostAuth", + "summary": "Authenticate a User", + "x-authenticated": false, + "description": "Logs a User in and authorizes them to manage Store settings.", + "parameters": [], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The User's email." + }, + "password": { + "type": "string", + "description": "The User's password." + } + } + } + } + } + } + }, + "get": { + "operationId": "GetAuth", + "summary": "Get Session", + "x-authenticated": true, + "description": "Gets the currently logged in User.", + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + } + } + }, + "/batch-jobs/{id}/cancel": { + "post": { + "operationId": "PostBatchJobsBatchJobCancel", + "summary": "Marks a batch job as canceled", + "description": "Marks a batch job as canceled", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the batch job.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Batch Job" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "batch_job": { + "$ref": "#/components/schemas/batch_job" + } + } + } + } + } + } + } + } + }, + "/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 batch job.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Batch Job" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "batch_job": { + "$ref": "#/components/schemas/batch_job" + } + } + } + } + } + } + } + } + }, + "/batch-jobs": { + "post": { + "operationId": "PostBatchJobs", + "summary": "Create a Batch Job", + "description": "Creates a Batch Job.", "x-authenticated": true, "parameters": [], "tags": [ - "CustomerGroup" + "Batch Job" ], "responses": { - "200": { + "201": { "description": "OK", "content": { "application/json": { "schema": { "properties": { - "customer_group": { - "$ref": "#/components/schemas/customer_group" + "batch_job": { + "$ref": "#/components/schemas/batch_job" } } } @@ -186,428 +338,22 @@ "schema": { "type": "object", "required": [ - "name" + "type", + "context", + "dry_run" ], "properties": { - "name": { + "type": { "type": "string", - "description": "Name of the customer group" + "description": "The type of batch job to start." }, - "metadata": { - "type": "object", - "description": "Metadata for the customer." - } - } - } - } - } - } - } - }, - "/customer-groups/{id}": { - "delete": { - "operationId": "DeleteCustomerGroupsCustomerGroup", - "summary": "Delete a CustomerGroup", - "description": "Deletes a CustomerGroup.", - "x-authenticated": true, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer Group", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "CustomerGroup" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted customer group." - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostCustomerGroupsGroup", - "summary": "Update a CustomerGroup", - "description": "Update a CustomerGroup.", - "x-authenticated": true, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the customer group.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "CustomerGroup" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer_group": { - "$ref": "#/components/schemas/customer_group" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { + "context": { "type": "string", - "description": "Name of the customer group" + "description": "Additional infomration regarding the batch to be used for processing." }, - "metadata": { - "type": "object", - "description": "Metadata for the customer." - } - } - } - } - } - } - } - }, - "/customer-group/{id}": { - "get": { - "operationId": "GetCustomerGroupsGroup", - "summary": "Retrieve a CustomerGroup", - "description": "Retrieves a Customer Group.", - "x-authenticated": true, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer Group.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "CustomerGroup" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer_group": { - "$ref": "#/components/schemas/customer_group" - } - } - } - } - } - } - } - } - }, - "/discounts/{id}/regions/{region_id}": { - "post": { - "operationId": "PostDiscountsDiscountRegionsRegion", - "summary": "Adds Region availability", - "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" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "DeleteDiscountsDiscountRegionsRegion", - "summary": "Remove Region availability", - "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" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - } - }, - "/discounts/{id}/products/{product_id}": { - "post": { - "operationId": "PostDiscountsDiscountProductsProduct", - "summary": "Adds Product availability", - "description": "Adds a Product to the list of Products that a Discount can be used for.", - "x-authenticated": true, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "product_id", - "required": true, - "description": "The id of the Product.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "DeleteDiscountsDiscountProductsProduct", - "summary": "Remove Product availability", - "description": "Removes a Product from the list of Products that a Discount can be used for.", - "x-authenticated": true, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "product_id", - "required": true, - "description": "The id of the Product.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - } - }, - "/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.", - "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": "string", - "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." - }, - "rule": { - "description": "The Discount Rule that defines how Discounts are calculated", - "oneOf": [ - { - "$ref": "#/components/schemas/discount_rule" - } - ] - }, - "is_disabled": { + "dry_run": { "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." - }, - "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" - } - } - } - } - } - }, - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } + "description": "Set a batch job in dry_run mode to get some information on what will be done without applying any modifications." } } } @@ -616,338 +362,139 @@ } }, "get": { - "operationId": "GetDiscounts", - "summary": "List Discounts", + "operationId": "GetBatchJobs", + "summary": "List Batch Jobs", + "description": "Retrieve a list of Batch Jobs.", "x-authenticated": true, - "description": "Retrieves a list of Discounts", "parameters": [ - { - "in": "query", - "name": "q", - "description": "Search query applied on results.", - "schema": { - "type": "string" - } - }, - { - "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", + "description": "The number of collections to return.", "schema": { - "type": "number" + "type": "string" } }, { "in": "query", "name": "offset", - "description": "The offset of items in response", + "description": "The offset of collections to return.", "schema": { - "type": "number" + "type": "string" } }, { "in": "query", - "name": "expand", - "description": "Comma separated list of relations to include in the results.", + "name": "type", + "style": "form", + "explode": false, + "description": "Filter by the batch type", "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } + "type": "array", + "items": { + "type": "string" } } - } - } - } - }, - "/discounts/{id}/dynamic-codes": { - "post": { - "operationId": "PostDiscountsDiscountDynamicCodes", - "summary": "Create a dynamic Discount code", - "description": "Creates a 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.\"", + "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": "string" + "type": "object", + "nullable": true } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - }, - "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." - }, - "metadata": { - "type": "object", - "description": "An optional set of key-value paris to hold additional information." - } - } - } - } - } - } - } - }, - "/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 Discount", + "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": "string" + "type": "object", + "nullable": true } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted Discount" - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetDiscountsDiscount", - "summary": "Retrieve a Discount", - "description": "Retrieves a Discount", - "x-authenticated": true, - "parameters": [ + }, { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount", + "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": "string" + "type": "object", + "nullable": true } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - }, - "post": { - "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 Discount.", + "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": "string" + "type": "object", + "nullable": true } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "code": { - "type": "string", - "description": "A unique code that will be used to redeem the Discount" - }, - "is_dynamic": { - "type": "string", - "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." - }, - "rule": { - "description": "The Discount Rule that defines how Discounts are calculated", - "oneOf": [ - { - "$ref": "#/components/schemas/discount_rule" - } - ] - }, - "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." - }, - "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" - } - } - } - } - } - }, - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - } - }, - "/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", + "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", + "nullable": true + } + }, + { + "in": "query", + "name": "order", + "description": "Order used when retrieving batch jobs", "schema": { "type": "string" } }, { - "in": "path", - "name": "code", - "required": true, - "description": "The id of the Discount", + "in": "query", + "name": "deleted_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was deleted, i.e. less than, greater than etc.", "schema": { - "type": "string" + "type": "object", + "nullable": true + } + }, + { + "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", + "nullable": true + } + }, + { + "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", + "nullable": true } } ], "tags": [ - "Discount" + "Batch Job" ], "responses": { "200": { @@ -956,8 +503,8 @@ "application/json": { "schema": { "properties": { - "discount": { - "$ref": "#/components/schemas/discount" + "batch_job": { + "$ref": "#/components/schemas/batch_job" } } } @@ -967,25 +514,25 @@ } } }, - "/discounts/code/{code}": { + "/batch-jobs/{id}": { "get": { - "operationId": "GetDiscountsDiscountCode", - "summary": "Retrieve a Discount by code", - "description": "Retrieves a Discount by its discount code", + "operationId": "GetBatchJobsBatchJob", + "summary": "Retrieve a Batch Job", + "description": "Retrieves a Batch Job.", "x-authenticated": true, "parameters": [ { "in": "path", - "name": "code", + "name": "id", "required": true, - "description": "The code of the Discount", + "description": "The id of the Batch Job", "schema": { "type": "string" } } ], "tags": [ - "Discount" + "Batch Job" ], "responses": { "200": { @@ -994,8 +541,8 @@ "application/json": { "schema": { "properties": { - "discount": { - "$ref": "#/components/schemas/discount" + "batch_job": { + "$ref": "#/components/schemas/batch_job" } } } @@ -1376,15 +923,15 @@ } } }, - "/auth": { + "/customers": { "post": { - "operationId": "PostAuth", - "summary": "Authenticate a User", - "x-authenticated": false, - "description": "Logs a User in and authorizes them to manage Store settings.", + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer.", + "x-authenticated": true, "parameters": [], "tags": [ - "Auth" + "Customer" ], "responses": { "200": { @@ -1393,8 +940,8 @@ "application/json": { "schema": { "properties": { - "user": { - "$ref": "#/components/schemas/user" + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -1409,16 +956,29 @@ "type": "object", "required": [ "email", - "password" + "first_name", + "last_name" ], "properties": { "email": { "type": "string", - "description": "The User's email." + "description": "The Customer's email address." }, - "password": { + "first_name": { "type": "string", - "description": "The User's password." + "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." + }, + "metadata": { + "type": "object", + "description": "Metadata for the customer." } } } @@ -1427,12 +987,12 @@ } }, "get": { - "operationId": "GetAuth", - "summary": "Get Session", + "operationId": "GetCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", "x-authenticated": true, - "description": "Gets the currently logged in User.", "tags": [ - "Auth" + "Customer" ], "responses": { "200": { @@ -1441,8 +1001,1471 @@ "application/json": { "schema": { "properties": { - "user": { - "$ref": "#/components/schemas/user" + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/customers/{id}": { + "get": { + "operationId": "GetCustomersCustomer", + "summary": "Retrieve 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" + } + } + ], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + }, + "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", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "email": { + "type": "string", + "description": "The Customer's email. Only providable if user not registered." + }, + "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." + }, + "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": { + "type": "object", + "description": "Metadata for the customer." + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/discounts/{id}/regions/{region_id}": { + "post": { + "operationId": "PostDiscountsDiscountRegionsRegion", + "summary": "Adds Region availability", + "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" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteDiscountsDiscountRegionsRegion", + "summary": "Remove Region availability", + "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" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/{discount_id}/conditions": { + "post": { + "operationId": "PostDiscountsDiscountConditions", + "summary": "Creates a DiscountCondition", + "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" + } + } + ], + "description": "Creates a DiscountCondition", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "operator": { + "description": "Operator of the condition", + "type": "string" + }, + "items": { + "properties": { + "products": { + "type": "array", + "description": "list of products" + }, + "product_types": { + "type": "array", + "description": "list of product types" + }, + "product_collections": { + "type": "array", + "description": "list of product collections" + }, + "product_tags": { + "type": "array", + "description": "list of product tags" + }, + "customer_groups": { + "type": "array", + "description": "list of customer_groups" + } + } + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/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.", + "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": "string", + "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." + }, + "rule": { + "description": "The Discount Rule that defines how Discounts are calculated", + "oneOf": [ + { + "$ref": "#/components/schemas/discount_rule" + } + ] + }, + "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." + }, + "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" + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + }, + "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 results.", + "schema": { + "type": "string" + } + }, + { + "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" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of items in response", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/{id}/dynamic-codes": { + "post": { + "operationId": "PostDiscountsDiscountDynamicCodes", + "summary": "Create a dynamic Discount code", + "description": "Creates a 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" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code", + "usage_limit" + ], + "properties": { + "code": { + "type": "string", + "description": "The unique code that will be used to redeem the Discount." + }, + "usage_limit": { + "type": "number", + "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 DiscountCondition", + "description": "Deletes a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "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" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted DiscountCondition" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + }, + "discount": { + "type": "object", + "description": "The Discount to which the condition used to belong" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDiscountsDiscountConditionsCondition", + "summary": "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" + } + } + ], + "description": "Gets a DiscountCondition", + "tags": [ + "DiscountCondition" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount_condition": { + "$ref": "#/components/schemas/discount_condition" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostDiscountsDiscountConditionsCondition", + "summary": "Updates a DiscountCondition", + "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" + } + } + ], + "description": "Updates a DiscountCondition", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "id" + ], + "properties": { + "items": { + "properties": { + "products": { + "type": "array", + "description": "list of products" + }, + "product_types": { + "type": "array", + "description": "list of product types" + }, + "product_collections": { + "type": "array", + "description": "list of product collections" + }, + "product_tags": { + "type": "array", + "description": "list of product tags" + }, + "customer_groups": { + "type": "array", + "description": "list of customer_groups" + } + } + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/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 Discount", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Discount" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDiscountsDiscount", + "summary": "Retrieve a Discount", + "description": "Retrieves a Discount", + "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 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" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + }, + "post": { + "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 Discount.", + "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", + "oneOf": [ + { + "$ref": "#/components/schemas/discount_rule" + } + ] + }, + "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." + }, + "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" + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/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", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "code", + "required": true, + "description": "The id of the Discount", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/code/{code}": { + "get": { + "operationId": "GetDiscountsDiscountCode", + "summary": "Retrieve a 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" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/customer-groups/{id}/customers/batch": { + "post": { + "operationId": "PostCustomerGroupsGroupCustomersBatch", + "summary": "Add a list of customers to a customer group ", + "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": { + "properties": { + "customers": { + "description": "The ids of the customers to add", + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id of the customer", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customerGroup": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteCustomerGroupsGroupCustomerBatch", + "summary": "Remove a list of customers from a customer group ", + "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": { + "properties": { + "customers": { + "description": "The ids of the customers to remove", + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id of the customer", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customerGroup": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + } + }, + "/customer-groups": { + "post": { + "operationId": "PostCustomerGroups", + "summary": "Create a CustomerGroup", + "description": "Creates a CustomerGroup.", + "x-authenticated": true, + "parameters": [], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer_group": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + }, + "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": "Retrieve a list of customer groups", + "description": "Retrieve a list of customer groups.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching user group names.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many groups to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Ids of the groups to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "to retrieve customer groups in.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting customer group was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting ustomer group was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of customer groups returned.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each customer groups of the result.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customerGroup": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + } + }, + "/customer-groups/{id}": { + "delete": { + "operationId": "DeleteCustomerGroupsCustomerGroup", + "summary": "Delete a CustomerGroup", + "description": "Deletes a CustomerGroup.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer Group", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted customer group." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetCustomerGroupsGroup", + "summary": "Retrieve a CustomerGroup", + "description": "Retrieves a Customer Group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer Group.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer_group": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostCustomerGroupsGroup", + "summary": "Update a CustomerGroup", + "description": "Update a CustomerGroup.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the customer group.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer_group": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + }, + "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": "GetCustomerGroupsGroupCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the customer group.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -2021,230 +3044,6 @@ } } }, - "/customers": { - "post": { - "operationId": "PostCustomers", - "summary": "Create a Customer", - "description": "Creates a Customer.", - "x-authenticated": true, - "parameters": [], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "email", - "first_name", - "last_name" - ], - "properties": { - "email": { - "type": "string", - "description": "The Customer's email address." - }, - "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." - }, - "metadata": { - "type": "object", - "description": "Metadata for the customer." - } - } - } - } - } - } - }, - "get": { - "operationId": "GetCustomers", - "summary": "List Customers", - "description": "Retrieves a list of Customers.", - "x-authenticated": true, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/{id}": { - "get": { - "operationId": "GetCustomersCustomer", - "summary": "Retrieve 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" - } - } - ], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - }, - "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", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "email": { - "type": "string", - "description": "The Customer's email. Only providable if user not registered." - }, - "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." - }, - "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": { - "type": "object", - "description": "Metadata for the customer." - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, "/gift-cards": { "post": { "operationId": "PostGiftCards", @@ -3057,83 +3856,6 @@ } } }, - "/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": "string" - } - }, - { - "in": "query", - "name": "offset", - "description": "The offset of tags to return.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "value", - "description": "The value of tags to return.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "id", - "description": "The id of tags to return.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "created_at", - "description": "Date comparison for when resulting tas was created, i.e. less than, greater than etc.", - "schema": { - "type": "object" - } - }, - { - "in": "query", - "name": "updated_at", - "description": "Date comparison for when resulting tas was updated, i.e. less than, greater than etc.", - "schema": { - "type": "object" - } - } - ], - "tags": [ - "Product Tag" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "tags": { - "$ref": "#/components/schemas/product_tag" - } - } - } - } - } - } - } - } - }, "/orders/{id}/shipping-methods": { "post": { "operationId": "PostOrdersOrderShippingMethods", @@ -5227,6 +5949,915 @@ } } }, + "/price-lists/{id}/prices/batch": { + "post": { + "operationId": "PostPriceListsPriceListPricesBatch", + "summary": "Batch update prices for a Price List", + "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 to update prices for.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "prices": { + "description": "The prices to update or add.", + "type": "array", + "items": { + "properties": { + "id": { + "description": "The id of the price.", + "type": "string" + }, + "status": { + "description": "The status of the Price List.", + "type": "string", + "enum": [ + "active", + "draft" + ] + }, + "region_id": { + "description": "The id of the Region for which the price is used.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used.", + "type": "string" + }, + "amount": { + "description": "The amount of the price.", + "type": "number" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "number" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "number" + } + } + } + }, + "override": { + "description": "If true the prices will replace all existing prices associated with the Price List.", + "type": "boolean" + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Price List." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeletePriceListsPriceListPricesBatch", + "summary": "Batch delete prices that belongs to a Price List", + "description": "Batch delete prices that belongs 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" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "price_ids": { + "description": "The price id's of the Money Amounts to delete.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string", + "description": "The id of the deleted Money Amount." + } + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/price_lists": { + "post": { + "operationId": "PostPriceListsPriceList", + "summary": "Creates a Price List", + "description": "Creates a Price List", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the Price List", + "type": "string" + }, + "description": { + "description": "A description of the Price List.", + "type": "string" + }, + "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": { + "properties": { + "region_id": { + "description": "The id of the Region for which the price is used.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be 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" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "product": { + "$ref": "#/components/schemas/price_list" + } + } + } + } + } + } + } + } + }, + "/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": "string" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Price List." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetPriceListsPriceList", + "summary": "Retrieve 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": "string" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "price_list": { + "$ref": "#/components/schemas/price_list" + } + } + } + } + } + } + } + } + }, + "/price-lists/{id}/products/{product_id}/prices": { + "delete": { + "operationId": "DeletePriceListsPriceListProductsProductPrices", + "summary": "Delete all the prices related to a specific product in a price list", + "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" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "type": "number", + "description": "The price ids that have been deleted." + }, + "count": { + "type": "number", + "description": "The number of prices that have been deleted." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/price-lists/{id}/variants/{variant_id}/prices": { + "delete": { + "operationId": "DeletePriceListsPriceListVariantsVariantPrices", + "summary": "Delete all the prices related to a specific variant in a price list", + "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" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "type": "number", + "description": "The price ids that have been deleted." + }, + "count": { + "type": "number", + "description": "The number of prices that have been deleted." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/price-lists/:id/products": { + "get": { + "operationId": "GetPriceListsPriceListProducts", + "summary": "List Product in a Price List", + "description": "Retrieves a list of Product that are part of a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching products.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Id of the product to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "description": "Status to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "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": "Tags to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "title", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "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": "to retrieve products in.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting products was deleted, i.e. less than, greater than etc.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products was created, i.e. less than, greater than etc.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products was updated, i.e. less than, greater than etc.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "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" + } + } + ], + "tags": [ + "Product" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The number of Products.", + "type": "integer" + }, + "offset": { + "description": "The offset of the Product query.", + "type": "integer" + }, + "limit": { + "description": "The limit of the Product query.", + "type": "integer" + }, + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/product" + } + } + } + } + } + } + } + } + } + }, + "/price-lists": { + "get": { + "operationId": "GetPriceLists", + "summary": "List Price Lists", + "description": "Retrieves a list of Price Lists.", + "x-authenticated": true, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "price_lists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/price_list" + } + }, + "count": { + "description": "The number of Price Lists.", + "type": "integer" + }, + "offset": { + "description": "The offset of the Price List query.", + "type": "integer" + }, + "limit": { + "description": "The limit of the Price List query.", + "type": "integer" + } + } + } + } + } + } + } + } + }, + "/price_lists/{id}": { + "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" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the Price List", + "type": "string" + }, + "description": { + "description": "A description of the Price List.", + "type": "string" + }, + "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": { + "properties": { + "id": { + "description": "The id of the price.", + "type": "string" + }, + "region_id": { + "description": "The id of the Region for which the price is used.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be 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" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "product": { + "$ref": "#/components/schemas/price_list" + } + } + } + } + } + } + } + } + }, + "/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": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "description": "The value of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "The id of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting tas was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting tas was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + } + ], + "tags": [ + "Product Tag" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tags": { + "$ref": "#/components/schemas/product_tag" + } + } + } + } + } + } + } + } + }, "/product-types": { "get": { "operationId": "GetProductTypes", @@ -5932,8 +7563,12 @@ "description": "The amount to charge for the Product Variant.", "type": "integer" }, - "sale_amount": { - "description": "The sale amount to charge for the Product Variant.", + "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" } } @@ -5989,7 +7624,39 @@ "in": "path", "name": "id", "required": true, - "description": "The id of the Product.", + "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 products to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", "schema": { "type": "string" } @@ -6642,6 +8309,10 @@ "type": "array", "items": { "properties": { + "id": { + "description": "The id of the price.", + "type": "string" + }, "region_id": { "description": "The id of the Region for which the price is used.", "type": "string" @@ -6654,8 +8325,12 @@ "description": "The amount to charge for the Product Variant.", "type": "integer" }, - "sale_amount": { - "description": "The sale amount to charge for the Product Variant.", + "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" } } @@ -9636,6 +11311,89 @@ } } }, + "batch_job": { + "title": "Batch Job", + "description": "A Batch Job.", + "x-resourceId": "batch_job", + "properties": { + "id": { + "description": "The unique identifier for the batch job.", + "type": "string" + }, + "type": { + "description": "The type of batch job.", + "type": "string", + "enum": [ + "product_import", + "product_export" + ] + }, + "status": { + "description": "The status of the batch job.", + "type": "string", + "enum": [ + "created", + "pre_processed", + "processing", + "completed", + "canceled", + "failed" + ] + }, + "created_by": { + "description": "The unique identifier of the user that created the batch job.", + "type": "string" + }, + "context": { + "description": "The context of the batch job, the type of the batch job determines what the context should contain.", + "type": "object" + }, + "dry_run": { + "description": "Specify if the job must apply the modifications or not.", + "type": "boolean", + "default": false + }, + "result": { + "description": "The result of the batch job.", + "type": "object" + }, + "pre_processed_at": { + "description": "The date from which the job has been pre processed.", + "type": "string", + "format": "date-time" + }, + "confirmed_at": { + "description": "The date when the confirmation has been done.", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date of the completion.", + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date of the concellation.", + "type": "string", + "format": "date-time" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + } + } + }, "cart": { "title": "Cart", "description": "Represents a user cart", @@ -10198,6 +11956,217 @@ } } }, + "discount_condition_customer_group": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a customer group", + "x-resourceId": "discount_condition_customer_group", + "properties": { + "customer_group_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product_collection": { + "title": "Product Collection Discount Condition", + "description": "Associates a discount condition with a product collection", + "x-resourceId": "discount_condition_product_collection", + "properties": { + "product_collection_id": { + "description": "The id of the Product Collection", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product_tag": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a product tag", + "x-resourceId": "discount_condition_product_tag", + "properties": { + "product_tag_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product_type": { + "title": "Product Type Discount Condition", + "description": "Associates a discount condition with a product type", + "x-resourceId": "discount_condition_product", + "properties": { + "product_type_id": { + "description": "The id of the Product Type", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product": { + "title": "Product Discount Condition", + "description": "Associates a discount condition with a product", + "x-resourceId": "discount_condition_product", + "properties": { + "product_id": { + "description": "The id of the Product", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition": { + "title": "Discount Condition", + "description": "Holds rule conditions for when a discount is applicable", + "x-resourceId": "discount_condition", + "properties": { + "id": { + "description": "The id of the Discount Condition. Will be prefixed by `discon_`.", + "type": "string" + }, + "type": { + "description": "The type of the Condition", + "type": "string", + "enum": [ + "products", + "product_types", + "product_collections", + "product_tags", + "customer_groups" + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "update_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "discount_rule": { "title": "Discount Rule", "description": "Holds the rules that governs how a Discount is calculated when applied to a Cart.", @@ -10232,11 +12201,11 @@ "item" ] }, - "valid_for": { - "description": "A set of Products that the discount can be used for.", + "conditions": { + "description": "A set of conditions that can be used to limit when the discount can be used", "type": "array", "items": { - "$ref": "#/components/schemas/product" + "$ref": "#/components/schemas/discount_condition" } }, "created_at": { @@ -10828,8 +12797,12 @@ "description": "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.", "type": "integer" }, - "sale_amount": { - "description": "An optional sale amount that the Product Variant will be available for when defined.", + "min_quantity": { + "description": "The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", "type": "integer" }, "variant_id": { @@ -11426,6 +13399,57 @@ } } }, + "price_list": { + "title": "Price List", + "description": "Price Lists represents a set of prices that overrides the default price for one or more product variants.", + "x-resourceId": "price_list", + "properties": { + "id": { + "description": "The id of the Price List. This value will be prefixed by `pl_`.", + "type": "string" + }, + "type": { + "description": "The type of Price List. This can be one of either `sale` or `override`.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The date with timezone that the Price List stops being valid.", + "type": "string", + "format": "date-time" + }, + "customer_groups": { + "description": "The Customer Groups that the Price List applies to.", + "type": "array", + "items": { + "$ref": "#/components/schemas/customer_group" + } + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + } + } + }, "product_collection": { "title": "Product Collection", "description": "Product Collections represents a group of Products that are related.", diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 8c42b10226..d0b8b87f7d 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -140,6 +140,240 @@ paths: properties: user: $ref: '#/components/schemas/user' + '/batch-jobs/{id}/cancel': + post: + operationId: PostBatchJobsBatchJobCancel + summary: Marks a batch job as canceled + description: Marks a batch job as canceled + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the batch job. + schema: + type: string + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + '/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 batch job. + schema: + type: string + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + /batch-jobs: + post: + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. + x-authenticated: true + parameters: [] + tags: + - Batch Job + responses: + '201': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + requestBody: + content: + application/json: + schema: + type: object + required: + - type + - context + - dry_run + properties: + type: + type: string + description: The type of batch job to start. + context: + type: string + description: >- + Additional infomration regarding the batch to be used for + processing. + 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. + 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 collections to return. + schema: + type: string + - in: query + name: offset + description: The offset of collections to return. + schema: + 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 + nullable: true + - 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 + nullable: true + - 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 + nullable: true + - 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 + nullable: true + - 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 + nullable: true + - in: query + name: order + description: Order used when retrieving batch jobs + schema: + type: string + - in: query + name: deleted_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was deleted, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + - 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 + nullable: true + - 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 + nullable: true + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + '/batch-jobs/{id}': + get: + operationId: GetBatchJobsBatchJob + summary: Retrieve 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 + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' '/collections/{id}/products/batch': post: operationId: PostProductsToCollection @@ -394,6 +628,83 @@ paths: properties: collection: $ref: '#/components/schemas/product_collection' + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: 'Add a list of customers to a customer group ' + 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: + properties: + customers: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: Id of the customer + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customerGroup: + $ref: '#/components/schemas/customer_group' + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: 'Remove a list of customers from a customer group ' + 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: + properties: + customers: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: Id of the customer + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customerGroup: + $ref: '#/components/schemas/customer_group' /customer-groups: post: operationId: PostCustomerGroups @@ -426,6 +737,69 @@ paths: metadata: type: object description: Metadata for the customer. + get: + operationId: GetCustomerGroups + summary: Retrieve a list of customer groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching user group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: string + - in: query + name: id + description: Ids of the groups to search for. + schema: + type: string + - in: query + name: order + description: to retrieve customer groups in. + schema: + type: string + - in: query + name: created_at + description: >- + Date comparison for when resulting customer group was created, i.e. + less than, greater than etc. + schema: + type: object + - in: query + name: updated_at + description: >- + Date comparison for when resulting ustomer group was updated, i.e. + less than, greater than etc. + schema: + type: object + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customerGroup: + $ref: '#/components/schemas/customer_group' '/customer-groups/{id}': delete: operationId: DeleteCustomerGroupsCustomerGroup @@ -456,6 +830,29 @@ paths: description: The type of the object that was deleted. deleted: type: boolean + get: + operationId: GetCustomerGroupsGroup + summary: Retrieve a CustomerGroup + description: Retrieves a Customer Group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Customer Group. + schema: + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer_group: + $ref: '#/components/schemas/customer_group' post: operationId: PostCustomerGroupsGroup summary: Update a CustomerGroup @@ -493,21 +890,21 @@ paths: metadata: type: object description: Metadata for the customer. - '/customer-group/{id}': + '/customer-groups/{id}/customers': get: - operationId: GetCustomerGroupsGroup - summary: Retrieve a CustomerGroup - description: Retrieves a Customer Group. + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of Customers. 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 tags: - - CustomerGroup + - Customer responses: '200': description: OK @@ -515,8 +912,8 @@ paths: application/json: schema: properties: - customer_group: - $ref: '#/components/schemas/customer_group' + customer: + $ref: '#/components/schemas/customer' /customers: post: operationId: PostCustomers @@ -727,56 +1124,58 @@ paths: properties: discount: $ref: '#/components/schemas/discount' - '/discounts/{id}/products/{product_id}': + '/discounts/{discount_id}/conditions': post: - operationId: PostDiscountsDiscountProductsProduct - summary: Adds Product availability - description: Adds a Product to the list of Products that a Discount can be used for. + operationId: PostDiscountsDiscountConditions + summary: Creates a DiscountCondition x-authenticated: true parameters: - in: path - name: id - required: true - description: The id of the Discount. - schema: - type: string - - in: path - name: product_id + name: discount_id required: true description: The id of the Product. schema: type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - delete: - operationId: DeleteDiscountsDiscountProductsProduct - summary: Remove Product availability - description: >- - Removes a Product from the list of Products that a Discount can be used - for. - x-authenticated: true - parameters: - - in: path - name: id - 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: path - name: product_id - required: true - description: The id of the Product. + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. schema: type: string + description: Creates a DiscountCondition + requestBody: + content: + application/json: + schema: + properties: + operator: + description: Operator of the condition + type: string + items: + properties: + products: + type: array + description: list of products + product_types: + type: array + description: list of product types + product_collections: + type: array + description: list of product collections + product_tags: + type: array + description: list of product tags + customer_groups: + type: array + description: list of customer_groups tags: - Discount responses: @@ -939,15 +1338,158 @@ paths: type: object required: - code + - usage_limit properties: code: type: string description: The unique code that will be used to redeem the Discount. + usage_limit: + type: number + 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 DiscountCondition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: 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 + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted DiscountCondition + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + discount: + type: object + description: The Discount to which the condition used to belong + get: + operationId: GetDiscountsDiscountConditionsCondition + summary: 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 + description: Gets a DiscountCondition + tags: + - DiscountCondition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount_condition: + $ref: '#/components/schemas/discount_condition' + post: + operationId: PostDiscountsDiscountConditionsCondition + summary: Updates a DiscountCondition + 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 + description: Updates a DiscountCondition + requestBody: + content: + application/json: + schema: + required: + - id + properties: + items: + properties: + products: + type: array + description: list of products + product_types: + type: array + description: list of product types + product_collections: + type: array + description: list of product collections + product_tags: + type: array + description: list of product tags + customer_groups: + type: array + description: list of customer_groups + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' '/discounts/{id}': delete: operationId: DeleteDiscountsDiscount @@ -990,6 +1532,16 @@ paths: 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 tags: - Discount responses: @@ -1023,13 +1575,6 @@ paths: code: type: string description: A unique code that will be used to redeem the Discount - is_dynamic: - type: string - 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. rule: description: The Discount Rule that defines how Discounts are calculated oneOf: @@ -3526,6 +4071,578 @@ paths: properties: order: $ref: '#/components/schemas/order' + '/price-lists/{id}/prices/batch': + post: + operationId: PostPriceListsPriceListPricesBatch + summary: Batch update prices for a Price List + 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 to update prices for. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + prices: + description: The prices to update or add. + type: array + items: + properties: + id: + description: The id of the price. + type: string + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + region_id: + description: The id of the Region for which the price is used. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. + type: string + amount: + description: The amount of the price. + type: number + min_quantity: + description: The minimum quantity for which the price will be used. + type: number + max_quantity: + description: The maximum quantity for which the price will be used. + type: number + override: + description: >- + If true the prices will replace all existing prices + associated with the Price List. + type: boolean + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + delete: + operationId: DeletePriceListsPriceListPricesBatch + summary: Batch delete prices that belongs to a Price List + description: Batch delete prices that belongs 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 + requestBody: + content: + application/json: + schema: + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + ids: + type: array + items: + type: string + description: The id of the deleted Money Amount. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + /price_lists: + post: + operationId: PostPriceListsPriceList + summary: Creates a Price List + description: Creates a Price List + x-authenticated: true + requestBody: + content: + application/json: + schema: + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + 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: + properties: + region_id: + description: The id of the Region for which the price is used. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be 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 + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product: + $ref: '#/components/schemas/price_list' + '/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: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + get: + operationId: GetPriceListsPriceList + summary: Retrieve 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: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + price_list: + $ref: '#/components/schemas/price_list' + '/price-lists/{id}/products/{product_id}/prices': + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete all the prices related to a specific product in a price list + 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 + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + ids: + type: number + description: The price ids that have been deleted. + count: + type: number + description: The number of prices that have been deleted. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + '/price-lists/{id}/variants/{variant_id}/prices': + delete: + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete all the prices related to a specific variant in a price list + 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 + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + ids: + type: number + description: The price ids that have been deleted. + count: + type: number + description: The number of prices that have been deleted. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + '/price-lists/:id/products': + get: + operationId: GetPriceListsPriceListProducts + summary: List Product in a Price List + description: Retrieves a list of Product that are part of a Price List + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching products. + schema: + type: string + - in: query + name: id + description: Id of the product to search for. + schema: + type: string + - in: query + name: status + description: Status to search for + style: form + explode: false + schema: + type: array + items: + type: string + - 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: Tags to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: title + description: to search for. + schema: + type: string + - in: query + name: description + description: to search for. + schema: + type: string + - in: query + name: handle + description: 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: to retrieve products in. + schema: + type: string + - in: query + name: deleted_at + description: >- + Date comparison for when resulting products was deleted, i.e. less + than, greater than etc. + schema: + type: string + - in: query + name: created_at + description: >- + Date comparison for when resulting products was created, i.e. less + than, greater than etc. + schema: + type: string + - in: query + name: updated_at + description: >- + Date comparison for when resulting products was updated, i.e. less + than, greater than etc. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: string + - in: query + name: limit + description: Limit the number of products returned. + 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 + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The number of Products. + type: integer + offset: + description: The offset of the Product query. + type: integer + limit: + description: The limit of the Product query. + type: integer + products: + type: array + items: + $ref: '#/components/schemas/product' + /price-lists: + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. + x-authenticated: true + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + price_lists: + type: array + items: + $ref: '#/components/schemas/price_list' + count: + description: The number of Price Lists. + type: integer + offset: + description: The offset of the Price List query. + type: integer + limit: + description: The limit of the Price List query. + type: integer + '/price_lists/{id}': + 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 + requestBody: + content: + application/json: + schema: + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + 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: + properties: + id: + description: The id of the price. + type: string + region_id: + description: The id of the Region for which the price is used. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be 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 + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product: + $ref: '#/components/schemas/price_list' /product-tags: get: operationId: GetProductTags @@ -4113,8 +5230,11 @@ paths: amount: description: The amount to charge for the Product Variant. type: integer - sale_amount: - description: The sale amount to charge for the Product Variant. + 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 @@ -4146,7 +5266,27 @@ paths: - in: path name: id required: true - description: The id of the Product. + 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 products to skip in the result. + schema: + type: string + - in: query + name: limit + description: Limit the number of products returned. schema: type: string tags: @@ -4629,6 +5769,9 @@ paths: type: array items: properties: + id: + description: The id of the price. + type: string region_id: description: The id of the Region for which the price is used. type: string @@ -4640,8 +5783,11 @@ paths: amount: description: The amount to charge for the Product Variant. type: integer - sale_amount: - description: The sale amount to charge for the Product Variant. + 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 @@ -6608,6 +7754,73 @@ components: type: string country: $ref: '#/components/schemas/country' + batch_job: + title: Batch Job + description: A Batch Job. + x-resourceId: batch_job + properties: + id: + description: The unique identifier for the batch job. + type: string + type: + description: The type of batch job. + type: string + enum: + - product_import + - product_export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - processing + - completed + - canceled + - failed + created_by: + description: The unique identifier of the user that created the batch job. + type: string + context: + description: >- + The context of the batch job, the type of the batch job determines + what the context should contain. + type: object + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + type: object + pre_processed_at: + description: The date from which the job has been pre processed. + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + type: string + format: date-time + completed_at: + description: The date of the completion. + type: string + format: date-time + canceled_at: + description: The date of the concellation. + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time cart: title: Cart description: Represents a user cart @@ -7031,6 +8244,168 @@ components: format: date-time metadata: type: object + discount_condition_customer_group: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + x-resourceId: discount_condition_customer_group + properties: + customer_group_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product_collection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + x-resourceId: discount_condition_product_collection + properties: + product_collection_id: + description: The id of the Product Collection + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product_tag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + x-resourceId: discount_condition_product_tag + properties: + product_tag_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product_type: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + x-resourceId: discount_condition_product + properties: + product_type_id: + description: The id of the Product Type + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product: + title: Product Discount Condition + description: Associates a discount condition with a product + x-resourceId: discount_condition_product + properties: + product_id: + description: The id of the Product + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + x-resourceId: discount_condition + properties: + id: + description: The id of the Discount Condition. Will be prefixed by `discon_`. + type: string + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + update_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object discount_rule: title: Discount Rule description: >- @@ -7065,11 +8440,13 @@ components: enum: - total - item - valid_for: - description: A set of Products that the discount can be used for. + conditions: + description: >- + A set of conditions that can be used to limit when the discount can + be used type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/discount_condition' created_at: description: The date with timezone at which the resource was created. type: string @@ -7565,10 +8942,15 @@ components: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. type: integer - sale_amount: + min_quantity: description: >- - An optional sale amount that the Product Variant will be available - for when defined. + The minimum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + type: integer + max_quantity: + description: >- + The maximum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. type: integer variant_id: description: The id of the Product Variant that the Money Amount belongs to. @@ -8047,6 +9429,49 @@ components: metadata: description: An optional key-value map with additional information. type: object + price_list: + title: Price List + description: >- + Price Lists represents a set of prices that overrides the default price + for one or more product variants. + x-resourceId: price_list + properties: + id: + description: The id of the Price List. This value will be prefixed by `pl_`. + type: string + type: + description: >- + The type of Price List. This can be one of either `sale` or + `override`. + type: string + enum: + - sale + - override + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. + type: array + items: + $ref: '#/components/schemas/customer_group' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time product_collection: title: Product Collection description: Product Collections represents a group of Products that are related. diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 6cc525b2ab..fc3ac4fc46 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -200,89 +200,6 @@ } } }, - "/collections/{id}": { - "get": { - "operationId": "GetCollectionsCollection", - "summary": "Retrieve a Product Collection", - "description": "Retrieves a Product Collection.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Product Collection", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Collection" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" - } - } - } - } - } - } - } - } - }, - "/collections": { - "get": { - "operationId": "GetCollections", - "summary": "List Product 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 - } - } - ], - "tags": [ - "Collection" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" - } - } - } - } - } - } - } - } - }, "/carts/{id}/shipping-methods": { "post": { "operationId": "PostCartsCartShippingMethod", @@ -1009,7 +926,7 @@ }, "/store/carts/{id}": { "post": { - "operationId": "PostCartsCartPaymentMethodUpdate", + "operationId": "PostCartsCart", "summary": "Update a Cart\"", "description": "Updates a Cart.", "parameters": [ @@ -1027,17 +944,72 @@ "content": { "application/json": { "schema": { - "required": [ - "provider_id" - ], "properties": { - "provider_id": { + "region_id": { "type": "string", - "description": "The id of the Payment Provider." + "description": "The id of the Region to create the Cart in." }, - "data": { - "type": "object", - "description": "" + "country_code": { + "type": "string", + "description": "The 2 character ISO country code to create the Cart in." + }, + "email": { + "type": "string", + "description": "An email to be used on the Cart." + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "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" } } } @@ -1065,6 +1037,89 @@ } } }, + "/collections/{id}": { + "get": { + "operationId": "GetCollectionsCollection", + "summary": "Retrieve a Product Collection", + "description": "Retrieves a Product Collection.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product Collection", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + } + }, + "/collections": { + "get": { + "operationId": "GetCollections", + "summary": "List Product 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 + } + } + ], + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + } + }, "/gift-cards/{code}": { "get": { "operationId": "GetGiftCardsCode", @@ -2527,6 +2582,89 @@ } } }, + "batch_job": { + "title": "Batch Job", + "description": "A Batch Job.", + "x-resourceId": "batch_job", + "properties": { + "id": { + "description": "The unique identifier for the batch job.", + "type": "string" + }, + "type": { + "description": "The type of batch job.", + "type": "string", + "enum": [ + "product_import", + "product_export" + ] + }, + "status": { + "description": "The status of the batch job.", + "type": "string", + "enum": [ + "created", + "pre_processed", + "processing", + "completed", + "canceled", + "failed" + ] + }, + "created_by": { + "description": "The unique identifier of the user that created the batch job.", + "type": "string" + }, + "context": { + "description": "The context of the batch job, the type of the batch job determines what the context should contain.", + "type": "object" + }, + "dry_run": { + "description": "Specify if the job must apply the modifications or not.", + "type": "boolean", + "default": false + }, + "result": { + "description": "The result of the batch job.", + "type": "object" + }, + "pre_processed_at": { + "description": "The date from which the job has been pre processed.", + "type": "string", + "format": "date-time" + }, + "confirmed_at": { + "description": "The date when the confirmation has been done.", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date of the completion.", + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date of the concellation.", + "type": "string", + "format": "date-time" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + } + } + }, "cart": { "title": "Cart", "description": "Represents a user cart", @@ -3089,6 +3227,217 @@ } } }, + "discount_condition_customer_group": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a customer group", + "x-resourceId": "discount_condition_customer_group", + "properties": { + "customer_group_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product_collection": { + "title": "Product Collection Discount Condition", + "description": "Associates a discount condition with a product collection", + "x-resourceId": "discount_condition_product_collection", + "properties": { + "product_collection_id": { + "description": "The id of the Product Collection", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product_tag": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a product tag", + "x-resourceId": "discount_condition_product_tag", + "properties": { + "product_tag_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product_type": { + "title": "Product Type Discount Condition", + "description": "Associates a discount condition with a product type", + "x-resourceId": "discount_condition_product", + "properties": { + "product_type_id": { + "description": "The id of the Product Type", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition_product": { + "title": "Product Discount Condition", + "description": "Associates a discount condition with a product", + "x-resourceId": "discount_condition_product", + "properties": { + "product_id": { + "description": "The id of the Product", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "discount_condition": { + "title": "Discount Condition", + "description": "Holds rule conditions for when a discount is applicable", + "x-resourceId": "discount_condition", + "properties": { + "id": { + "description": "The id of the Discount Condition. Will be prefixed by `discon_`.", + "type": "string" + }, + "type": { + "description": "The type of the Condition", + "type": "string", + "enum": [ + "products", + "product_types", + "product_collections", + "product_tags", + "customer_groups" + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "update_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "discount_rule": { "title": "Discount Rule", "description": "Holds the rules that governs how a Discount is calculated when applied to a Cart.", @@ -3123,11 +3472,11 @@ "item" ] }, - "valid_for": { - "description": "A set of Products that the discount can be used for.", + "conditions": { + "description": "A set of conditions that can be used to limit when the discount can be used", "type": "array", "items": { - "$ref": "#/components/schemas/product" + "$ref": "#/components/schemas/discount_condition" } }, "created_at": { @@ -3719,8 +4068,12 @@ "description": "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.", "type": "integer" }, - "sale_amount": { - "description": "An optional sale amount that the Product Variant will be available for when defined.", + "min_quantity": { + "description": "The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", "type": "integer" }, "variant_id": { @@ -4317,6 +4670,57 @@ } } }, + "price_list": { + "title": "Price List", + "description": "Price Lists represents a set of prices that overrides the default price for one or more product variants.", + "x-resourceId": "price_list", + "properties": { + "id": { + "description": "The id of the Price List. This value will be prefixed by `pl_`.", + "type": "string" + }, + "type": { + "description": "The type of Price List. This can be one of either `sale` or `override`.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The date with timezone that the Price List stops being valid.", + "type": "string", + "format": "date-time" + }, + "customer_groups": { + "description": "The Customer Groups that the Price List applies to.", + "type": "array", + "items": { + "$ref": "#/components/schemas/customer_group" + } + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + } + } + }, "product_collection": { "title": "Product Collection", "description": "Product Collections represents a group of Products that are related.", diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 915364c7fd..81da5403dc 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -38,7 +38,7 @@ tags: - name: Product Variant x-resourceId: product_variant servers: - - url: "https://api.medusa-commerce.com/store" + - url: 'https://api.medusa-commerce.com/store' paths: /auth: post: @@ -51,14 +51,14 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' requestBody: content: application/json: @@ -81,7 +81,7 @@ paths: tags: - Auth responses: - "200": + '200': description: OK get: operationId: GetAuth @@ -91,15 +91,15 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" - "/auth/{email}": + $ref: '#/components/schemas/customer' + '/auth/{email}': get: operationId: GetAuthEmail summary: Check if email has account @@ -114,7 +114,7 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: @@ -122,6 +122,693 @@ paths: properties: exists: type: boolean + '/collections/{id}': + get: + operationId: GetCollectionsCollection + summary: Retrieve a Product Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + collection: + $ref: '#/components/schemas/product_collection' + /collections: + get: + operationId: GetCollections + summary: List Product 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 + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + collection: + $ref: '#/components/schemas/product_collection' + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Retrieve 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 + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + description: The id of the Gift Card + code: + description: The code of the Gift Card + value: + description: The original value of the Gift Card. + balance: + description: The current balanace of the Gift Card + region: + $ref: '#/components/schemas/region' + /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 + requestBody: + content: + application/json: + schema: + required: + - address + properties: + address: + description: The Address to add to the Customer. + anyOf: + - $ref: '#/components/schemas/address' + tags: + - Customer + responses: + '200': + description: A successful response + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. + parameters: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The Customer's email address. + 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 for login. + phone: + type: string + description: The Customer's phone number. + '/customers/me/addresses/{address_id}': + delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresse. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + 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: + properties: + address: + description: The updated Address. + anyOf: + - $ref: '#/components/schemas/address' + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + /customers/me: + get: + operationId: GetCustomersCustomer + summary: Retrieves a Customer + description: >- + Retrieves a Customer - the Customer must be logged in to retrieve their + details. + x-authenticated: true + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + post: + operationId: PostCustomersCustomer + summary: Update Customer details + description: Updates a Customer's saved details. + x-authenticated: true + requestBody: + content: + application/json: + schema: + 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' + 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 + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + /customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Retrieve saved 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 + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + 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. + /customers/me/orders: + get: + operationId: GetCustomersCustomerOrders + summary: Retrieve Customer Orders + description: Retrieves a list of a Customer's Orders. + x-authenticated: true + parameters: + - in: query + name: limit + description: How many addresses to return. + schema: + type: integer + - in: query + name: offset + description: The offset in the resulting addresses. + schema: + type: integer + - in: query + name: fields + description: >- + (Comma separated string) Which fields should be included in the + resulting addresses. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated string) Which relations should be expanded in the + resulting addresses. + schema: + type: string + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The total number of Orders. + type: integer + offset: + description: The offset for pagination. + type: integer + limit: + description: 'The maxmimum number of Orders to return,' + type: integer + orders: + type: array + items: + $ref: '#/components/schemas/order' + /customers/password-token: + post: + operationId: PostCustomersCustomerPasswordToken + summary: Creates a reset password token + 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. + parameters: [] + tags: + - Customer + responses: + '204': + description: OK + requestBody: + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + type: string + description: Email of the user whose password should be reset. + /customers/reset-password: + post: + operationId: PostCustomersResetPassword + summary: Resets Customer password + description: >- + Resets a Customer's password using a password token created by a + previous /password-token request. + parameters: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - token + - password + properties: + email: + type: string + description: The Customer's email. + token: + type: string + description: The password token created by a /password-token request. + password: + type: string + description: The new password to set for the Customer. + '/orders/cart/{cart_id}': + get: + operationId: GetOrdersOrderCartId + summary: Retrieves Order 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 + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Retrieves an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + /orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: >- + Looks for an Order with a given `display_id`, `email` pair. The + `display_id`, `email` pair must match in order for the Order to be + returned. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: email + required: true + description: The email of the Order with the given display_id. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/products/{id}': + get: + operationId: GetProductsProduct + summary: Retrieves a Product + description: Retrieves a Product. + parameters: + - in: path + name: id + required: true + description: The id of the Product. + schema: + type: string + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product: + $ref: '#/components/schemas/product' + /products: + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Products. + parameters: + - in: query + name: q + description: Query used for searching products. + schema: + type: string + - in: query + name: id + description: Id of the product to search for. + schema: + type: string + - 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: Tags to search for + schema: + type: array + items: + type: string + - in: query + name: title + description: to search for. + schema: + type: string + - in: query + name: description + description: to search for. + schema: + type: string + - in: query + name: handle + description: 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: created_at + description: >- + Date comparison for when resulting products was created, i.e. less + than, greater than etc. + schema: + type: object + - in: query + name: updated_at + description: >- + Date comparison for when resulting products was updated, i.e. less + than, greater than etc. + schema: + type: object + - in: query + name: deleted_at + description: >- + Date comparison for when resulting products was deleted, i.e. less + than, greater than etc. + schema: + type: object + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: string + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: string + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The total number of Products. + type: integer + offset: + description: The offset for pagination. + type: integer + limit: + description: 'The maxmimum number of Products to return,' + type: integer + products: + type: array + items: + $ref: '#/components/schemas/product' + '/regions/{id}': + get: + operationId: GetRegionsRegion + summary: Retrieves a Region + description: Retrieves a Region. + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + /regions: + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The total number of regions. + type: integer + offset: + description: The offset for pagination. + type: integer + limit: + description: 'The maxmimum number of regions to return,' + type: integer + regions: + type: array + items: + $ref: '#/components/schemas/region' '/carts/{id}/shipping-methods': post: operationId: PostCartsCartShippingMethod @@ -137,7 +824,7 @@ paths: schema: type: string responses: - "200": + '200': description: A successful response content: application/json: @@ -303,7 +990,7 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -350,7 +1037,7 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -379,7 +1066,7 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -443,7 +1130,7 @@ paths: schema: properties: cart: - $ref: "#/components/schemas/cart" + $ref: '#/components/schemas/cart' requestBody: content: application/json: @@ -600,14 +1287,14 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: schema: properties: cart: - $ref: "#/components/schemas/cart" + $ref: '#/components/schemas/cart' requestBody: content: application/json: @@ -621,7 +1308,7 @@ paths: description: The id of the Payment Provider. '/store/carts/{id}': post: - operationId: PostCartsCartPaymentMethodUpdate + operationId: PostCartsCart summary: Update a Cart" description: Updates a Cart. parameters: @@ -635,19 +1322,54 @@ paths: content: application/json: schema: - required: - - provider_id properties: - provider_id: + region_id: type: string - description: The id of the Payment Provider. - data: + 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. + email: + type: string + description: An email to be used on the Cart. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + 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 - description: '' tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -655,693 +1377,6 @@ paths: properties: cart: $ref: '#/components/schemas/cart' - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Retrieve 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 - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - description: The id of the Gift Card - code: - description: The code of the Gift Card - value: - description: The original value of the Gift Card. - balance: - description: The current balanace of the Gift Card - region: - $ref: '#/components/schemas/region' - '/orders/cart/{cart_id}': - get: - operationId: GetOrdersOrderCartId - summary: Retrieves Order 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 - tags: - - Order - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}': - get: - operationId: GetOrdersOrder - summary: Retrieves an Order - description: Retrieves an Order - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - /orders: - get: - operationId: GetOrders - summary: Look Up an Order - description: >- - Looks for an Order with a given `display_id`, `email` pair. The - `display_id`, `email` pair must match in order for the Order to be - returned. - parameters: - - in: query - name: display_id - required: true - description: The display id given to the Order. - schema: - type: number - - in: query - name: email - required: true - description: The email of the Order with the given display_id. - schema: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/collections/{id}': - get: - operationId: GetCollectionsCollection - summary: Retrieve a Product Collection - description: Retrieves a Product Collection. - parameters: - - in: path - name: id - required: true - description: The id of the Product Collection - schema: - type: string - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - /collections: - get: - operationId: GetCollections - summary: List Product 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 - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - /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 - requestBody: - content: - application/json: - schema: - required: - - address - properties: - address: - description: The Address to add to the Customer. - anyOf: - - $ref: '#/components/schemas/address' - tags: - - Customer - responses: - '200': - description: A successful response - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - /customers: - post: - operationId: PostCustomers - summary: Create a Customer - description: Creates a Customer account. - parameters: [] - tags: - - Customer - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The Customer's email address. - 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 for login. - phone: - type: string - description: The Customer's phone number. - '/customers/me/addresses/{address_id}': - delete: - operationId: DeleteCustomersCustomerAddressesAddress - summary: Delete an Address - description: Removes an Address from the Customer's saved addresse. - x-authenticated: true - parameters: - - in: path - name: address_id - required: true - description: The id of the Address to remove. - schema: - type: string - tags: - - Customer - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - 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: - properties: - address: - description: The updated Address. - anyOf: - - $ref: '#/components/schemas/address' - tags: - - Customer - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - /customers/me: - get: - operationId: GetCustomersCustomer - summary: Retrieves a Customer - description: >- - Retrieves a Customer - the Customer must be logged in to retrieve their - details. - x-authenticated: true - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - post: - operationId: PostCustomersCustomer - summary: Update Customer details - description: Updates a Customer's saved details. - x-authenticated: true - requestBody: - content: - application/json: - schema: - 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' - 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 - tags: - - Customer - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - /customers/me/payment-methods: - get: - operationId: GetCustomersCustomerPaymentMethods - summary: Retrieve saved 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 - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - 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. - /customers/me/orders: - get: - operationId: GetCustomersCustomerOrders - summary: Retrieve Customer Orders - description: Retrieves a list of a Customer's Orders. - x-authenticated: true - parameters: - - in: query - name: limit - description: How many addresses to return. - schema: - type: integer - - in: query - name: offset - description: The offset in the resulting addresses. - schema: - type: integer - - in: query - name: fields - description: >- - (Comma separated string) Which fields should be included in the - resulting addresses. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated string) Which relations should be expanded in the - resulting addresses. - schema: - type: string - tags: - - Customer - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - count: - description: The total number of Orders. - type: integer - offset: - description: The offset for pagination. - type: integer - limit: - description: 'The maxmimum number of Orders to return,' - type: integer - orders: - type: array - items: - $ref: '#/components/schemas/order' - /customers/password-token: - post: - operationId: PostCustomersCustomerPasswordToken - summary: Creates a reset password token - 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. - parameters: [] - tags: - - Customer - responses: - '204': - description: OK - requestBody: - content: - application/json: - schema: - type: object - required: - - email - properties: - email: - type: string - description: Email of the user whose password should be reset. - /customers/reset-password: - post: - operationId: PostCustomersResetPassword - summary: Resets Customer password - description: >- - Resets a Customer's password using a password token created by a - previous /password-token request. - parameters: [] - tags: - - Customer - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - token - - password - properties: - email: - type: string - description: The Customer's email. - token: - type: string - description: The password token created by a /password-token request. - password: - type: string - description: The new password to set for the Customer. - '/regions/{id}': - get: - operationId: GetRegionsRegion - summary: Retrieves a Region - description: Retrieves a Region. - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: '#/components/schemas/region' - /regions: - get: - operationId: GetRegions - summary: List Regions - description: Retrieves a list of Regions. - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - count: - description: The total number of regions. - type: integer - offset: - description: The offset for pagination. - type: integer - limit: - description: 'The maxmimum number of regions to return,' - type: integer - regions: - type: array - items: - $ref: '#/components/schemas/region' - '/products/{id}': - get: - operationId: GetProductsProduct - summary: Retrieves a Product - description: Retrieves a Product. - parameters: - - in: path - name: id - required: true - description: The id of the Product. - schema: - type: string - tags: - - Product - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - product: - $ref: "#/components/schemas/product" - /products: - get: - operationId: GetProducts - summary: List Products - description: Retrieves a list of Products. - parameters: - - in: query - name: q - description: Query used for searching products. - schema: - type: string - - in: query - name: id - description: Id of the product to search for. - schema: - type: string - - 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: Tags to search for - schema: - type: array - items: - type: string - - in: query - name: title - description: to search for. - schema: - type: string - - in: query - name: description - description: to search for. - schema: - type: string - - in: query - name: handle - description: 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: created_at - description: >- - Date comparison for when resulting products was created, i.e. less - than, greater than etc. - schema: - type: object - - in: query - name: updated_at - description: >- - Date comparison for when resulting products was updated, i.e. less - than, greater than etc. - schema: - type: object - - in: query - name: deleted_at - description: >- - Date comparison for when resulting products was deleted, i.e. less - than, greater than etc. - schema: - type: object - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: string - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: string - tags: - - Product - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - count: - description: The total number of Products. - type: integer - offset: - description: The offset for pagination. - type: integer - limit: - description: "The maxmimum number of Products to return," - type: integer - products: - type: array - items: - $ref: '#/components/schemas/product' '/return-reasons/{id}': get: operationId: GetReturnReasonsReason @@ -1357,14 +1392,14 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: schema: properties: return_reason: - $ref: "#/components/schemas/return_reason" + $ref: '#/components/schemas/return_reason' /return-reasons: get: operationId: GetReturnReasons @@ -1373,7 +1408,7 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: @@ -1382,7 +1417,7 @@ paths: return_reasons: type: array items: - $ref: "#/components/schemas/return_reason" + $ref: '#/components/schemas/return_reason' /returns: post: operationId: PostReturns @@ -1430,14 +1465,14 @@ paths: tags: - Return responses: - "200": + '200': description: OK content: application/json: schema: properties: return: - $ref: "#/components/schemas/return" + $ref: '#/components/schemas/return' /shipping-options: get: operationId: GetShippingOptions @@ -1464,7 +1499,7 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: @@ -1473,8 +1508,8 @@ paths: shipping_options: type: array items: - $ref: "#/components/schemas/shipping_option" - "/shipping-options/{cart_id}": + $ref: '#/components/schemas/shipping_option' + '/shipping-options/{cart_id}': get: operationId: GetShippingOptionsCartId summary: Retrieve Shipping Options for Cart @@ -1489,7 +1524,7 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: @@ -1498,7 +1533,7 @@ paths: shipping_options: type: array items: - $ref: "#/components/schemas/shipping_option" + $ref: '#/components/schemas/shipping_option' /swaps: post: operationId: PostSwaps @@ -1560,15 +1595,15 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: schema: properties: swap: - $ref: "#/components/schemas/swap" - "/swaps/{cart_id}": + $ref: '#/components/schemas/swap' + '/swaps/{cart_id}': get: operationId: GetSwapsSwapCartId summary: Retrieve Swap by Cart id @@ -1583,15 +1618,15 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: schema: properties: swap: - $ref: "#/components/schemas/swap" - "/variants/{variant_id}": + $ref: '#/components/schemas/swap' + '/variants/{variant_id}': get: operationId: GetVariantsVariant summary: Retrieve a Product Variant @@ -1606,14 +1641,14 @@ paths: tags: - Product Variant responses: - "200": + '200': description: OK content: application/json: schema: properties: variant: - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' /variants: get: operationId: GetVariants @@ -1642,7 +1677,7 @@ paths: tags: - Product Variant responses: - "200": + '200': description: OK content: application/json: @@ -1651,7 +1686,7 @@ paths: variants: type: array items: - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' components: schemas: address: @@ -1678,7 +1713,74 @@ components: country_code: type: string country: - $ref: "#/components/schemas/country" + $ref: '#/components/schemas/country' + batch_job: + title: Batch Job + description: A Batch Job. + x-resourceId: batch_job + properties: + id: + description: The unique identifier for the batch job. + type: string + type: + description: The type of batch job. + type: string + enum: + - product_import + - product_export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - processing + - completed + - canceled + - failed + created_by: + description: The unique identifier of the user that created the batch job. + type: string + context: + description: >- + The context of the batch job, the type of the batch job determines + what the context should contain. + type: object + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + type: object + pre_processed_at: + description: The date from which the job has been pre processed. + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + type: string + format: date-time + completed_at: + description: The date of the completion. + type: string + format: date-time + canceled_at: + description: The date of the concellation. + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time cart: title: Cart description: Represents a user cart @@ -1691,43 +1793,43 @@ components: billing_address_id: type: string billing_address: - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' shipping_address_id: type: string shipping_address: - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' items: type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' region_id: type: string region: - $ref: "#/components/schemas/region" + $ref: '#/components/schemas/region' discounts: type: array items: - $ref: "#/components/schemas/region" + $ref: '#/components/schemas/region' gift_cards: type: array items: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' customer_id: type: string customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' payment_session: - $ref: "#/components/schemas/payment_session" + $ref: '#/components/schemas/payment_session' payment_sessions: type: array items: - $ref: "#/components/schemas/payment_session" + $ref: '#/components/schemas/payment_session' payment: - $ref: "#/components/schemas/payment" + $ref: '#/components/schemas/payment' shipping_methods: type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' type: type: string enum: @@ -1794,19 +1896,19 @@ components: images: type: array items: - $ref: "#/components/schemas/claim_image" + $ref: '#/components/schemas/claim_image' claim_order_id: type: string item_id: type: string item: description: The Line Item that the claim refers to - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' variant_id: type: string variant: description: The Product Variant that is claimed. - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' reason: description: The reason for the claim type: string @@ -1816,7 +1918,7 @@ components: - production_failure - other note: - description: "An optional note about the claim, for additional information" + description: 'An optional note about the claim, for additional information' type: string quantity: description: >- @@ -1827,7 +1929,7 @@ components: description: User defined tags for easy filtering and grouping. type: array items: - $ref: "#/components/schemas/claim_tag" + $ref: '#/components/schemas/claim_tag' created_at: type: string format: date-time @@ -1876,36 +1978,36 @@ components: description: The items that have been claimed type: array items: - $ref: "#/components/schemas/claim_item" + $ref: '#/components/schemas/claim_item' additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' order_id: description: The id of the order that the claim comes from. type: string return_order: description: Holds information about the return if the claim is to be returned - $ref: "#/components/schemas/return" + $ref: '#/components/schemas/return' shipping_address_id: description: The id of the address that the new items should be shipped to type: string shipping_address: description: The address that the new items should be shipped to - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: "#/components/schemas/fulfillment" + $ref: '#/components/schemas/fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer @@ -2020,11 +2122,11 @@ components: The id of the Shipping Option that the custom shipping option overrides anyOf: - - $ref: "#/components/schemas/shipping_option" + - $ref: '#/components/schemas/shipping_option' cart_id: description: The id of the Cart that the custom shipping option is attached to anyOf: - - $ref: "#/components/schemas/cart" + - $ref: '#/components/schemas/cart' created_at: description: The date with timezone at which the resource was created. type: string @@ -2078,11 +2180,11 @@ components: billing_address: description: The Customer's billing address. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_addresses: type: array items: - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' first_name: type: string last_name: @@ -2102,6 +2204,168 @@ components: format: date-time metadata: type: object + discount_condition_customer_group: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + x-resourceId: discount_condition_customer_group + properties: + customer_group_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product_collection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + x-resourceId: discount_condition_product_collection + properties: + product_collection_id: + description: The id of the Product Collection + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product_tag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + x-resourceId: discount_condition_product_tag + properties: + product_tag_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product_type: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + x-resourceId: discount_condition_product + properties: + product_type_id: + description: The id of the Product Type + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition_product: + title: Product Discount Condition + description: Associates a discount condition with a product + x-resourceId: discount_condition_product + properties: + product_id: + description: The id of the Product + type: string + condition_id: + description: The id of the Discount Condition + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object + discount_condition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + x-resourceId: discount_condition + properties: + id: + description: The id of the Discount Condition. Will be prefixed by `discon_`. + type: string + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + update_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time + metadata: + description: An optional key-value map with additional information. + type: object discount_rule: title: Discount Rule description: >- @@ -2136,11 +2400,13 @@ components: enum: - total - item - valid_for: - description: A set of Products that the discount can be used for. + conditions: + description: >- + A set of conditions that can be used to limit when the discount can + be used type: array items: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/discount_condition' created_at: description: The date with timezone at which the resource was created. type: string @@ -2179,7 +2445,7 @@ components: rule: description: The Discount Rule that governs the behaviour of the Discount anyOf: - - $ref: "#/components/schemas/discount_rule" + - $ref: '#/components/schemas/discount_rule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -2202,7 +2468,7 @@ components: description: The Regions in which the Discount can be used type: array items: - $ref: "#/components/schemas/region" + $ref: '#/components/schemas/region' usage_limit: description: The maximum number of times that a discount can be used. type: integer @@ -2242,12 +2508,12 @@ components: type: string cart: anyOf: - - $ref: "#/components/schemas/cart" + - $ref: '#/components/schemas/cart' order_id: type: string order: anyOf: - - $ref: "#/components/schemas/order" + - $ref: '#/components/schemas/order' canceled_at: type: string format: date-time @@ -2285,7 +2551,7 @@ components: item: description: The Line Item that the Fulfillment Item references. anyOf: - - $ref: "#/components/schemas/line_item" + - $ref: '#/components/schemas/line_item' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer @@ -2340,7 +2606,7 @@ components: about how many of each Line Item has been fulfilled. type: array items: - $ref: "#/components/schemas/fulfillment_item" + $ref: '#/components/schemas/fulfillment_item' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -2348,7 +2614,7 @@ components: Provider. type: array items: - $ref: "#/components/schemas/tracking_link" + $ref: '#/components/schemas/tracking_link' tracking_numbers: deprecated: true description: >- @@ -2399,7 +2665,7 @@ components: gift_card: description: The Gift Card that was used in the transaction. anyOf: - - $ref: "#/components/schemas/gift_card" + - $ref: '#/components/schemas/gift_card' order_id: description: The id of the Order that the Gift Card was used to pay for. type: string @@ -2437,7 +2703,7 @@ components: region: description: The Region in which the Gift Card is available. anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' order_id: description: The id of the Order that the Gift Card was purchased in. type: string @@ -2585,7 +2851,7 @@ components: variant: description: The Product Variant contained in the Line Item. anyOf: - - $ref: "#/components/schemas/product_variant" + - $ref: '#/components/schemas/product_variant' quantity: description: The quantity of the content in the Line Item. type: integer @@ -2636,10 +2902,15 @@ components: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. type: integer - sale_amount: + min_quantity: description: >- - An optional sale amount that the Product Variant will be available - for when defined. + The minimum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + type: integer + max_quantity: + description: >- + The maximum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. type: integer variant_id: description: The id of the Product Variant that the Money Amount belongs to. @@ -2650,7 +2921,7 @@ components: region: description: The Region that the Money Amount is defined for. anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' created_at: description: The date with timezone at which the resource was created. type: string @@ -2686,7 +2957,7 @@ components: author: description: The author of the note. anyOf: - - $ref: "#/components/schemas/user" + - $ref: '#/components/schemas/user' created_at: description: The date with timezone at which the resource was created. type: string @@ -2745,7 +3016,7 @@ components: customer: description: The Customer that the Notification was sent to. anyOf: - - $ref: "#/components/schemas/customer" + - $ref: '#/components/schemas/customer' to: description: >- The address that the Notification was sent to. This will usually be @@ -2766,7 +3037,7 @@ components: Notification. type: array items: - $ref: "#/components/schemas/notification_resend" + $ref: '#/components/schemas/notification_resend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string @@ -2885,76 +3156,76 @@ components: discounts: type: array items: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' email: type: string billing_address_id: type: string billing_address: anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_address_id: type: string shipping_address: anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' items: type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' region_id: type: string region: anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' gift_cards: type: array items: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' customer_id: type: string customer: anyOf: - - $ref: "#/components/schemas/customer" + - $ref: '#/components/schemas/customer' payment_session: anyOf: - - $ref: "#/components/schemas/payment_session" + - $ref: '#/components/schemas/payment_session' payment_sessions: type: array items: - $ref: "#/components/schemas/payment_session" + $ref: '#/components/schemas/payment_session' payments: type: array items: - $ref: "#/components/schemas/payment" + $ref: '#/components/schemas/payment' shipping_methods: type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' fulfillments: type: array items: - $ref: "#/components/schemas/fulfillment" + $ref: '#/components/schemas/fulfillment' returns: type: array items: - $ref: "#/components/schemas/return" + $ref: '#/components/schemas/return' claims: type: array items: - $ref: "#/components/schemas/claim_order" + $ref: '#/components/schemas/claim_order' refunds: type: array items: - $ref: "#/components/schemas/refund" + $ref: '#/components/schemas/refund' swaps: type: array items: - $ref: "#/components/schemas/refund" + $ref: '#/components/schemas/refund' gift_card_transactions: type: array items: - $ref: "#/components/schemas/gift_card_transaction" + $ref: '#/components/schemas/gift_card_transaction' canceled_at: type: string format: date-time @@ -3118,6 +3389,49 @@ components: metadata: description: An optional key-value map with additional information. type: object + price_list: + title: Price List + description: >- + Price Lists represents a set of prices that overrides the default price + for one or more product variants. + x-resourceId: price_list + properties: + id: + description: The id of the Price List. This value will be prefixed by `pl_`. + type: string + type: + description: >- + The type of Price List. This can be one of either `sale` or + `override`. + type: string + enum: + - sale + - override + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. + type: array + items: + $ref: '#/components/schemas/customer_group' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + type: string + format: date-time product_collection: title: Product Collection description: Product Collections represents a group of Products that are related. @@ -3220,7 +3534,7 @@ components: description: The Product Option Values that are defined for the Product Option. type: array items: - $ref: "#/components/schemas/product_option_value" + $ref: '#/components/schemas/product_option_value' product_id: description: The id of the Product that the Product Option is defined for. type: string @@ -3380,7 +3694,7 @@ components: Region. type: array items: - $ref: "#/components/schemas/money_amount" + $ref: '#/components/schemas/money_amount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -3461,7 +3775,7 @@ components: description: The Product Option Values specified for the Product Variant. type: array items: - $ref: "#/components/schemas/product_option_value" + $ref: '#/components/schemas/product_option_value' created_at: description: The date with timezone at which the resource was created. type: string @@ -3519,7 +3833,7 @@ components: description: Images of the Product type: array items: - $ref: "#/components/schemas/image" + $ref: '#/components/schemas/image' thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -3530,14 +3844,14 @@ components: Option Values. type: array items: - $ref: "#/components/schemas/product_option" + $ref: '#/components/schemas/product_option' variants: description: >- The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. type: array items: - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' profile_id: description: >- The id of the Shipping Profile that the Product belongs to. Shipping @@ -3591,16 +3905,16 @@ components: type: description: The Product Type of the Product (e.g. "Clothing") anyOf: - - $ref: "#/components/schemas/product_type" + - $ref: '#/components/schemas/product_type' collection: description: The Product Collection that the Product belongs to (e.g. "SS20") anyOf: - - $ref: "#/components/schemas/product_collection" + - $ref: '#/components/schemas/product_collection' tags: description: The Product Tags assigned to the Product. type: array items: - $ref: "#/components/schemas/product_tag" + $ref: '#/components/schemas/product_tag' created_at: description: The date with timezone at which the resource was created. type: string @@ -3692,21 +4006,21 @@ components: description: The countries that are included in the Region. type: array items: - $ref: "#/components/schemas/country" + $ref: '#/components/schemas/country' payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. type: array items: - $ref: "#/components/schemas/payment_provider" + $ref: '#/components/schemas/payment_provider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. type: array items: - $ref: "#/components/schemas/fulfillment_provider" + $ref: '#/components/schemas/fulfillment_provider' created_at: description: The date with timezone at which the resource was created. type: string @@ -3738,7 +4052,7 @@ components: item: description: The Line Item that the Return Item references. anyOf: - - $ref: "#/components/schemas/line_item" + - $ref: '#/components/schemas/line_item' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -3756,7 +4070,7 @@ components: reason: description: The reason for returning the item. anyOf: - - $ref: "#/components/schemas/return_reason" + - $ref: '#/components/schemas/return_reason' note: description: An optional note with additional details about the Return. type: string @@ -3818,7 +4132,7 @@ components: items: description: >- The Return Items that will be shipped back to the warehouse. type: - array items: $ref: + array items: $ref: swap_id: description: The id of the Swap that the Return is a part of. type: string @@ -3833,7 +4147,7 @@ components: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. anyOf: - - $ref: "#/components/schemas/shipping_method" + - $ref: '#/components/schemas/shipping_method' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -3884,7 +4198,7 @@ components: shipping_option: description: The Shipping Option that the Shipping Method is built from. anyOf: - - $ref: "#/components/schemas/shipping_option" + - $ref: '#/components/schemas/shipping_option' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -3970,7 +4284,7 @@ components: region: description: The id of the Region that the Shipping Option belongs to. anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' profile_id: description: >- The id of the Shipping Profile that the Shipping Option belongs to. @@ -4008,7 +4322,7 @@ components: be available for a Cart. type: array items: - $ref: "#/components/schemas/shipping_option_requirement" + $ref: '#/components/schemas/shipping_option_requirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -4059,7 +4373,7 @@ components: description: The Products that the Shipping Profile defines Shipping Options for. type: array items: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -4067,7 +4381,7 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/shipping_option" + - $ref: '#/components/schemas/shipping_option' created_at: description: The date with timezone at which the resource was created. type: string @@ -4113,7 +4427,7 @@ components: type: object store: title: Store - description: "Holds settings for the Store, such as name, currencies, etc." + description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store properties: id: @@ -4131,7 +4445,7 @@ components: description: The currencies that are enabled for the Store. type: array items: - $ref: "#/components/schemas/currency" + $ref: '#/components/schemas/currency' swap_link_template: description: >- A template to generate Swap links from use {{cart_id}} to include @@ -4197,22 +4511,22 @@ components: description: The new Line Items to ship to the Customer. type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' return_order: description: The Return that is issued for the return part of the Swap. anyOf: - - $ref: "#/components/schemas/return" + - $ref: '#/components/schemas/return' fulfillments: description: The Fulfillments used to send the new Line Items. type: array items: - $ref: "#/components/schemas/fulfillment" + $ref: '#/components/schemas/fulfillment' payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. anyOf: - - $ref: "#/components/schemas/payment" + - $ref: '#/components/schemas/payment' difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -4224,17 +4538,17 @@ components: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_methods: description: The Shipping Methods used to fulfill the addtional items purchased. type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string allow_backorder: - description: "If true, swaps can be completed with items out of stock" + description: 'If true, swaps can be completed with items out of stock' type: boolean confirmed_at: description: >- @@ -4255,7 +4569,7 @@ components: type: string format: date-time no_notification: - description: "If set to true, no notification will be sent related to this swap" + description: 'If set to true, no notification will be sent related to this swap' type: boolean metadata: description: An optional key-value map with additional information. @@ -4393,7 +4707,7 @@ components: last_name: description: The Customer's billing address. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' created_at: type: string format: date-time diff --git a/docs/content/advanced/backend/subscribers/events-list.md b/docs/content/advanced/backend/subscribers/events-list.md index 333e5c428a..37a954fc61 100644 --- a/docs/content/advanced/backend/subscribers/events-list.md +++ b/docs/content/advanced/backend/subscribers/events-list.md @@ -96,6 +96,115 @@ Object of the following format: + + + +`batch.pre_processed` + + + + +Triggered after the `preProcessBatchJob` of a batch job stategy is done executing. + + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.confirmed` + + + + +Triggered after the batch job is done pre-processing and the batch job is not in dry-run mode. + + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.processing` + + + +Triggered when a batch job starts processing after it's confirmed. + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.completed` + + + +Triggered when a batch job is done processing and is completed. + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.failed` + + + +Triggered when an error occurs while running a batch job and the batch job fails. + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + @@ -167,7 +276,7 @@ Triggered when a cart and data associated with it (payment sessions, shipping me -The entire cart as an object. You can refer to the [Cart entity](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/models/cart.ts) for an idea of what fields to expect. +An object with at least the ID of the cart, however, in most cases the entire cart model is available. You can refer to the [Cart entity](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/models/cart.ts) for an idea of what fields to expect. @@ -915,7 +1024,7 @@ Object of the following format: ```js { id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + no_notification //(optional) boolean indicating whether a notification should be sent or not } ``` @@ -1145,7 +1254,7 @@ Object of the following format: { id, //string ID of order return_id, //string ID of return - no_notification //boolean indicating whether a notification should be sent or not + no_notification //(optional) boolean indicating whether a notification should be sent or not } ``` @@ -1340,6 +1449,15 @@ Triggered when a product and data associated with it (options, variant orders, e 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. +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 +{ + id, //id of product + field //an array of field names that were updated +} +``` + @@ -1459,7 +1577,7 @@ Object of the following format: { id, //string ID of variant product_id, //string ID of product - metadata //object of additional data + metadata //object of the `metadata` field of the variant } ``` diff --git a/docs/content/deployments/server/deploying-on-heroku.mdx b/docs/content/deployments/server/deploying-on-heroku.mdx index 76f2d2ba79..26730927ca 100644 --- a/docs/content/deployments/server/deploying-on-heroku.mdx +++ b/docs/content/deployments/server/deploying-on-heroku.mdx @@ -6,6 +6,10 @@ import TabItem from '@theme/TabItem'; In this document, you'll learn how to deploy your Medusa server on Heroku. Heroku is a PaaS (Platform as a Service) that allows you to easily deploy your applications in the cloud. +Alternatively, you can use this button to deploy the Medusa server to Heroku directly: + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/medusajs/medusa-starter-default/tree/feat/deploy-heroku) +