diff --git a/.changeset/angry-boxes-press.md b/.changeset/angry-boxes-press.md deleted file mode 100644 index e61ccf2975..0000000000 --- a/.changeset/angry-boxes-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/inventory": patch ---- - -List inventory items based on locations diff --git a/.changeset/angry-trains-march.md b/.changeset/angry-trains-march.md deleted file mode 100644 index 9a8c75d98a..0000000000 --- a/.changeset/angry-trains-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -add location support in fulfillment modal diff --git a/.changeset/beige-ties-hunt.md b/.changeset/beige-ties-hunt.md deleted file mode 100644 index d561fd891c..0000000000 --- a/.changeset/beige-ties-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -Chores(medusa): draft order create improvement perf (first step) diff --git a/.changeset/brave-goats-pay.md b/.changeset/brave-goats-pay.md deleted file mode 100644 index 8b63b1e7f0..0000000000 --- a/.changeset/brave-goats-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Plugin repository loader to work with Typeorm update diff --git a/.changeset/brave-guests-mate.md b/.changeset/brave-guests-mate.md deleted file mode 100644 index 59313bc2c2..0000000000 --- a/.changeset/brave-guests-mate.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"@medusajs/medusa": minor -"medusa-plugin-sendgrid": patch -"medusa-payment-stripe": patch -"medusa-plugin-algolia": patch -"medusa-source-shopify": patch -"medusa-core-utils": patch -"medusa-file-minio": patch -"medusa-interfaces": patch -"medusa-test-utils": patch -"@medusajs/stock-location": patch -"@medusajs/inventory": patch -"@medusajs/medusa-js": patch ---- - -chore(medusa): Typeorm fixes / enhancements -- upgrade typeorm from 0.2.51 to 0.3.11 -- Plugin repository loader to work with Typeorm update diff --git a/.changeset/brown-wombats-jam.md b/.changeset/brown-wombats-jam.md deleted file mode 100644 index d2f0443adf..0000000000 --- a/.changeset/brown-wombats-jam.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/admin": patch ---- - -fix(admin-ui): Admin UI fixes / enhancements - -- Inventory and order UI fixes and tweaks -- focus-border clipping -- Fix use of `expand` parameter on order page -- Fix location address editing form state -- ensure that the allocation indicator is correctly displayed -- Fix inventory table pagination on location filter change -- Try and ensure allocation table checkmarks align better -- Add gap in table actions -- remove allocate button if no more allcoations can be made -- update edit-allocation sidebar -- create/update/delete inventory items according to inventory items on the variant -- Fix minor bugs related to the edit-allocation modal -- move tailwind to direct dependency -- display error messages for batch jobs -- draft order shipping details -- Implements redesigned public facing pages of admin UI. -- Add location names to fulfilment rows and timeline events -- Encode location id in URL on location table diff --git a/.changeset/clean-carrots-sell.md b/.changeset/clean-carrots-sell.md deleted file mode 100644 index 260da39491..0000000000 --- a/.changeset/clean-carrots-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -chore(medusa): Little improvement in draft order creation diff --git a/.changeset/clean-cobras-listen.md b/.changeset/clean-cobras-listen.md deleted file mode 100644 index 1eddf04fa1..0000000000 --- a/.changeset/clean-cobras-listen.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin": patch -"@medusajs/oas-github-ci": patch ---- - -fix(admin,oas-github-cli): Change public config to private to avoid publishing attempts + include `setup/` in npm release for `admin-ui` diff --git a/.changeset/clever-bobcats-clean.md b/.changeset/clever-bobcats-clean.md deleted file mode 100644 index 66e8d3307d..0000000000 --- a/.changeset/clever-bobcats-clean.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"medusa-react": patch ---- - -fix(react): export product-categories store hooks diff --git a/.changeset/cool-pumpkins-confess.md b/.changeset/cool-pumpkins-confess.md deleted file mode 100644 index 22aa89a681..0000000000 --- a/.changeset/cool-pumpkins-confess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): Make copy and UI on manage locations modal better when no locations diff --git a/.changeset/cuddly-keys-hear.md b/.changeset/cuddly-keys-hear.md deleted file mode 100644 index 7ecb75d152..0000000000 --- a/.changeset/cuddly-keys-hear.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"create-medusa-app": patch ---- - -chore(create-medusa-app): Remove admin + Gatsby starter from npx diff --git a/.changeset/cuddly-seahorses-thank.md b/.changeset/cuddly-seahorses-thank.md deleted file mode 100644 index db30a714bb..0000000000 --- a/.changeset/cuddly-seahorses-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medeusa): Transform query includes options should only be added to allowed props if there is already at least one allowed props diff --git a/.changeset/cuddly-trees-cry.md b/.changeset/cuddly-trees-cry.md deleted file mode 100644 index 437c360db9..0000000000 --- a/.changeset/cuddly-trees-cry.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"medusa-react": patch -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -fix(admin-ui, medusa-react, medusa): Minor fixes to GC domain in admin UI. Also fixes GC update payload type in medusa-react and medusa. diff --git a/.changeset/curly-mayflies-sell.md b/.changeset/curly-mayflies-sell.md deleted file mode 100644 index 479b7f7a51..0000000000 --- a/.changeset/curly-mayflies-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": minor ---- - -feat(medusa): remove reservations if cart completion fails after reservation creation diff --git a/.changeset/dirty-lions-add.md b/.changeset/dirty-lions-add.md deleted file mode 100644 index d0c57bc6c4..0000000000 --- a/.changeset/dirty-lions-add.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Include location_id in fulfillment body diff --git a/.changeset/dry-cups-occur.md b/.changeset/dry-cups-occur.md deleted file mode 100644 index dd1dfb25e3..0000000000 --- a/.changeset/dry-cups-occur.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(ci,oas) move oas ci script to a package under the oas workspace diff --git a/.changeset/dull-forks-juggle.md b/.changeset/dull-forks-juggle.md deleted file mode 100644 index 49b5f19330..0000000000 --- a/.changeset/dull-forks-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa-oas-cli": patch ---- - -feat(oas): medusa-oas-cli as OAS build tool diff --git a/.changeset/early-ducks-press.md b/.changeset/early-ducks-press.md deleted file mode 100644 index 59a2c8357f..0000000000 --- a/.changeset/early-ducks-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"medusa-file-s3": patch ---- - -fix(medusa-file-s3): update s3 file service to reuse one s3 client diff --git a/.changeset/eight-wasps-buy.md b/.changeset/eight-wasps-buy.md deleted file mode 100644 index 1bed62c1cd..0000000000 --- a/.changeset/eight-wasps-buy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -chore(feature-flag): Remove PublishableAPIKeys feature flag diff --git a/.changeset/eight-wasps-juggle.md b/.changeset/eight-wasps-juggle.md deleted file mode 100644 index 304841ff84..0000000000 --- a/.changeset/eight-wasps-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"medusa-dev-cli": patch ---- - -fix(medusa-dev): include packages/ subdirectories in discovery diff --git a/.changeset/eleven-cycles-mate.md b/.changeset/eleven-cycles-mate.md deleted file mode 100644 index 71c01eaad2..0000000000 --- a/.changeset/eleven-cycles-mate.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"medusa-payment-paypal": minor -"medusa-payment-stripe": minor -"@medusajs/medusa": minor ---- - -feat(medusa-payment-stripe): Implement payment processor API on stripe plugin and fix web hook issues diff --git a/.changeset/empty-comics-call.md b/.changeset/empty-comics-call.md deleted file mode 100644 index ea4b430e7f..0000000000 --- a/.changeset/empty-comics-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": minor ---- - -fix(medusa): remove limit of the number of levels to list when joining levels diff --git a/.changeset/empty-melons-eat.md b/.changeset/empty-melons-eat.md deleted file mode 100644 index 1d2b374c40..0000000000 --- a/.changeset/empty-melons-eat.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"medusa-payment-paypal": patch -"medusa-payment-stripe": patch -"@medusajs/medusa": patch ---- - -feat(medusa-payment-paypal): Migrate to the new payment processor API diff --git a/.changeset/fair-hats-hammer.md b/.changeset/fair-hats-hammer.md deleted file mode 100644 index ed94239583..0000000000 --- a/.changeset/fair-hats-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(medusa, admin-ui): Fix edit order variant stock diff --git a/.changeset/fair-melons-run.md b/.changeset/fair-melons-run.md deleted file mode 100644 index b588cebd52..0000000000 --- a/.changeset/fair-melons-run.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/client-types": patch -"@medusajs/medusa": patch ---- - -feat(oas): declare x-expanded-relations - Admin diff --git a/.changeset/famous-bananas-pay.md b/.changeset/famous-bananas-pay.md deleted file mode 100644 index 466531a731..0000000000 --- a/.changeset/famous-bananas-pay.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -feat(admin-ui): Adds metadata forms to all applicable domains in the UI. -fix(medusa): Fixes an issue where metadata was not being set for order addresses using `setMetadata`. diff --git a/.changeset/fast-buckets-marry.md b/.changeset/fast-buckets-marry.md deleted file mode 100644 index 8fc6f6ac70..0000000000 --- a/.changeset/fast-buckets-marry.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"medusa-react": patch -"@medusajs/medusa-js": patch -"@medusajs/medusa": patch ---- - -Add create-inventory-item endpoint diff --git a/.changeset/fifty-ears-relax.md b/.changeset/fifty-ears-relax.md deleted file mode 100644 index 89788702c5..0000000000 --- a/.changeset/fifty-ears-relax.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -Fix(admin-ui,medusa): Ensure stock locations are created with a name diff --git a/.changeset/four-maps-suffer.md b/.changeset/four-maps-suffer.md deleted file mode 100644 index 7cfd48c81d..0000000000 --- a/.changeset/four-maps-suffer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): draft order adjustments for mw diff --git a/.changeset/four-rings-admire.md b/.changeset/four-rings-admire.md deleted file mode 100644 index 8b38b90271..0000000000 --- a/.changeset/four-rings-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -feat(admin-ui): Add new feature badge for categories and inventory diff --git a/.changeset/fresh-forks-carry.md b/.changeset/fresh-forks-carry.md deleted file mode 100644 index c4882b3621..0000000000 --- a/.changeset/fresh-forks-carry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"medusa-react": patch -"@medusajs/medusa": patch ---- - -fix(medusa-react): Query key invalidation diff --git a/.changeset/funny-cars-crash.md b/.changeset/funny-cars-crash.md deleted file mode 100644 index 7f8e212848..0000000000 --- a/.changeset/funny-cars-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -Register reservation endpoints + Fix a type issue for get variant inventory diff --git a/.changeset/funny-ways-dress.md b/.changeset/funny-ways-dress.md deleted file mode 100644 index f08c82c65c..0000000000 --- a/.changeset/funny-ways-dress.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"medusa-fulfillment-webshipper": patch -"medusa-plugin-meilisearch": patch -"medusa-payment-paypal": patch -"medusa-payment-stripe": patch -"medusa-plugin-algolia": patch -"@medusajs/event-bus-local": patch -"@medusajs/event-bus-redis": patch -"@medusajs/cache-inmemory": patch -"@medusajs/stock-location": patch -"medusa-react": patch -"@medusajs/cache-redis": patch -"@medusajs/modules-sdk": patch -"@medusajs/inventory": patch -"@medusajs/medusa-js": patch -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch -"@medusajs/types": patch -"@medusajs/utils": patch ---- - -chore: Fix RC package versions diff --git a/.changeset/gold-fireants-look.md b/.changeset/gold-fireants-look.md deleted file mode 100644 index 09d8c22b3a..0000000000 --- a/.changeset/gold-fireants-look.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): Add event emitter to ProductCollectionService diff --git a/.changeset/grumpy-buses-pump.md b/.changeset/grumpy-buses-pump.md deleted file mode 100644 index e31a68204c..0000000000 --- a/.changeset/grumpy-buses-pump.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"@medusajs/inventory": patch -"medusa-core-utils": patch -"@medusajs/medusa": patch ---- - -feat(medusa): Modules initializer - -### Loading modules in a project - -Example - -``` typescript -import { InventoryServiceInitializeOptions, initialize } from "@medusajs/inventory" - -const options: InventoryServiceInitializeOptions = { - database: { - type: "postgres", - url: DB_URL, - }, -} - -const inventoryService = await initialize(options) -const newInventoryItem = await inventoryService.createInventoryItem({ - sku: "sku_123", -}) -``` diff --git a/.changeset/healthy-geese-worry.md b/.changeset/healthy-geese-worry.md deleted file mode 100644 index 3592f68d59..0000000000 --- a/.changeset/healthy-geese-worry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): fix bug with create fulfillment and a couple of other minor tweaks diff --git a/.changeset/hip-otters-thank.md b/.changeset/hip-otters-thank.md deleted file mode 100644 index d0e2a3ed0d..0000000000 --- a/.changeset/hip-otters-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": minor ---- - -Add inventory management to create-fulfillment flow diff --git a/.changeset/kind-dogs-argue.md b/.changeset/kind-dogs-argue.md deleted file mode 100644 index fab700bdac..0000000000 --- a/.changeset/kind-dogs-argue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): Add Lifetime support on project/plugin services diff --git a/.changeset/kind-rings-wave.md b/.changeset/kind-rings-wave.md deleted file mode 100644 index 2a4ce246b3..0000000000 --- a/.changeset/kind-rings-wave.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -fix(admin-ui, medusa): resolve bugs for orders with variants without inventory items diff --git a/.changeset/kind-seas-roll.md b/.changeset/kind-seas-roll.md deleted file mode 100644 index 9a0be31f64..0000000000 --- a/.changeset/kind-seas-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin): Show correct reserved/available values when editing stock on variant diff --git a/.changeset/late-rocks-design.md b/.changeset/late-rocks-design.md deleted file mode 100644 index b5cb407b45..0000000000 --- a/.changeset/late-rocks-design.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): if no headerkey is provided when initilizing idempotency key, no attempt is made at fetching the key diff --git a/.changeset/lemon-boats-obey.md b/.changeset/lemon-boats-obey.md deleted file mode 100644 index ac463fa23d..0000000000 --- a/.changeset/lemon-boats-obey.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@medusajs/medusa-cli": patch -"@medusajs/medusa": patch -"@medusajs/utils": patch ---- - -chore(medusa-cli): Add missing utils dep diff --git a/.changeset/loud-pillows-report.md b/.changeset/loud-pillows-report.md deleted file mode 100644 index d076992908..0000000000 --- a/.changeset/loud-pillows-report.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/client-types": patch -"@medusajs/medusa": patch ---- - -feat(oas): declare x-expanded-relations - Store diff --git a/.changeset/lucky-bikes-end.md b/.changeset/lucky-bikes-end.md deleted file mode 100644 index 57ddd761a9..0000000000 --- a/.changeset/lucky-bikes-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Resolve on scope instead of req diff --git a/.changeset/lucky-boats-invent.md b/.changeset/lucky-boats-invent.md deleted file mode 100644 index 6bd75650ba..0000000000 --- a/.changeset/lucky-boats-invent.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -Add filtering of stock locations based on sales channels diff --git a/.changeset/many-papayas-judge.md b/.changeset/many-papayas-judge.md deleted file mode 100644 index 56de28b8cf..0000000000 --- a/.changeset/many-papayas-judge.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/inventory": patch -"@medusajs/medusa": patch ---- - -Fix(inventory, medusa): ensure no orphaned reservations and invenotry levels on location removal diff --git a/.changeset/mean-ligers-fry.md b/.changeset/mean-ligers-fry.md deleted file mode 100644 index 68efffd274..0000000000 --- a/.changeset/mean-ligers-fry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/admin": patch ---- - -feat(admin,admin-ui): Updates the default behaviour of the plugin, and makes building for external deployment easier diff --git a/.changeset/mighty-ads-fold.md b/.changeset/mighty-ads-fold.md deleted file mode 100644 index 20e34e3175..0000000000 --- a/.changeset/mighty-ads-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Clean response data usage for admin and store fields/expand diff --git a/.changeset/neat-days-brush.md b/.changeset/neat-days-brush.md deleted file mode 100644 index 910fc445c6..0000000000 --- a/.changeset/neat-days-brush.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"medusa-react": patch -"@medusajs/medusa-js": patch -"@medusajs/medusa": patch ---- - -feat(medusa, medusa-js, medusa-react): Add store queries to react medusa diff --git a/.changeset/neat-frogs-collect.md b/.changeset/neat-frogs-collect.md deleted file mode 100644 index ac449ada4b..0000000000 --- a/.changeset/neat-frogs-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa-cli": patch ---- - -fix(medusa-cli): Add direct dependency of `semver` diff --git a/.changeset/neat-lamps-repeat.md b/.changeset/neat-lamps-repeat.md deleted file mode 100644 index d268ff9034..0000000000 --- a/.changeset/neat-lamps-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): Revamps gift card manage page diff --git a/.changeset/new-cherries-knock.md b/.changeset/new-cherries-knock.md deleted file mode 100644 index fd83447fe1..0000000000 --- a/.changeset/new-cherries-knock.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@medusajs/medusa": patch -"@medusajs/medusa-js": patch -"medusa-react": patch ---- - -feat(medusa,medusa-js,medusa-react): Add inventory module endpoints diff --git a/.changeset/new-pans-explain.md b/.changeset/new-pans-explain.md deleted file mode 100644 index 41c748c65f..0000000000 --- a/.changeset/new-pans-explain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -chore(medusa): EOL causing logging to hang diff --git a/.changeset/nice-dryers-search.md b/.changeset/nice-dryers-search.md deleted file mode 100644 index 00fa37c895..0000000000 --- a/.changeset/nice-dryers-search.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(oas): include `/admin` and `/store` in paths URLs diff --git a/.changeset/nine-planes-kneel.md b/.changeset/nine-planes-kneel.md deleted file mode 100644 index 1024b75635..0000000000 --- a/.changeset/nine-planes-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): Update order edit variants table to fit longer content diff --git a/.changeset/ninety-crews-develop.md b/.changeset/ninety-crews-develop.md deleted file mode 100644 index b06beec3e9..0000000000 --- a/.changeset/ninety-crews-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/modules-sdk": patch ---- - -Checks if dependency is registered before resolving it diff --git a/.changeset/odd-bikes-dance.md b/.changeset/odd-bikes-dance.md deleted file mode 100644 index 9af3a077dd..0000000000 --- a/.changeset/odd-bikes-dance.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"medusa-plugin-algolia": patch -"medusa-plugin-meilisearch": patch -"@medusajs/medusa": patch -"@medusajs/types": patch -"@medusajs/utils": patch ---- - -feat(medusa-plugin-algolia): Revamp Algolia search plugin diff --git a/.changeset/odd-clocks-work.md b/.changeset/odd-clocks-work.md deleted file mode 100644 index 1ca7b24e92..0000000000 --- a/.changeset/odd-clocks-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): inventory stocked quantity regulation diff --git a/.changeset/odd-meals-help.md b/.changeset/odd-meals-help.md deleted file mode 100644 index 98199494d8..0000000000 --- a/.changeset/odd-meals-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): minor fixes for inventory items diff --git a/.changeset/old-planes-cross.md b/.changeset/old-planes-cross.md deleted file mode 100644 index 60ba639f17..0000000000 --- a/.changeset/old-planes-cross.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Error messages for reset tokens diff --git a/.changeset/olive-days-jog.md b/.changeset/olive-days-jog.md deleted file mode 100644 index 794a060f41..0000000000 --- a/.changeset/olive-days-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": minor ---- - -Fix(medusa): include quantities when listing admin products with an inventory module installed diff --git a/.changeset/olive-penguins-sin.md b/.changeset/olive-penguins-sin.md deleted file mode 100644 index ce9eba7453..0000000000 --- a/.changeset/olive-penguins-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): use get instead of indexing into map diff --git a/.changeset/olive-seas-repair.md b/.changeset/olive-seas-repair.md deleted file mode 100644 index 243515304d..0000000000 --- a/.changeset/olive-seas-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(oas): add @schema OAS for address request payloads diff --git a/.changeset/polite-llamas-sit.md b/.changeset/polite-llamas-sit.md deleted file mode 100644 index 93c7e283c5..0000000000 --- a/.changeset/polite-llamas-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Rounding issues on line item adjustments diff --git a/.changeset/poor-bulldogs-repeat.md b/.changeset/poor-bulldogs-repeat.md deleted file mode 100644 index ee97632ae6..0000000000 --- a/.changeset/poor-bulldogs-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa-oas-cli": patch ---- - -fix(oas:test): fix beforeAll timeout silent failure diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 8f87677828..0000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "mode": "pre", - "tag": "rc", - "initialVersions": { - "integration-tests-api": "1.0.0", - "integration-tests-plugins": "1.0.0", - "integration-tests-repositories": "1.0.0", - "@medusajs/admin": "0.0.1", - "@medusajs/admin-ui": "0.0.0", - "babel-preset-medusa-package": "1.1.19", - "@medusajs/cache-inmemory": "1.7.0", - "@medusajs/cache-redis": "1.7.0", - "create-medusa-app": "0.0.9", - "@medusajs/event-bus-local": "1.7.0", - "@medusajs/event-bus-redis": "1.7.0", - "gatsby-source-medusa": "0.1.3", - "@medusajs/client-types": "0.1.0", - "@medusajs/inventory": "1.7.0", - "@medusajs/medusa": "1.7.13", - "@medusajs/medusa-cli": "1.3.8", - "medusa-core-utils": "1.1.39", - "medusa-dev-cli": "0.0.30", - "medusa-file-minio": "1.1.5", - "medusa-file-s3": "1.1.11", - "medusa-file-spaces": "1.3.5", - "medusa-fulfillment-manual": "1.1.36", - "medusa-fulfillment-webshipper": "1.3.7", - "medusa-interfaces": "1.3.6", - "@medusajs/medusa-js": "1.3.10", - "medusa-payment-adyen": "1.1.43", - "medusa-payment-klarna": "1.3.8", - "medusa-payment-manual": "1.0.22", - "medusa-payment-paypal": "1.2.10", - "medusa-payment-stripe": "1.1.53", - "medusa-plugin-algolia": "0.2.9", - "medusa-plugin-brightpearl": "1.3.6", - "medusa-plugin-contentful": "1.2.7", - "medusa-plugin-discount-generator": "1.1.24", - "medusa-plugin-economic": "1.1.42", - "medusa-plugin-ip-lookup": "1.2.5", - "medusa-plugin-mailchimp": "1.1.46", - "medusa-plugin-meilisearch": "1.0.4", - "medusa-plugin-restock-notification": "2.0.4", - "medusa-plugin-segment": "1.3.4", - "medusa-plugin-sendgrid": "1.3.7", - "medusa-plugin-slack-notification": "1.3.8", - "medusa-plugin-twilio-sms": "1.2.7", - "medusa-plugin-wishlist": "1.1.41", - "medusa-react": "4.0.4", - "medusa-source-shopify": "1.2.7", - "medusa-telemetry": "0.0.16", - "medusa-test-utils": "1.1.39", - "@medusajs/modules-sdk": "0.0.1", - "@medusajs/medusa-oas-cli": "0.1.0", - "@medusajs/oas-github-ci": "1.0.0", - "@medusajs/openapi-typescript-codegen": "0.1.0", - "@medusajs/stock-location": "1.7.0", - "@medusajs/types": "0.0.1", - "@medusajs/utils": "0.0.1" - }, - "changesets": [ - "angry-boxes-press", - "angry-trains-march", - "beige-ties-hunt", - "brave-goats-pay", - "brave-guests-mate", - "brown-wombats-jam", - "clean-carrots-sell", - "clean-cobras-listen", - "clever-bobcats-clean", - "cool-pumpkins-confess", - "cuddly-keys-hear", - "cuddly-seahorses-thank", - "cuddly-trees-cry", - "curly-mayflies-sell", - "dirty-lions-add", - "dry-cups-occur", - "dull-forks-juggle", - "early-ducks-press", - "eight-wasps-buy", - "eight-wasps-juggle", - "eleven-cycles-mate", - "empty-comics-call", - "empty-melons-eat", - "fair-hats-hammer", - "fair-melons-run", - "famous-bananas-pay", - "fast-buckets-marry", - "fifty-ears-relax", - "four-rings-admire", - "fresh-forks-carry", - "funny-cars-crash", - "funny-ways-dress", - "gold-fireants-look", - "grumpy-buses-pump", - "healthy-geese-worry", - "hip-otters-thank", - "kind-dogs-argue", - "kind-rings-wave", - "kind-seas-roll", - "late-rocks-design", - "lemon-boats-obey", - "loud-pillows-report", - "lucky-bikes-end", - "lucky-boats-invent", - "many-papayas-judge", - "mean-ligers-fry", - "mighty-ads-fold", - "neat-days-brush", - "neat-frogs-collect", - "neat-lamps-repeat", - "new-cherries-knock", - "new-pans-explain", - "nice-dryers-search", - "nine-planes-kneel", - "ninety-crews-develop", - "odd-bikes-dance", - "odd-clocks-work", - "odd-meals-help", - "old-planes-cross", - "olive-days-jog", - "olive-penguins-sin", - "olive-seas-repair", - "polite-llamas-sit", - "poor-bulldogs-repeat", - "purple-cats-brake", - "purple-sloths-confess", - "quiet-deers-shake", - "quiet-horses-listen", - "quiet-spiders-join", - "red-singers-swim", - "rich-flowers-decide", - "rude-guests-try", - "selfish-grapes-walk", - "serious-geckos-change", - "seven-keys-beg", - "shaggy-ghosts-crash", - "short-plants-work", - "shy-camels-attend", - "shy-years-attack", - "sixty-jeans-fold", - "slimy-brooms-flash", - "small-swans-hunt", - "smart-spies-bake", - "soft-pets-breathe", - "spotty-rules-hide", - "stale-adults-tease", - "stale-geckos-bow", - "stale-mangos-retire", - "strange-mails-pump", - "strong-ducks-change", - "stupid-chefs-ring", - "swift-deers-peel", - "tall-lions-rescue", - "tame-forks-marry", - "tame-geese-applaud", - "tame-pillows-heal", - "tasty-timers-drive", - "ten-actors-complain", - "ten-berries-rest", - "ten-steaks-tan", - "tender-turkeys-exist", - "three-pans-knock", - "tricky-apes-behave", - "tricky-grapes-flow", - "tricky-peas-clean", - "tricky-terms-wash", - "twelve-queens-hug", - "two-cherries-enjoy", - "two-cups-crash", - "violet-lobsters-retire", - "violet-pans-greet", - "weak-hats-develop", - "weak-parrots-search", - "wicked-toes-fold", - "wild-goats-sing", - "wild-rabbits-travel", - "wise-colts-pretend", - "wise-tomatoes-fold", - "witty-ads-matter", - "witty-pigs-rescue", - "yellow-trees-rest" - ] -} diff --git a/.changeset/purple-cats-brake.md b/.changeset/purple-cats-brake.md deleted file mode 100644 index 7d04dec3b1..0000000000 --- a/.changeset/purple-cats-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): Hide inventory quantity field in variant stock form if SL module enabled diff --git a/.changeset/purple-sloths-confess.md b/.changeset/purple-sloths-confess.md deleted file mode 100644 index 6242866238..0000000000 --- a/.changeset/purple-sloths-confess.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): Load PaymentProcessors -- Add loading of PaymentProcessors -- Add PaymentProcessor support in the payment-provider -- Add backward compatibility for the PaymentService diff --git a/.changeset/quiet-deers-shake.md b/.changeset/quiet-deers-shake.md deleted file mode 100644 index 414e04ef81..0000000000 --- a/.changeset/quiet-deers-shake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -Update types to reflect actual return-type diff --git a/.changeset/quiet-horses-listen.md b/.changeset/quiet-horses-listen.md deleted file mode 100644 index c0d57cc556..0000000000 --- a/.changeset/quiet-horses-listen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(oas): add missing x-codegen + fix schema naming and $ref diff --git a/.changeset/quiet-spiders-join.md b/.changeset/quiet-spiders-join.md deleted file mode 100644 index 413924742e..0000000000 --- a/.changeset/quiet-spiders-join.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/openapi-typescript-codegen": minor -"@medusajs/client-types": minor ---- - -feat(codegen,types): SetRelation on expanded types diff --git a/.changeset/red-singers-swim.md b/.changeset/red-singers-swim.md deleted file mode 100644 index 239343ecd4..0000000000 --- a/.changeset/red-singers-swim.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): add get-variant endpoint diff --git a/.changeset/rich-flowers-decide.md b/.changeset/rich-flowers-decide.md deleted file mode 100644 index ef67d6df88..0000000000 --- a/.changeset/rich-flowers-decide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -fix(admin-ui, medusa): Minor ui fixes relating to stock locations diff --git a/.changeset/rude-guests-try.md b/.changeset/rude-guests-try.md deleted file mode 100644 index 2a3e715773..0000000000 --- a/.changeset/rude-guests-try.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/openapi-typescript-codegen": patch -"@medusajs/medusa-oas-cli": patch ---- - -feat(codegen): openapi-typescript-codegen fork diff --git a/.changeset/selfish-grapes-walk.md b/.changeset/selfish-grapes-walk.md deleted file mode 100644 index 51bef65070..0000000000 --- a/.changeset/selfish-grapes-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -feat(admin-ui): Make number input increment/decrement buttons not tabbable-to diff --git a/.changeset/serious-geckos-change.md b/.changeset/serious-geckos-change.md deleted file mode 100644 index a256527505..0000000000 --- a/.changeset/serious-geckos-change.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Fix hanging inventory item migration script diff --git a/.changeset/seven-keys-beg.md b/.changeset/seven-keys-beg.md deleted file mode 100644 index eaac4a7743..0000000000 --- a/.changeset/seven-keys-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/client-types": patch ---- - -feat(codegen): commit generated client types to codebase diff --git a/.changeset/shaggy-ghosts-crash.md b/.changeset/shaggy-ghosts-crash.md deleted file mode 100644 index 6011f627bc..0000000000 --- a/.changeset/shaggy-ghosts-crash.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -feat(medusa,admin): location_ids in swap and claim creation diff --git a/.changeset/short-plants-work.md b/.changeset/short-plants-work.md deleted file mode 100644 index b39cabdc9d..0000000000 --- a/.changeset/short-plants-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(oas): identify required fields in responses - store diff --git a/.changeset/shy-camels-attend.md b/.changeset/shy-camels-attend.md deleted file mode 100644 index 69b548953d..0000000000 --- a/.changeset/shy-camels-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": minor ---- - -feat(medusa): remove reservations for all old line items when an order edit is accepted diff --git a/.changeset/shy-years-attack.md b/.changeset/shy-years-attack.md deleted file mode 100644 index 30cff0f42f..0000000000 --- a/.changeset/shy-years-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"medusa-react": patch ---- - -fix(medusa-react): invalidate all reservations list queries diff --git a/.changeset/sixty-jeans-fold.md b/.changeset/sixty-jeans-fold.md deleted file mode 100644 index fad382fbe9..0000000000 --- a/.changeset/sixty-jeans-fold.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch -"@medusajs/admin": patch ---- - -feat(medusa,admin,admin-ui): Add new plugin to serve the admin dashboard from the server. Adds a new plugin injection step `setup`, code placed in the `setup` folder of a plugin will be run before any code from a plugin is injected into the Medusa server. diff --git a/.changeset/slimy-brooms-flash.md b/.changeset/slimy-brooms-flash.md deleted file mode 100644 index 0a9aebb422..0000000000 --- a/.changeset/slimy-brooms-flash.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"medusa-core-utils": minor -"medusa-react": minor -"@medusajs/medusa": minor ---- - -Http Server Graceful Shutdown diff --git a/.changeset/small-swans-hunt.md b/.changeset/small-swans-hunt.md deleted file mode 100644 index 99284c6dc3..0000000000 --- a/.changeset/small-swans-hunt.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@medusajs/event-bus-local": patch -"@medusajs/event-bus-redis": patch -"@medusajs/cache-inmemory": patch -"@medusajs/stock-location": patch -"@medusajs/cache-redis": patch -"@medusajs/modules-sdk": patch -"@medusajs/inventory": patch ---- - -Export initialize method for all modules diff --git a/.changeset/smart-spies-bake.md b/.changeset/smart-spies-bake.md deleted file mode 100644 index fc8e362976..0000000000 --- a/.changeset/smart-spies-bake.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch -"medusa-react": patch ---- - -feat(medusa, admin-ui, medusa-react): Improvements to product categories -- Adds name as required in category create form -- Adds name and handle as required in category edit form -- Updates message on create/update forms -- Adds category indicators for is_internal and is_active fields in the tree list -- Fixes bug where tree is not reset when update fails -- allow appending all category descendants with a param in list endpoint -- fix rank order changing on category update -- invalidate products query on category delete -- adds category ui for tree/list, edit, create, delete -- add product category queries and mutations -- category list API can return all descendant -- added breadcrumbs for categories on create/edit modal -- add empty state for product categories -- increase tree depth + scope categories on store + allow categories relation in products API -- categories can be ranked based on position -- seed command can create product categories -- hide categories in products behind feature flag -- fixes bug for mpath incorrectly updated for nested categories diff --git a/.changeset/soft-pets-breathe.md b/.changeset/soft-pets-breathe.md deleted file mode 100644 index 11557a0e28..0000000000 --- a/.changeset/soft-pets-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/client-types": patch ---- - -feat(types): package scaffolding for generated types diff --git a/.changeset/spotty-rules-hide.md b/.changeset/spotty-rules-hide.md deleted file mode 100644 index c0b9732de9..0000000000 --- a/.changeset/spotty-rules-hide.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@medusajs/stock-location": minor -"@medusajs/inventory": minor -"medusa-core-utils": minor -"@medusajs/modules-sdk": minor -"@medusajs/medusa": minor ---- - -Inventory and Stock location modules supporting isolated connection diff --git a/.changeset/stale-adults-tease.md b/.changeset/stale-adults-tease.md deleted file mode 100644 index d326667563..0000000000 --- a/.changeset/stale-adults-tease.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin): Fix fulfilment creation diff --git a/.changeset/stale-geckos-bow.md b/.changeset/stale-geckos-bow.md deleted file mode 100644 index d4273fcc80..0000000000 --- a/.changeset/stale-geckos-bow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"medusa-payment-stripe": patch ---- - -add typescript dev dependency diff --git a/.changeset/stale-mangos-retire.md b/.changeset/stale-mangos-retire.md deleted file mode 100644 index 9d401fb95a..0000000000 --- a/.changeset/stale-mangos-retire.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@medusajs/client-types": patch -"medusa-react": patch -"@medusajs/medusa-js": patch -"@medusajs/medusa": patch ---- - -fix(oas,js,react): use AdminExtendedStoresRes instead of AdminStoresRes diff --git a/.changeset/strange-mails-pump.md b/.changeset/strange-mails-pump.md deleted file mode 100644 index 319096bce5..0000000000 --- a/.changeset/strange-mails-pump.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -"medusa-plugin-meilisearch": major -"@medusajs/medusa": patch ---- - -feat(medusa-plugin-meilisearch): Update + improve Meilisearch plugin - -**What** -- Bumps `meilisearch` dep to latest major -- Migrates plugin to TypeScript -- Changes the way indexes are configured in `medusa-config.js`: - -**Before** -``` -{ - resolve: `medusa-plugin-meilisearch`, - options: { - config: { host: "...", apiKey: "..." }, - settings: { - products: { - searchableAttributes: ["title"], - displayedAttributes: ["title"], - }, - }, - }, - }, -``` - -**After** -``` -{ - resolve: `medusa-plugin-meilisearch`, - options: { - config: { host: "...", apiKey: "..." }, - settings: { - products: { - **indexSettings**: { - searchableAttributes: ["title"], - displayedAttributes: ["title"], - }, - }, - }, - }, - }, -``` - -This is done to allow for additional configuration of indexes, that are not necessarily passed on query-time. - -We introduce two new settings: -``` -settings: { - products: { - indexSettings: { - searchableAttributes: ["title"], - displayedAttributes: ["title"],, - }, - primaryKey: "id" - transformer: (document) => ({ id: "yo" }) - }, -}, -``` - -Meilisearch changed their primary key inference in the major release. Now we must be explicit when multiple properties end with `id`. Read more in their [docs](https://docs.meilisearch.com/learn/core_concepts/primary_key.html#primary-field). - -The transformer allows developers to specify how their documents are stored in Meilisearch. It is configurable for each index. diff --git a/.changeset/strong-ducks-change.md b/.changeset/strong-ducks-change.md deleted file mode 100644 index 2f1179700f..0000000000 --- a/.changeset/strong-ducks-change.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/modules-sdk": patch -"@medusajs/medusa": patch ---- - -Improved error message if default module is not installed diff --git a/.changeset/stupid-chefs-ring.md b/.changeset/stupid-chefs-ring.md deleted file mode 100644 index 722cffba52..0000000000 --- a/.changeset/stupid-chefs-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): fix bug with parent not being saved correctly diff --git a/.changeset/swift-deers-peel.md b/.changeset/swift-deers-peel.md deleted file mode 100644 index 13eb63fcfa..0000000000 --- a/.changeset/swift-deers-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/modules-sdk": patch ---- - -chore: Add missing changeset for @medusajs/modules-sdk diff --git a/.changeset/tall-lions-rescue.md b/.changeset/tall-lions-rescue.md deleted file mode 100644 index 33c65c0b3f..0000000000 --- a/.changeset/tall-lions-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): remove soft delete from categories + adds indexes for categories diff --git a/.changeset/tame-forks-marry.md b/.changeset/tame-forks-marry.md deleted file mode 100644 index 44b05aaff2..0000000000 --- a/.changeset/tame-forks-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/openapi-typescript-codegen": minor ---- - -feat(codegen): x-expanded-relations diff --git a/.changeset/tame-geese-applaud.md b/.changeset/tame-geese-applaud.md deleted file mode 100644 index 28b4e7a07e..0000000000 --- a/.changeset/tame-geese-applaud.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/medusa-js": patch -"@medusajs/medusa": patch ---- - -fix(oas): fix paths and fix schema names to match convention diff --git a/.changeset/tame-pillows-heal.md b/.changeset/tame-pillows-heal.md deleted file mode 100644 index bb6b6dd354..0000000000 --- a/.changeset/tame-pillows-heal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): invalidate price selection caching within update request diff --git a/.changeset/tasty-timers-drive.md b/.changeset/tasty-timers-drive.md deleted file mode 100644 index 890c4fe99e..0000000000 --- a/.changeset/tasty-timers-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): Always show categories in product page diff --git a/.changeset/ten-actors-complain.md b/.changeset/ten-actors-complain.md deleted file mode 100644 index 613ffd8497..0000000000 --- a/.changeset/ten-actors-complain.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@medusajs/cache-inmemory": patch -"@medusajs/stock-location": patch -"@medusajs/cache-redis": patch -"@medusajs/modules-sdk": patch -"@medusajs/inventory": patch -"@medusajs/medusa": patch -"@medusajs/types": patch -"@medusajs/utils": patch -"@medusajs/admin-ui": patch -"medusa-plugin-meilisearch": patch ---- - -Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules diff --git a/.changeset/ten-berries-rest.md b/.changeset/ten-berries-rest.md deleted file mode 100644 index f648d7ead8..0000000000 --- a/.changeset/ten-berries-rest.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin-ui): Fix effect check in inventory table and overflow UI diff --git a/.changeset/ten-steaks-tan.md b/.changeset/ten-steaks-tan.md deleted file mode 100644 index efb30675b1..0000000000 --- a/.changeset/ten-steaks-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa-js": patch ---- - -Fix(medusa): Adjust reservations correctly diff --git a/.changeset/tender-turkeys-exist.md b/.changeset/tender-turkeys-exist.md deleted file mode 100644 index e1242ef884..0000000000 --- a/.changeset/tender-turkeys-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa-oas-cli": patch ---- - -feat(oas:cli): output better error when no command is provided diff --git a/.changeset/three-pans-knock.md b/.changeset/three-pans-knock.md deleted file mode 100644 index 0fe9eafdc0..0000000000 --- a/.changeset/three-pans-knock.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@medusajs/medusa": minor -"medusa-react": patch -"@medusajs/event-bus-local": minor -"@medusajs/event-bus-redis": minor ---- - -feat(medusa,event-bus-local,event-bus-redis): Event Bus module (Redis + Local) diff --git a/.changeset/tricky-apes-behave.md b/.changeset/tricky-apes-behave.md deleted file mode 100644 index 82eb98e585..0000000000 --- a/.changeset/tricky-apes-behave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"medusa-react": patch ---- - -fix(eslint): remove unused .eslintignore in medusa-react package diff --git a/.changeset/tricky-grapes-flow.md b/.changeset/tricky-grapes-flow.md deleted file mode 100644 index 785d5374e9..0000000000 --- a/.changeset/tricky-grapes-flow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(admin-ui): add errors and block receiving returns dependent on existing inventory item levels diff --git a/.changeset/tricky-peas-clean.md b/.changeset/tricky-peas-clean.md deleted file mode 100644 index e6c9523fc0..0000000000 --- a/.changeset/tricky-peas-clean.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -fix(admin): Show all locations in allocation creation modal diff --git a/.changeset/tricky-terms-wash.md b/.changeset/tricky-terms-wash.md deleted file mode 100644 index 7be65c6653..0000000000 --- a/.changeset/tricky-terms-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): Improve store list products diff --git a/.changeset/twelve-queens-hug.md b/.changeset/twelve-queens-hug.md deleted file mode 100644 index 8b607f2fda..0000000000 --- a/.changeset/twelve-queens-hug.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -fix(medusa, admin-ui): refine create-fulfillment flow diff --git a/.changeset/two-cherries-enjoy.md b/.changeset/two-cherries-enjoy.md deleted file mode 100644 index a36b0e2a81..0000000000 --- a/.changeset/two-cherries-enjoy.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@medusajs/cache-inmemory": minor -"@medusajs/cache-redis": minor -"@medusajs/medusa": minor -"medusa-plugin-contentful": patch -"medusa-source-shopify": patch ---- - -feat(medusa, cache-redis, cache-inmemory): Added cache modules diff --git a/.changeset/two-cups-crash.md b/.changeset/two-cups-crash.md deleted file mode 100644 index c200ee3623..0000000000 --- a/.changeset/two-cups-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(oas): pluralize OAS tags diff --git a/.changeset/violet-lobsters-retire.md b/.changeset/violet-lobsters-retire.md deleted file mode 100644 index 921c59efdc..0000000000 --- a/.changeset/violet-lobsters-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -Add order allocation to admin ui diff --git a/.changeset/violet-pans-greet.md b/.changeset/violet-pans-greet.md deleted file mode 100644 index 0fd73833d5..0000000000 --- a/.changeset/violet-pans-greet.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Account for multiple inventory items when getting inventory diff --git a/.changeset/weak-hats-develop.md b/.changeset/weak-hats-develop.md deleted file mode 100644 index 08f4b73da9..0000000000 --- a/.changeset/weak-hats-develop.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/admin-ui": patch -"@medusajs/medusa": patch ---- - -feat(medusa,admin-ui): support location_id in diff --git a/.changeset/weak-parrots-search.md b/.changeset/weak-parrots-search.md deleted file mode 100644 index b4fe6350c2..0000000000 --- a/.changeset/weak-parrots-search.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/event-bus-local": patch ---- - -fix(event-bus-local): Error handling diff --git a/.changeset/wicked-toes-fold.md b/.changeset/wicked-toes-fold.md deleted file mode 100644 index 4f9fc9eb36..0000000000 --- a/.changeset/wicked-toes-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -fix(medusa): Issue when ordering with multiple columns diff --git a/.changeset/wild-goats-sing.md b/.changeset/wild-goats-sing.md deleted file mode 100644 index eee8b6e26e..0000000000 --- a/.changeset/wild-goats-sing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -Feat(medusa): fulfill swaps and claims with locations diff --git a/.changeset/wild-rabbits-travel.md b/.changeset/wild-rabbits-travel.md deleted file mode 100644 index 6b7bc5b894..0000000000 --- a/.changeset/wild-rabbits-travel.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"medusa-react": patch -"@medusajs/admin-ui": patch ---- - -feat(admin-ui, medusa-react): allow products to be categorized in product create/edit page diff --git a/.changeset/wise-colts-pretend.md b/.changeset/wise-colts-pretend.md deleted file mode 100644 index 4e2cd4bf80..0000000000 --- a/.changeset/wise-colts-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": minor ---- - -feat(admin-ui): move customs and shipping into manage inventory modal diff --git a/.changeset/wise-tomatoes-fold.md b/.changeset/wise-tomatoes-fold.md deleted file mode 100644 index 10ff885713..0000000000 --- a/.changeset/wise-tomatoes-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(medusa): Update transaction base service to expose an activeManager_ getter diff --git a/.changeset/witty-ads-matter.md b/.changeset/witty-ads-matter.md deleted file mode 100644 index 91bfebf283..0000000000 --- a/.changeset/witty-ads-matter.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@medusajs/medusa-oas-cli": minor -"@medusajs/medusa": patch ---- - -feat(oas-cli): combine admin + store + custom OAS diff --git a/.changeset/witty-pigs-rescue.md b/.changeset/witty-pigs-rescue.md deleted file mode 100644 index f585cc01e9..0000000000 --- a/.changeset/witty-pigs-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/medusa": patch ---- - -feat(oas): identify required fields in responses - admin diff --git a/.changeset/yellow-trees-rest.md b/.changeset/yellow-trees-rest.md deleted file mode 100644 index d9545f96f7..0000000000 --- a/.changeset/yellow-trees-rest.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@medusajs/admin-ui": patch ---- - -Fix team table filter dropdown transparency diff --git a/docs/api/admin.oas.json b/docs/api/admin.oas.json new file mode 100644 index 0000000000..bc9b8d85b7 --- /dev/null +++ b/docs/api/admin.oas.json @@ -0,0 +1,39955 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Medusa Admin API", + "description": "API reference for Medusa's Admin endpoints. All endpoints are prefixed with `/admin`.\n\n## Authentication\n\nThere are two ways to send authenticated requests to the Medusa server: Using a user's API token, or using a Cookie Session ID.\n\n\n\n## Expanding Fields\n\nIn many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response.\n\nPlease note that the relations you pass to `expand` replace any relations that are expanded by default in the request.\n\n### Expanding One Relation\n\nFor example, when you retrieve products, you can retrieve their collection by passing to the `expand` query parameter the value `collection`:\n\n```bash\ncurl \"http://localhost:9000/admin/products?expand=collection\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Expanding Multiple Relations\n\nYou can expand more than one relation by separating the relations in the `expand` query parameter with a comma.\n\nFor example, to retrieve both the variants and the collection of products, pass to the `expand` query parameter the value `variants,collection`:\n\n```bash\ncurl \"http://localhost:9000/admin/products?expand=variants,collection\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Prevent Expanding Relations\n\nSome requests expand relations by default. You can prevent that by passing an empty expand value to retrieve an entity without any extra relations.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?expand\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nThis would retrieve each product with only its properties, without any relations like `collection`.\n\n## Selecting Fields\n\nIn many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response.\n\nPlease note that if you pass a `fields` query parameter, only the fields you pass in the value along with the `id` of the entity will be returned in the response.\n\nAlso, the `fields` query parameter does not affect the expanded relations. You'll have to use the `expand` parameter instead.\n\n### Selecting One Field\n\nFor example, when you retrieve a list of products, you can retrieve only the titles of the products by passing `title` as a value to the `fields` query parameter:\n\n```bash\ncurl \"http://localhost:9000/admin/products?fields=title\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nAs mentioned above, the expanded relations such as `variants` will still be returned as they're not affected by the `fields` parameter.\n\nYou can ensure that only the `title` field is returned by passing an empty value to the `expand` query parameter. For example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?fields=title&expand\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Selecting Multiple Fields\n\nYou can pass more than one field by seperating the field names in the `fields` query parameter with a comma.\n\nFor example, to select the `title` and `handle` of products:\n\n```bash\ncurl \"http://localhost:9000/admin/products?fields=title,handle\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Retrieve Only the ID\n\nYou can pass an empty `fields` query parameter to return only the ID of an entity. For example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?fields\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nYou can also pair with an empty `expand` query parameter to ensure that the relations aren't retrieved as well. For example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?fields&expand\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n## Query Parameter Types\n\nThis section covers how to pass some common data types as query parameters. This is useful if you're sending requests to the API endpoints and not using our JS Client. For example, when using cURL or Postman.\n\n### Strings\n\nYou can pass a string value in the form of `=`.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?title=Shirt\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nIf the string has any characters other than letters and numbers, you must encode them.\n\nFor example, if the string has spaces, you can encode the space with `+` or `%20`:\n\n```bash\ncurl \"http://localhost:9000/admin/products?title=Blue%20Shirt\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nYou can use tools like [this one](https://www.urlencoder.org/) to learn how a value can be encoded.\n\n### Integers\n\nYou can pass an integer value in the form of `=`.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?offset=1\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Boolean\n\nYou can pass a boolean value in the form of `=`.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/admin/products?is_giftcard=true\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Date and DateTime\n\nYou can pass a date value in the form `=`. The date must be in the format `YYYY-MM-DD`.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/admin/products?created_at[lt]=2023-02-17\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nYou can also pass the time using the format `YYYY-MM-DDTHH:MM:SSZ`. Please note that the `T` and `Z` here are fixed.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/admin/products?created_at[lt]=2023-02-17T07:22:30Z\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Array\n\nEach array value must be passed as a separate query parameter in the form `[]=`. You can also specify the index of each parameter in the brackets `[0]=`.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/admin/products?sales_channel_id[]=sc_01GPGVB42PZ7N3YQEP2WDM7PC7&sales_channel_id[]=sc_234PGVB42PZ7N3YQEP2WDM7PC7\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\nNote that the `-g` parameter passed to `curl` disables errors being thrown for using the brackets. Read more [here](https://curl.se/docs/manpage.html#-g).\n\n### Object\n\nObject parameters must be passed as separate query parameters in the form `[]=`.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/admin/products?created_at[lt]=2023-02-17&created_at[gt]=2022-09-17\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n## Pagination\n\n### Query Parameters\n\nIn listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`.\n\n`limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities.\n\nYou can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on.\n\nFor example, to limit the number of products returned in the List Products endpoint:\n\n```bash\ncurl \"http://localhost:9000/admin/products?limit=5\" \\\n-H 'Authorization: Bearer {api_token}'\n```\n\n### Response Fields\n\nIn the response of listing endpoints, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`.\n\nSimilar to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result.\n\n`count` is the total number of available items of this entity. It can be used to determine how many pages are there.\n\nFor example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`.\n", + "license": { + "name": "MIT", + "url": "https://github.com/medusajs/medusa/blob/master/LICENSE" + } + }, + "tags": [ + { + "name": "Auth", + "description": "Auth endpoints that allow authorization of admin Users and manages their sessions." + }, + { + "name": "Apps", + "description": "App endpoints that allow handling apps in Medusa." + }, + { + "name": "Batch Jobs", + "description": "Batch Job endpoints that allow handling batch jobs in Medusa." + }, + { + "name": "Collections", + "description": "Collection endpoints that allow handling collections in Medusa." + }, + { + "name": "Customers", + "description": "Customer endpoints that allow handling customers in Medusa." + }, + { + "name": "Customer Groups", + "description": "Customer Group endpoints that allow handling customer groups in Medusa." + }, + { + "name": "Discounts", + "description": "Discount endpoints that allow handling discounts in Medusa." + }, + { + "name": "Draft Orders", + "description": "Draft Order endpoints that allow handling draft orders in Medusa." + }, + { + "name": "Gift Cards", + "description": "Gift Card endpoints that allow handling gift cards in Medusa." + }, + { + "name": "Invites", + "description": "Invite endpoints that allow handling invites in Medusa." + }, + { + "name": "Notes", + "description": "Note endpoints that allow handling notes in Medusa." + }, + { + "name": "Notifications", + "description": "Notification endpoints that allow handling notifications in Medusa." + }, + { + "name": "Orders", + "description": "Order endpoints that allow handling orders in Medusa." + }, + { + "name": "Price Lists", + "description": "Price List endpoints that allow handling price lists in Medusa." + }, + { + "name": "Products", + "description": "Product endpoints that allow handling products in Medusa." + }, + { + "name": "Product Tags", + "description": "Product Tag endpoints that allow handling product tags in Medusa." + }, + { + "name": "Product Types", + "description": "Product Types endpoints that allow handling product types in Medusa." + }, + { + "name": "Regions", + "description": "Region endpoints that allow handling regions in Medusa." + }, + { + "name": "Return Reasons", + "description": "Return Reason endpoints that allow handling return reasons in Medusa." + }, + { + "name": "Returns", + "description": "Return endpoints that allow handling returns in Medusa." + }, + { + "name": "Sales Channels", + "description": "Sales Channel endpoints that allow handling sales channels in Medusa." + }, + { + "name": "Shipping Options", + "description": "Shipping Option endpoints that allow handling shipping options in Medusa." + }, + { + "name": "Shipping Profiles", + "description": "Shipping Profile endpoints that allow handling shipping profiles in Medusa." + }, + { + "name": "Store", + "description": "Store endpoints that allow handling stores in Medusa." + }, + { + "name": "Swaps", + "description": "Swap endpoints that allow handling swaps in Medusa." + }, + { + "name": "Tax Rates", + "description": "Tax Rate endpoints that allow handling tax rates in Medusa." + }, + { + "name": "Uploads", + "description": "Upload endpoints that allow handling uploads in Medusa." + }, + { + "name": "Users", + "description": "User endpoints that allow handling users in Medusa." + }, + { + "name": "Variants", + "description": "Product Variant endpoints that allow handling product variants in Medusa." + } + ], + "servers": [ + { + "url": "https://api.medusa-commerce.com" + } + ], + "paths": { + "/admin/apps": { + "get": { + "operationId": "GetApps", + "summary": "List Applications", + "description": "Retrieve a list of applications.", + "x-authenticated": true, + "x-codegen": { + "method": "list" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/apps' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Apps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminAppsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/apps/authorizations": { + "post": { + "operationId": "PostApps", + "summary": "Generate Token for App", + "description": "Generates a token for an application.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostAppsReq" + } + } + } + }, + "x-codegen": { + "method": "authorize" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/apps/authorizations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"application_name\": \"example\",\n \"state\": \"ready\",\n \"code\": \"token\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Apps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminAppsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/auth": { + "get": { + "operationId": "GetAuth", + "summary": "Get Current User", + "x-authenticated": true, + "description": "Gets the currently logged in User.", + "x-codegen": { + "method": "getSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.auth.getSession()\n.then(({ user }) => {\n console.log(user.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/auth' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminAuthRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostAuth", + "summary": "User Login", + "x-authenticated": false, + "description": "Logs a User in and authorizes them to manage Store settings.", + "parameters": [], + "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." + } + } + } + } + } + }, + "x-codegen": { + "method": "createSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.admin.auth.createSession({\n email: 'user@example.com',\n password: 'supersecret'\n}).then((({ user }) => {\n console.log(user.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/auth' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\"\n}'\n" + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminAuthRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/incorrect_credentials" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteAuth", + "summary": "User Logout", + "x-authenticated": true, + "description": "Deletes the current session for the logged in user.", + "x-codegen": { + "method": "deleteSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.auth.deleteSession()\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/auth' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/batch-jobs": { + "get": { + "operationId": "GetBatchJobs", + "summary": "List Batch Jobs", + "description": "Retrieve a list of Batch Jobs.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of batch jobs to return.", + "schema": { + "type": "integer", + "default": 10 + } + }, + { + "in": "query", + "name": "offset", + "description": "The number of batch jobs to skip before results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "Filter by the batch ID", + "schema": { + "oneOf": [ + { + "type": "string", + "description": "batch job ID" + }, + { + "type": "array", + "description": "multiple batch job IDs", + "items": { + "type": "string" + } + } + ] + } + }, + { + "in": "query", + "name": "type", + "style": "form", + "explode": false, + "description": "Filter by the batch type", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "confirmed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "pre_processed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "completed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was completed, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "failed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was failed, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "canceled_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was canceled, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "order", + "description": "Field used to order retrieved batch jobs", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each order of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each order of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was created, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetBatchParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.batchJobs.list()\n.then(({ batch_jobs, limit, offset, count }) => {\n console.log(batch_jobs.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/batch-jobs' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Batch Jobs" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminBatchJobListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostBatchJobs", + "summary": "Create a Batch Job", + "description": "Creates a Batch Job.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostBatchesReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.batchJobs.create({\n type: 'product-export',\n context: {},\n dry_run: false\n}).then((({ batch_job }) => {\n console.log(batch_job.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/batch-jobs' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer {api_token}' \\\n--data-raw '{\n \"type\": \"product-export\",\n \"context\": { }\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Batch Jobs" + ], + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminBatchJobRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/batch-jobs/{id}": { + "get": { + "operationId": "GetBatchJobsBatchJob", + "summary": "Get a Batch Job", + "description": "Retrieves a Batch Job.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Batch Job", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.batchJobs.retrieve(batch_job_id)\n.then(({ batch_job }) => {\n console.log(batch_job.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/batch-jobs/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Batch Jobs" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminBatchJobRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/batch-jobs/{id}/cancel": { + "post": { + "operationId": "PostBatchJobsBatchJobCancel", + "summary": "Cancel a Batch Job", + "description": "Marks a batch job as canceled", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the batch job.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancel" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.batchJobs.cancel(batch_job_id)\n.then(({ batch_job }) => {\n console.log(batch_job.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Batch Jobs" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminBatchJobRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/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" + } + } + ], + "x-codegen": { + "method": "confirm" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.batchJobs.confirm(batch_job_id)\n.then(({ batch_job }) => {\n console.log(batch_job.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Batch Jobs" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminBatchJobRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/collections": { + "get": { + "operationId": "GetCollections", + "summary": "List Collections", + "description": "Retrieve a list of Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of collections to return.", + "schema": { + "type": "integer", + "default": 10 + } + }, + { + "in": "query", + "name": "offset", + "description": "The number of collections to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "title", + "description": "The title of collections to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "The handle of collections to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "a search term to search titles and handles.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the product collections.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting collections were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting collections were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting collections were deleted.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetCollectionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.collections.list()\n.then(({ collections, limit, offset, count }) => {\n console.log(collections.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/collections' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCollectionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCollections", + "summary": "Create a Collection", + "description": "Creates a Product Collection.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCollectionsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.collections.create({\n title: 'New Collection'\n})\n.then(({ collection }) => {\n console.log(collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/collections' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"New Collection\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/collections/{id}": { + "get": { + "operationId": "GetCollectionsCollection", + "summary": "Get a Collection", + "description": "Retrieves a Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Collection", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.collections.retrieve(collection_id)\n.then(({ collection }) => {\n console.log(collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/collections/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCollectionsCollection", + "summary": "Update a Collection", + "description": "Updates a Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCollectionsCollectionReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.collections.update(collection_id, {\n title: 'New Collection'\n})\n.then(({ collection }) => {\n console.log(collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/collections/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"New Collection\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteCollectionsCollection", + "summary": "Delete a Collection", + "description": "Deletes a Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Collection.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.collections.delete(collection_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCollectionsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/collections/{id}/products/batch": { + "post": { + "operationId": "PostProductsToCollection", + "summary": "Update Products", + "description": "Updates products associated with a Product Collection", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsToCollectionReq" + } + } + } + }, + "x-codegen": { + "method": "addProducts" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/collections/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n \"prod_01G1G5V2MBA328390B5AXJ610F\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteProductsFromCollection", + "summary": "Remove Product", + "description": "Removes products associated with a Product Collection", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteProductsFromCollectionReq" + } + } + } + }, + "x-codegen": { + "method": "removeProducts" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n \"prod_01G1G5V2MBA328390B5AXJ610F\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteProductsFromCollectionRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/currencies": { + "get": { + "operationId": "GetCurrencies", + "summary": "List Currency", + "description": "Retrieves a list of Currency", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "code", + "description": "Code of the currency to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "includes_tax", + "description": "Search for tax inclusive currencies.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "order", + "description": "order to retrieve products in.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "number", + "default": "20" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetCurrenciesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.currencies.list()\n.then(({ currencies, count, offset, limit }) => {\n console.log(currencies.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/currencies' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "tags": [ + "Currencies" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCurrenciesListRes" + } + } + } + } + } + } + }, + "/admin/currencies/{code}": { + "post": { + "operationId": "PostCurrenciesCurrency", + "summary": "Update a Currency", + "description": "Update a Currency", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The code of the Currency.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCurrenciesCurrencyReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.currencies.update(code, {\n includes_tax: true\n})\n.then(({ currency }) => {\n console.log(currency.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/currencies/{code}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"includes_tax\": true\n}'\n" + } + ], + "tags": [ + "Currencies" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCurrenciesRes" + } + } + } + } + } + } + }, + "/admin/customer-groups": { + "get": { + "operationId": "GetCustomerGroups", + "summary": "List Customer Groups", + "description": "Retrieve a list of customer groups.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching customer group names.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many groups to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "order", + "description": "the field used to order the customer groups.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the customer groups.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "Filter by the customer group ID", + "schema": { + "oneOf": [ + { + "type": "string", + "description": "customer group ID" + }, + { + "type": "array", + "description": "multiple customer group IDs", + "items": { + "type": "string" + } + }, + { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by IDs less than this ID" + }, + "gt": { + "type": "string", + "description": "filter by IDs greater than this ID" + }, + "lte": { + "type": "string", + "description": "filter by IDs less than or equal to this ID" + }, + "gte": { + "type": "string", + "description": "filter by IDs greater than or equal to this ID" + } + } + } + ] + } + }, + { + "in": "query", + "name": "name", + "style": "form", + "explode": false, + "description": "Filter by the customer group name", + "schema": { + "type": "array", + "description": "multiple customer group names", + "items": { + "type": "string", + "description": "customer group name" + } + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting customer groups were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting customer groups were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of customer groups returned.", + "schema": { + "type": "integer", + "default": 10 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each customer groups of the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetCustomerGroupsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.list()\n.then(({ customer_groups, limit, offset, count }) => {\n console.log(customer_groups.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/customer-groups' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCustomerGroups", + "summary": "Create a Customer Group", + "description": "Creates a CustomerGroup.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCustomerGroupsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.create({\n name: 'VIP'\n})\n.then(({ customer_group }) => {\n console.log(customer_group.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/customer-groups' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"VIP\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/customer-groups/{id}": { + "get": { + "operationId": "GetCustomerGroupsGroup", + "summary": "Get a Customer Group", + "description": "Retrieves a Customer Group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Customer Group.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the customer group.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the customer group.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetCustomerGroupsGroupParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.retrieve(customer_group_id)\n.then(({ customer_group }) => {\n console.log(customer_group.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCustomerGroupsGroup", + "summary": "Update a Customer Group", + "description": "Update a CustomerGroup.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the customer group.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCustomerGroupsGroupReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.update(customer_group_id, {\n name: 'VIP'\n})\n.then(({ customer_group }) => {\n console.log(customer_group.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"VIP\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteCustomerGroupsCustomerGroup", + "summary": "Delete a Customer Group", + "description": "Deletes a CustomerGroup.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Customer Group", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.delete(customer_group_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/customer-groups/{id}/customers": { + "get": { + "operationId": "GetCustomerGroupsGroupCustomers", + "summary": "List Customers", + "description": "Retrieves a list of customers in a customer group", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the customer group.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of items to return.", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "offset", + "description": "The items to skip before result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "a search term to search email, first_name, and last_name.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "listCustomers", + "queryParams": "AdminGetGroupsGroupCustomersParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.listCustomers(customer_group_id)\n.then(({ customers }) => {\n console.log(customers.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}/customers' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomersListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/customer-groups/{id}/customers/batch": { + "post": { + "operationId": "PostCustomerGroupsGroupCustomersBatch", + "summary": "Add Customers", + "description": "Adds a list of customers, represented by id's, to a customer group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the customer group.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq" + } + } + } + }, + "x-codegen": { + "method": "addCustomers" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.addCustomers(customer_group_id, {\n customer_ids: [\n {\n id: customer_id\n }\n ]\n})\n.then(({ customer_group }) => {\n console.log(customer_group.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"customer_ids\": [\n {\n \"id\": \"cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteCustomerGroupsGroupCustomerBatch", + "summary": "Remove Customers", + "description": "Removes a list of customers, represented by id's, from a customer group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the customer group.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq" + } + } + } + }, + "x-codegen": { + "method": "removeCustomers" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customerGroups.removeCustomers(customer_group_id, {\n customer_ids: [\n {\n id: customer_id\n }\n ]\n})\n.then(({ customer_group }) => {\n console.log(customer_group.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"customer_ids\": [\n {\n \"id\": \"cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customer Groups" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomerGroupsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/customers": { + "get": { + "operationId": "GetCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of items to return.", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "offset", + "description": "The items to skip before result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "a search term to search email, first_name, and last_name.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetCustomersParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customers.list()\n.then(({ customers, limit, offset, count }) => {\n console.log(customers.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/customers' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomersListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCustomersReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customers.create({\n email: 'user@example.com',\n first_name: 'Caterina',\n last_name: 'Yost',\n password: 'supersecret'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/customers' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"first_name\": \"Caterina\",\n \"last_name\": \"Yost\",\n \"password\": \"supersecret\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/customers/{id}": { + "get": { + "operationId": "GetCustomersCustomer", + "summary": "Get a Customer", + "description": "Retrieves a Customer.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the customer.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customers.retrieve(customer_id)\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/customers/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCustomersCustomer", + "summary": "Update a Customer", + "description": "Updates a Customer.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be retrieved in each customer.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostCustomersCustomerReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.customers.update(customer_id, {\n first_name: 'Dolly'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/customers/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"first_name\": \"Dolly\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts": { + "get": { + "operationId": "GetDiscounts", + "summary": "List Discounts", + "x-authenticated": true, + "description": "Retrieves a list of Discounts", + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Search query applied on the code field.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "rule", + "description": "Discount Rules filters to apply on the search", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "fixed", + "percentage", + "free_shipping" + ], + "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers." + }, + "allocation": { + "type": "string", + "enum": [ + "total", + "item" + ], + "description": "The value that the discount represents; this will depend on the type of the discount" + } + } + } + }, + { + "in": "query", + "name": "is_dynamic", + "description": "Return only dynamic discounts.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "is_disabled", + "description": "Return only disabled discounts.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of items in the response", + "schema": { + "type": "number", + "default": "20" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of items in response", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetDiscountsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.list()\n.then(({ discounts, limit, offset, count }) => {\n console.log(discounts.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/discounts' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostDiscounts", + "summary": "Creates a Discount", + "x-authenticated": true, + "description": "Creates a Discount with a given set of rules that define how the Discount behaves.", + "parameters": [ + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be retrieved in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDiscountsReq" + } + } + } + }, + "x-codegen": { + "method": "create", + "queryParams": "AdminPostDiscountsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nimport { AllocationType, DiscountRuleType } from \"@medusajs/medusa\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.create({\n code: 'TEST',\n rule: {\n type: DiscountRuleType.FIXED,\n value: 10,\n allocation: AllocationType.ITEM\n },\n regions: [\"reg_XXXXXXXX\"],\n is_dynamic: false,\n is_disabled: false\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"code\": \"TEST\",\n \"rule\": {\n \"type\": \"fixed\",\n \"value\": 10,\n \"allocation\": \"item\"\n },\n \"regions\": [\"reg_XXXXXXXX\"]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/code/{code}": { + "get": { + "operationId": "GetDiscountsDiscountCode", + "summary": "Get Discount by Code", + "description": "Retrieves a Discount by its discount code", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The code of the Discount", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieveByCode", + "queryParams": "AdminGetDiscountsDiscountCodeParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.retrieveByCode(code)\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/discounts/code/{code}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/{discount_id}/conditions": { + "post": { + "operationId": "PostDiscountsDiscountConditions", + "summary": "Create a Condition", + "description": "Creates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each product of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each product of the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDiscountsDiscountConditions" + } + } + } + }, + "x-codegen": { + "method": "createCondition", + "queryParams": "AdminPostDiscountsDiscountConditionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nimport { DiscountConditionOperator } from \"@medusajs/medusa\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.createCondition(discount_id, {\n operator: DiscountConditionOperator.IN\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"operator\": \"in\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/{discount_id}/conditions/{condition_id}": { + "get": { + "operationId": "GetDiscountsDiscountConditionsCondition", + "summary": "Get a Condition", + "description": "Gets a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The ID of the Discount.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The ID of the DiscountCondition.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "getCondition", + "queryParams": "AdminGetDiscountsDiscountConditionsConditionParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.getCondition(discount_id, condition_id)\n.then(({ discount_condition }) => {\n console.log(discount_condition.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountConditionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostDiscountsDiscountConditionsCondition", + "summary": "Update a Condition", + "description": "Updates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The ID of the DiscountCondition.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each item of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each item of the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDiscountsDiscountConditionsCondition" + } + } + } + }, + "x-codegen": { + "method": "updateCondition", + "queryParams": "AdminPostDiscountsDiscountConditionsConditionParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.updateCondition(discount_id, condition_id, {\n products: [\n product_id\n ]\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"products\": [\n \"prod_01G1G5V2MBA328390B5AXJ610F\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteDiscountsDiscountConditionsCondition", + "summary": "Delete a Condition", + "description": "Deletes a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The ID of the Discount", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The ID of the DiscountCondition", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteCondition", + "queryParams": "AdminDeleteDiscountsDiscountConditionsConditionParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.deleteCondition(discount_id, condition_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountConditionsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/{discount_id}/conditions/{condition_id}/batch": { + "post": { + "operationId": "PostDiscountsDiscountConditionsConditionBatch", + "summary": "Add Batch Resources", + "description": "Add a batch of resources to a discount condition.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The ID of the condition on which to add the item.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which relations should be expanded in each discount of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each discount of the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq" + } + } + } + }, + "x-codegen": { + "method": "addConditionResourceBatch", + "queryParams": "AdminPostDiscountsDiscountConditionsConditionBatchParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.addConditionResourceBatch(discount_id, condition_id, {\n resources: [{ id: item_id }]\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"resources\": [{ \"id\": \"item_id\" }]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteDiscountsDiscountConditionsConditionBatch", + "summary": "Delete Batch Resources", + "description": "Delete a batch of resources from a discount condition.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The ID of the condition on which to add the item.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which relations should be expanded in each discount of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each discount of the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq" + } + } + } + }, + "x-codegen": { + "method": "deleteConditionResourceBatch" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.deleteConditionResourceBatch(discount_id, condition_id, {\n resources: [{ id: item_id }]\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"resources\": [{ \"id\": \"item_id\" }]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/{id}": { + "get": { + "operationId": "GetDiscountsDiscount", + "summary": "Get a Discount", + "description": "Retrieves a Discount", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Discount", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetDiscountParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.retrieve(discount_id)\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "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" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each item of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each item of the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDiscountsDiscountReq" + } + } + } + }, + "x-codegen": { + "method": "update", + "queryParams": "AdminPostDiscountsDiscountParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.update(discount_id, {\n code: 'TEST'\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"code\": \"TEST\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "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" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.delete(discount_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/{id}/dynamic-codes": { + "post": { + "operationId": "PostDiscountsDiscountDynamicCodes", + "summary": "Create a Dynamic Code", + "description": "Creates a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Discount to create the dynamic code from.\"", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq" + } + } + } + }, + "x-codegen": { + "method": "createDynamicCode" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.createDynamicCode(discount_id, {\n code: 'TEST',\n usage_limit: 1\n})\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"code\": \"TEST\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/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" + } + } + ], + "x-codegen": { + "method": "deleteDynamicCode" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.deleteDynamicCode(discount_id, code)\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/discounts/{id}/regions/{region_id}": { + "post": { + "operationId": "PostDiscountsDiscountRegionsRegion", + "summary": "Add Region", + "description": "Adds a Region to the list of Regions that a Discount can be used in.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Discount.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "region_id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "addRegion" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.addRegion(discount_id, region_id)\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteDiscountsDiscountRegionsRegion", + "summary": "Remove Region", + "x-authenticated": true, + "description": "Removes a Region from the list of Regions that a Discount can be used in.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Discount.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "region_id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "removeRegion" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.discounts.removeRegion(discount_id, region_id)\n.then(({ discount }) => {\n console.log(discount.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Discounts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDiscountsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/draft-orders": { + "get": { + "operationId": "GetDraftOrders", + "summary": "List Draft Orders", + "description": "Retrieves an list of Draft Orders", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The number of items to skip before the results.", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of items returned.", + "schema": { + "type": "number", + "default": "50" + } + }, + { + "in": "query", + "name": "q", + "description": "a search term to search emails in carts associated with draft orders and display IDs of draft orders", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetDraftOrdersParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.list()\n.then(({ draft_orders, limit, offset, count }) => {\n console.log(draft_orders.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/draft-orders' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostDraftOrders", + "summary": "Create a Draft Order", + "description": "Creates a Draft Order", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDraftOrdersReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.create({\n email: 'user@example.com',\n region_id,\n items: [\n {\n quantity: 1\n }\n ],\n shipping_methods: [\n {\n option_id\n }\n ],\n})\n.then(({ draft_order }) => {\n console.log(draft_order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/draft-orders' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"region_id\": \"{region_id}\"\n \"items\": [\n {\n \"quantity\": 1\n }\n ],\n \"shipping_methods\": [\n {\n \"option_id\": \"{option_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/draft-orders/{id}": { + "get": { + "operationId": "GetDraftOrdersDraftOrder", + "summary": "Get a Draft Order", + "description": "Retrieves a Draft Order.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.retrieve(draft_order_id)\n.then(({ draft_order }) => {\n console.log(draft_order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/draft-orders/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostDraftOrdersDraftOrder", + "summary": "Update a Draft Order", + "description": "Updates a Draft Order.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDraftOrdersDraftOrderReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.update(draft_order_id, {\n email: \"user@example.com\"\n})\n.then(({ draft_order }) => {\n console.log(draft_order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteDraftOrdersDraftOrder", + "summary": "Delete a Draft Order", + "description": "Deletes a Draft Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.delete(draft_order_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/draft-orders/{id}/line-items": { + "post": { + "operationId": "PostDraftOrdersDraftOrderLineItems", + "summary": "Create a Line Item", + "description": "Creates a Line Item for the Draft Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq" + } + } + } + }, + "x-codegen": { + "method": "addLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.addLineItem(draft_order_id, {\n quantity: 1\n})\n.then(({ draft_order }) => {\n console.log(draft_order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"quantity\": 1\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/draft-orders/{id}/line-items/{line_id}": { + "post": { + "operationId": "PostDraftOrdersDraftOrderLineItemsItem", + "summary": "Update a Line Item", + "description": "Updates a Line Item for a Draft Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_id", + "required": true, + "description": "The ID of the Line Item.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq" + } + } + } + }, + "x-codegen": { + "method": "updateLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, {\n quantity: 1\n})\n.then(({ draft_order }) => {\n console.log(draft_order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"quantity\": 1\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteDraftOrdersDraftOrderLineItemsItem", + "summary": "Delete a Line Item", + "description": "Removes a Line Item from a Draft Order.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_id", + "required": true, + "description": "The ID of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "removeLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.removeLineItem(draft_order_id, item_id)\n.then(({ draft_order }) => {\n console.log(draft_order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDraftOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/draft-orders/{id}/pay": { + "post": { + "summary": "Registers a Payment", + "operationId": "PostDraftOrdersDraftOrderRegisterPayment", + "description": "Registers a payment for a Draft Order.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Draft Order id.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "markPaid" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.draftOrders.markPaid(draft_order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/pay' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Draft Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/gift-cards": { + "get": { + "operationId": "GetGiftCards", + "summary": "List Gift Cards", + "description": "Retrieves a list of Gift Cards.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The number of items to skip before the results.", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of items returned.", + "schema": { + "type": "number", + "default": "50" + } + }, + { + "in": "query", + "name": "q", + "description": "a search term to search by code or display ID", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetGiftCardsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.giftCards.list()\n.then(({ gift_cards, limit, offset, count }) => {\n console.log(gift_cards.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/gift-cards' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Gift Cards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminGiftCardsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostGiftCards", + "summary": "Create a Gift Card", + "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostGiftCardsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.giftCards.create({\n region_id\n})\n.then(({ gift_card }) => {\n console.log(gift_card.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/gift-cards' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"region_id\": \"{region_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Gift Cards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminGiftCardsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/gift-cards/{id}": { + "get": { + "operationId": "GetGiftCardsGiftCard", + "summary": "Get a Gift Card", + "description": "Retrieves a Gift Card.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Gift Card.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.giftCards.retrieve(gift_card_id)\n.then(({ gift_card }) => {\n console.log(gift_card.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/gift-cards/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Gift Cards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminGiftCardsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostGiftCardsGiftCard", + "summary": "Update a Gift Card", + "description": "Update a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Gift Card.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostGiftCardsGiftCardReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.giftCards.update(gift_card_id, {\n region_id\n})\n.then(({ gift_card }) => {\n console.log(gift_card.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/gift-cards/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"region_id\": \"{region_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Gift Cards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminGiftCardsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteGiftCardsGiftCard", + "summary": "Delete a Gift Card", + "description": "Deletes a Gift Card", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Gift Card to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.giftCards.delete(gift_card_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/gift-cards/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Gift Cards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminGiftCardsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/inventory-items": { + "get": { + "operationId": "GetInventoryItems", + "summary": "List inventory items.", + "description": "Lists inventory items.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "How many inventory items to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of inventory items returned.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "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" + } + }, + { + "in": "query", + "name": "q", + "description": "Query used for searching product inventory items and their properties.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "location_id", + "style": "form", + "explode": false, + "description": "Locations ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "id", + "description": "id to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "sku", + "description": "sku to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "origin_country", + "description": "origin_country to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "mid_code", + "description": "mid_code to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "material", + "description": "material to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "hs_code", + "description": "hs_code to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "weight", + "description": "weight to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "length", + "description": "length to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "height", + "description": "height to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "width", + "description": "width to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "requires_shipping", + "description": "requires_shipping to search for.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetInventoryItemsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.list()\n.then(({ inventory_items }) => {\n console.log(inventory_items.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostInventoryItems", + "summary": "Create an Inventory Item.", + "description": "Creates an Inventory Item.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostInventoryItemsReq" + } + } + } + }, + "x-codegen": { + "method": "create", + "queryParams": "AdminPostInventoryItemsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.create(inventoryItemId, {\n variant_id: 'variant_123',\n sku: \"sku-123\",\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"variant_id\": \"variant_123\",\n \"sku\": \"sku-123\",\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/inventory-items/{id}": { + "get": { + "operationId": "GetInventoryItemsInventoryItem", + "summary": "Retrive an Inventory Item.", + "description": "Retrives an Inventory Item.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetInventoryItemsItemParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.retrieve(inventoryItemId)\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostInventoryItemsInventoryItem", + "summary": "Update an Inventory Item.", + "description": "Updates an Inventory Item.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostInventoryItemsInventoryItemReq" + } + } + } + }, + "x-codegen": { + "method": "update", + "queryParams": "AdminPostInventoryItemsInventoryItemParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.update(inventoryItemId, {\n origin_country: \"US\",\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"origin_country\": \"US\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteInventoryItemsInventoryItem", + "summary": "Delete an Inventory Item", + "description": "Delete an Inventory Item", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.delete(inventoryItemId)\n .then(({ id, object, deleted }) => {\n console.log(id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + } + } + } + }, + "/admin/inventory-items/{id}/location-levels": { + "get": { + "operationId": "GetInventoryItemsInventoryItemLocationLevels", + "summary": "List stock levels of a given location.", + "description": "Lists stock levels of a given location.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many stock locations levels to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of stock locations levels returned.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "listLocationLevels", + "queryParams": "AdminGetInventoryItemsItemLocationLevelsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.listLocationLevels(inventoryItemId)\n.then(({ inventory_item }) => {\n console.log(inventory_item.location_levels);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsLocationLevelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostInventoryItemsInventoryItemLocationLevels", + "summary": "Create an Inventory Location Level for a given Inventory Item.", + "description": "Creates an Inventory Location Level for a given Inventory Item.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq" + } + } + } + }, + "x-codegen": { + "method": "createLocationLevel", + "queryParams": "AdminPostInventoryItemsItemLocationLevelsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.createLocationLevel(inventoryItemId, {\n location_id: 'sloc',\n stocked_quantity: 10,\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"location_id\": \"sloc\",\n \"stocked_quantity\": 10\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/inventory-items/{id}/location-levels/{location_id}": { + "post": { + "operationId": "PostInventoryItemsInventoryItemLocationLevelsLocationLevel", + "summary": "Update an Inventory Location Level for a given Inventory Item.", + "description": "Updates an Inventory Location Level for a given Inventory Item.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "location_id", + "required": true, + "description": "The ID of the Location.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq" + } + } + } + }, + "x-codegen": { + "method": "updateLocationLevel", + "queryParams": "AdminPostInventoryItemsItemLocationLevelsLevelParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, {\n stocked_quantity: 15,\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"stocked_quantity\": 15\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteInventoryItemsInventoryIteLocationLevelsLocation", + "summary": "Delete a location level of an Inventory Item.", + "description": "Delete a location level of an Inventory Item.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Inventory Item.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "location_id", + "required": true, + "description": "The ID of the location.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteLocationLevel" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId)\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Inventory Items" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInventoryItemsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/invites": { + "get": { + "operationId": "GetInvites", + "summary": "Lists Invites", + "description": "Lists all Invites", + "x-authenticated": true, + "x-codegen": { + "method": "list" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.invites.list()\n.then(({ invites }) => {\n console.log(invites.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/invites' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminListInvitesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostInvites", + "summary": "Create an Invite", + "description": "Creates an Invite and triggers an 'invite' created event", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostInvitesReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.invites.create({\n user: \"user@example.com\",\n role: \"admin\"\n})\n.then(() => {\n // successful\n})\n.catch(() => {\n // an error occurred\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/invites' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"user\": \"user@example.com\",\n \"role\": \"admin\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/invites/accept": { + "post": { + "operationId": "PostInvitesInviteAccept", + "summary": "Accept an Invite", + "description": "Accepts an Invite and creates a corresponding user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostInvitesInviteAcceptReq" + } + } + } + }, + "x-codegen": { + "method": "accept" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.invites.accept({\n token,\n user: {\n first_name: 'Brigitte',\n last_name: 'Collier',\n password: 'supersecret'\n }\n})\n.then(() => {\n // successful\n})\n.catch(() => {\n // an error occurred\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/invites/accept' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"token\": \"{token}\",\n \"user\": {\n \"first_name\": \"Brigitte\",\n \"last_name\": \"Collier\",\n \"password\": \"supersecret\"\n }\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/invites/{invite_id}": { + "delete": { + "operationId": "DeleteInvitesInvite", + "summary": "Delete an Invite", + "description": "Deletes an Invite", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "invite_id", + "required": true, + "description": "The ID of the Invite", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.invites.delete(invite_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/invites/{invite_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminInviteDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/invites/{invite_id}/resend": { + "post": { + "operationId": "PostInvitesInviteResend", + "summary": "Resend an Invite", + "description": "Resends an Invite by triggering the 'invite' created event again", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "invite_id", + "required": true, + "description": "The ID of the Invite", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "resend" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.invites.resend(invite_id)\n.then(() => {\n // successful\n})\n.catch(() => {\n // an error occurred\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/invites/{invite_id}/resend' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/notes": { + "get": { + "operationId": "GetNotes", + "summary": "List Notes", + "x-authenticated": true, + "description": "Retrieves a list of notes", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of notes to get", + "schema": { + "type": "number", + "default": "50" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset at which to get notes", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "resource_id", + "description": "The ID which the notes belongs to", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetNotesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notes.list()\n.then(({ notes, limit, offset, count }) => {\n console.log(notes.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/notes' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notes" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotesListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostNotes", + "summary": "Creates a Note", + "description": "Creates a Note which can be associated with any resource as required.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostNotesReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notes.create({\n resource_id,\n resource_type: 'order',\n value: 'We delivered this order'\n})\n.then(({ note }) => {\n console.log(note.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/notes' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"resource_id\": \"{resource_id}\",\n \"resource_type\": \"order\",\n \"value\": \"We delivered this order\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notes" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/notes/{id}": { + "get": { + "operationId": "GetNotesNote", + "summary": "Get a Note", + "description": "Retrieves a single note using its id", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the note to retrieve.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notes.retrieve(note_id)\n.then(({ note }) => {\n console.log(note.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/notes/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notes" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostNotesNote", + "summary": "Update a Note", + "x-authenticated": true, + "description": "Updates a Note associated with some resource", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Note to update", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostNotesNoteReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notes.update(note_id, {\n value: 'We delivered this order'\n})\n.then(({ note }) => {\n console.log(note.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/notes/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"value\": \"We delivered this order\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notes" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteNotesNote", + "summary": "Delete a Note", + "description": "Deletes a Note.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Note to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notes.delete(note_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/notes/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notes" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotesDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/notifications": { + "get": { + "operationId": "GetNotifications", + "summary": "List Notifications", + "description": "Retrieves a list of Notifications.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The number of notifications to skip before starting to collect the notifications set", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of notifications to return", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated fields to include in the result set", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated fields to populate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "event_name", + "description": "The name of the event that the notification was sent for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "resource_type", + "description": "The type of resource that the Notification refers to.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "resource_id", + "description": "The ID of the resource that the Notification refers to.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "to", + "description": "The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "include_resends", + "description": "A boolean indicating whether the result set should include resent notifications or not", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetNotificationsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notifications.list()\n.then(({ notifications }) => {\n console.log(notifications.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/notifications' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notifications" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotificationsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/notifications/{id}/resend": { + "post": { + "operationId": "PostNotificationsNotificationResend", + "summary": "Resend Notification", + "description": "Resends a previously sent notifications, with the same data but optionally to a different address", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Notification", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostNotificationsNotificationResendReq" + } + } + } + }, + "x-codegen": { + "method": "resend" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.notifications.resend(notification_id)\n.then(({ notification }) => {\n console.log(notification.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/notifications/{id}/resend' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Notifications" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminNotificationsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/order-edits": { + "get": { + "operationId": "GetOrderEdits", + "summary": "List OrderEdits", + "description": "List OrderEdits.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching order edit internal note.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order_id", + "description": "List order edits by order id.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of items in the response", + "schema": { + "type": "number", + "default": "20" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of items in response", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "GetOrderEditsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.list()\n .then(({ order_edits, count, limit, offset }) => {\n console.log(order_edits.length)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/order-edits' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostOrderEdits", + "summary": "Create an OrderEdit", + "description": "Creates an OrderEdit.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrderEditsReq" + } + } + } + }, + "x-authenticated": true, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.create({ order_id })\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \"order_id\": \"my_order_id\", \"internal_note\": \"my_optional_note\" }'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/order-edits/{id}": { + "get": { + "operationId": "GetOrderEditsOrderEdit", + "summary": "Get an OrderEdit", + "description": "Retrieves a OrderEdit.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the OrderEdit.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "GetOrderEditsOrderEditParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.retrieve(orderEditId)\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/order-edits/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostOrderEditsOrderEdit", + "summary": "Update an OrderEdit", + "description": "Updates a OrderEdit.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the OrderEdit.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrderEditsOrderEditReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.update(order_edit_id, {\n internal_note: \"internal reason XY\"\n})\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"internal_note\": \"internal reason XY\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteOrderEditsOrderEdit", + "summary": "Delete an Order Edit", + "description": "Delete an Order Edit", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.delete(order_edit_id)\n .then(({ id, object, deleted }) => {\n console.log(id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + } + } + } + }, + "/admin/order-edits/{id}/cancel": { + "post": { + "operationId": "PostOrderEditsOrderEditCancel", + "summary": "Cancel an OrderEdit", + "description": "Cancels an OrderEdit.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the OrderEdit.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancel" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.cancel(order_edit_id)\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/order-edits/{id}/changes/{change_id}": { + "delete": { + "operationId": "DeleteOrderEditsOrderEditItemChange", + "summary": "Delete a Line Item Change", + "description": "Deletes an Order Edit Item Change", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit to delete.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "change_id", + "required": true, + "description": "The ID of the Order Edit Item Change to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteItemChange" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id)\n .then(({ id, object, deleted }) => {\n console.log(id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditItemChangeDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + } + } + } + }, + "/admin/order-edits/{id}/confirm": { + "post": { + "operationId": "PostOrderEditsOrderEditConfirm", + "summary": "Confirms an OrderEdit", + "description": "Confirms an OrderEdit.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the order edit.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "confirm" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.confirm(order_edit_id)\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/order-edits/{id}/items": { + "post": { + "operationId": "PostOrderEditsEditLineItems", + "summary": "Add a Line Item", + "description": "Create an OrderEdit LineItem.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrderEditsEditLineItemsReq" + } + } + } + }, + "x-authenticated": true, + "x-codegen": { + "method": "addLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.addLineItem(order_edit_id, {\n variant_id,\n quantity\n})\n.then(({ order_edit }) => {\n console.log(order_edit.id)\n})\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \"variant_id\": \"variant_01G1G5V2MRX2V3PVSR2WXYPFB6\", \"quantity\": 3 }'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/order-edits/{id}/items/{item_id}": { + "post": { + "operationId": "PostOrderEditsEditLineItemsLineItem", + "summary": "Upsert Line Item Change", + "description": "Create or update the order edit change holding the line item changes", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit to update.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "item_id", + "required": true, + "description": "The ID of the order edit item to update.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq" + } + } + } + }, + "x-codegen": { + "method": "updateLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, {\n quantity: 5\n })\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \"quantity\": 5 }'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteOrderEditsOrderEditLineItemsLineItem", + "summary": "Delete a Line Item", + "description": "Delete line items from an order edit and create change item", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit to delete from.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "item_id", + "required": true, + "description": "The ID of the order edit item to delete from order.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "removeLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id)\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/order-edits/{id}/request": { + "post": { + "operationId": "PostOrderEditsOrderEditRequest", + "summary": "Request Confirmation", + "description": "Request customer confirmation of an Order Edit", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit to request confirmation from.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "requestConfirmation" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orderEdits.requestConfirmation(order_edit_id)\n .then({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/request' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders": { + "get": { + "operationId": "GetOrders", + "summary": "List Orders", + "description": "Retrieves a list of Orders", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching orders by shipping address first name, orders' email, and orders' display ID", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "ID of the order to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "style": "form", + "explode": false, + "description": "Status to search for", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "pending", + "completed", + "archived", + "canceled", + "requires_action" + ] + } + } + }, + { + "in": "query", + "name": "fulfillment_status", + "style": "form", + "explode": false, + "description": "Fulfillment status to search for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "not_fulfilled", + "fulfilled", + "partially_fulfilled", + "shipped", + "partially_shipped", + "canceled", + "returned", + "partially_returned", + "requires_action" + ] + } + } + }, + { + "in": "query", + "name": "payment_status", + "style": "form", + "explode": false, + "description": "Payment status to search for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "captured", + "awaiting", + "not_paid", + "refunded", + "partially_refunded", + "canceled", + "requires_action" + ] + } + } + }, + { + "in": "query", + "name": "display_id", + "description": "Display ID to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "customer_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "email", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "style": "form", + "explode": false, + "description": "Regions to search orders by", + "schema": { + "oneOf": [ + { + "type": "string", + "description": "ID of a Region." + }, + { + "type": "array", + "items": { + "type": "string", + "description": "ID of a Region." + } + } + ] + } + }, + { + "in": "query", + "name": "currency_code", + "style": "form", + "explode": false, + "description": "Currency code to search for", + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + }, + { + "in": "query", + "name": "tax_rate", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting orders were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting orders were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "canceled_at", + "description": "Date comparison for when resulting orders were canceled.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "sales_channel_id", + "style": "form", + "explode": false, + "description": "Filter by Sales Channels", + "schema": { + "type": "array", + "items": { + "type": "string", + "description": "The ID of a Sales Channel" + } + } + }, + { + "in": "query", + "name": "offset", + "description": "How many orders to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of orders returned.", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each order of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each order of the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetOrdersParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.list()\n.then(({ orders, limit, offset, count }) => {\n console.log(orders.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/orders' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}": { + "get": { + "operationId": "GetOrdersOrder", + "summary": "Get an Order", + "description": "Retrieves an Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetOrdersOrderParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.retrieve(order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/orders/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostOrdersOrder", + "summary": "Update an Order", + "description": "Updates and order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderReq" + } + } + } + }, + "x-codegen": { + "method": "update", + "params": "AdminPostOrdersOrderParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.update(order_id, {\n email: 'user@example.com'\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/adasda' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/archive": { + "post": { + "operationId": "PostOrdersOrderArchive", + "summary": "Archive Order", + "description": "Archives the order with the given id.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "archive", + "params": "AdminPostOrdersOrderArchiveParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.archive(order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/archive' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/cancel": { + "post": { + "operationId": "PostOrdersOrderCancel", + "summary": "Cancel an Order", + "description": "Registers an Order as canceled. This triggers a flow that will cancel any created Fulfillments and Payments, may fail if the Payment or Fulfillment Provider is unable to cancel the Payment/Fulfillment.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancel", + "params": "AdminPostOrdersOrderCancel" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.cancel(order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/capture": { + "post": { + "operationId": "PostOrdersOrderCapture", + "summary": "Capture Order's Payment", + "description": "Captures all the Payments associated with an Order.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "capturePayment", + "params": "AdminPostOrdersOrderCaptureParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.capturePayment(order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/capture' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/claims": { + "post": { + "operationId": "PostOrdersOrderClaims", + "summary": "Create a Claim", + "description": "Creates a Claim.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderClaimsReq" + } + } + } + }, + "x-codegen": { + "method": "createClaim", + "params": "AdminPostOrdersOrderClaimsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createClaim(order_id, {\n type: 'refund',\n claim_items: [\n {\n item_id,\n quantity: 1\n }\n ]\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"type\": \"refund\",\n \"claim_items\": [\n {\n \"item_id\": \"asdsd\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/claims/{claim_id}": { + "post": { + "operationId": "PostOrdersOrderClaimsClaim", + "summary": "Update a Claim", + "description": "Updates a Claim.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The ID of the Claim.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderClaimsClaimReq" + } + } + } + }, + "x-codegen": { + "method": "updateClaim", + "params": "AdminPostOrdersOrderClaimsClaimParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.updateClaim(order_id, claim_id, {\n no_notification: true\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"no_notification\": true\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/claims/{claim_id}/cancel": { + "post": { + "operationId": "PostOrdersClaimCancel", + "summary": "Cancel a Claim", + "description": "Cancels a Claim", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The ID of the Claim.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancelClaim", + "params": "AdminPostOrdersClaimCancel" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.cancelClaim(order_id, claim_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/claims/{claim_id}/fulfillments": { + "post": { + "operationId": "PostOrdersOrderClaimsClaimFulfillments", + "summary": "Create Claim Fulfillment", + "description": "Creates a Fulfillment for a Claim.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The ID of the Claim.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq" + } + } + } + }, + "x-codegen": { + "method": "fulfillClaim", + "params": "AdminPostOrdersOrderClaimsClaimFulfillmentsReq" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.fulfillClaim(order_id, claim_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel": { + "post": { + "operationId": "PostOrdersClaimFulfillmentsCancel", + "summary": "Cancel Claim Fulfillment", + "description": "Registers a claim's fulfillment as canceled.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order which the Claim relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The ID of the Claim which the Fulfillment relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "fulfillment_id", + "required": true, + "description": "The ID of the Fulfillment.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancelClaimFulfillment", + "params": "AdminPostOrdersClaimFulfillmentsCancelParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, fulfillment_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/claims/{claim_id}/shipments": { + "post": { + "operationId": "PostOrdersOrderClaimsClaimShipments", + "summary": "Create Claim Shipment", + "description": "Registers a Claim Fulfillment as shipped.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "claim_id", + "required": true, + "description": "The ID of the Claim.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq" + } + } + } + }, + "x-codegen": { + "method": "createClaimShipment", + "params": "AdminPostOrdersOrderClaimsClaimShipmentsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createClaimShipment(order_id, claim_id, {\n fulfillment_id\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"fulfillment_id\": \"{fulfillment_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/complete": { + "post": { + "operationId": "PostOrdersOrderComplete", + "summary": "Complete an Order", + "description": "Completes an Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "complete", + "params": "AdminPostOrdersOrderCompleteParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.complete(order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/complete' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/fulfillment": { + "post": { + "operationId": "PostOrdersOrderFulfillments", + "summary": "Create a Fulfillment", + "description": "Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderFulfillmentsReq" + } + } + } + }, + "x-codegen": { + "method": "createFulfillment", + "params": "AdminPostOrdersOrderFulfillmentsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createFulfillment(order_id, {\n items: [\n {\n item_id,\n quantity: 1\n }\n ]\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"items\": [\n {\n \"item_id\": \"{item_id}\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel": { + "post": { + "operationId": "PostOrdersOrderFulfillmentsCancel", + "summary": "Cancels a Fulfilmment", + "description": "Registers a Fulfillment as canceled.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order which the Fulfillment relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "fulfillment_id", + "required": true, + "description": "The ID of the Fulfillment", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancelFulfillment", + "params": "AdminPostOrdersOrderFulfillementsCancelParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.cancelFulfillment(order_id, fulfillment_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/line-items/{line_item_id}/reserve": { + "post": { + "operationId": "PostOrdersOrderLineItemReservations", + "summary": "Create a Reservation for a line item", + "description": "Creates a Reservation for a line item at a specified location, optionally for a partial quantity.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_item_id", + "required": true, + "description": "The ID of the Line item.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersOrderLineItemReservationReq" + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createReservation(order_id, line_item_id, {\n location_id\n})\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"location_id\": \"loc_1\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostReservationsReq" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/refund": { + "post": { + "operationId": "PostOrdersOrderRefunds", + "summary": "Create a Refund", + "description": "Issues a Refund.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderRefundsReq" + } + } + } + }, + "x-codegen": { + "method": "refundPayment", + "params": "AdminPostOrdersOrderRefundsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.refundPayment(order_id, {\n amount: 1000,\n reason: 'Do not like it'\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/adasda/refund' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"amount\": 1000,\n \"reason\": \"Do not like it\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/reservations": { + "get": { + "operationId": "GetOrdersOrderReservations", + "summary": "Get reservations for an Order", + "description": "Retrieves reservations for an Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many reservations to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of reservations returned.", + "schema": { + "type": "integer", + "default": 20 + } + } + ], + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.retrieveReservations(order_id)\n.then(({ reservations }) => {\n console.log(reservations[0].id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReservationsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/return": { + "post": { + "operationId": "PostOrdersOrderReturns", + "summary": "Request a Return", + "description": "Requests a Return. If applicable a return label will be created and other plugins notified.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderReturnsReq" + } + } + } + }, + "x-codegen": { + "method": "requestReturn", + "params": "AdminPostOrdersOrderReturnsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.requestReturn(order_id, {\n items: [\n {\n item_id,\n quantity: 1\n }\n ]\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/return' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"items\": [\n {\n \"item_id\": \"{item_id}\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/shipment": { + "post": { + "operationId": "PostOrdersOrderShipment", + "summary": "Create a Shipment", + "description": "Registers a Fulfillment as shipped.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderShipmentReq" + } + } + } + }, + "x-codegen": { + "method": "createShipment", + "params": "AdminPostOrdersOrderShipmentParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createShipment(order_id, {\n fulfillment_id\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipment' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"fulfillment_id\": \"{fulfillment_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/shipping-methods": { + "post": { + "operationId": "PostOrdersOrderShippingMethods", + "summary": "Add a Shipping Method", + "description": "Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderShippingMethodsReq" + } + } + } + }, + "x-authenticated": true, + "x-codegen": { + "method": "addShippingMethod", + "params": "AdminPostOrdersOrderShippingMethodsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.addShippingMethod(order_id, {\n price: 1000,\n option_id\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"price\": 1000,\n \"option_id\": \"{option_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/swaps": { + "post": { + "operationId": "PostOrdersOrderSwaps", + "summary": "Create a Swap", + "description": "Creates a Swap. Swaps are used to handle Return of previously purchased goods and Fulfillment of replacements simultaneously.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded the order of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included the order of the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderSwapsReq" + } + } + } + }, + "x-codegen": { + "method": "createSwap", + "queryParams": "AdminPostOrdersOrderSwapsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createSwap(order_id, {\n return_items: [\n {\n item_id,\n quantity: 1\n }\n ]\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"return_items\": [\n {\n \"item_id\": \"asfasf\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/swaps/{swap_id}/cancel": { + "post": { + "operationId": "PostOrdersSwapCancel", + "summary": "Cancels a Swap", + "description": "Cancels a Swap", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The ID of the Swap.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancelSwap", + "params": "AdminPostOrdersSwapCancelParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.cancelSwap(order_id, swap_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/swaps/{swap_id}/fulfillments": { + "post": { + "operationId": "PostOrdersOrderSwapsSwapFulfillments", + "summary": "Create Swap Fulfillment", + "description": "Creates a Fulfillment for a Swap.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The ID of the Swap.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq" + } + } + } + }, + "x-codegen": { + "method": "fulfillSwap", + "params": "AdminPostOrdersOrderSwapsSwapFulfillmentsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.fulfillSwap(order_id, swap_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel": { + "post": { + "operationId": "PostOrdersSwapFulfillmentsCancel", + "summary": "Cancel Swap's Fulfilmment", + "description": "Registers a Swap's Fulfillment as canceled.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order which the Swap relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The ID of the Swap which the Fulfillment relates to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "fulfillment_id", + "required": true, + "description": "The ID of the Fulfillment.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancelSwapFulfillment", + "params": "AdminPostOrdersSwapFulfillementsCancelParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, fulfillment_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/swaps/{swap_id}/process-payment": { + "post": { + "operationId": "PostOrdersOrderSwapsSwapProcessPayment", + "summary": "Process Swap Payment", + "description": "When there are differences between the returned and shipped Products in a Swap, the difference must be processed. Either a Refund will be issued or a Payment will be captured.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The ID of the Swap.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "processSwapPayment", + "params": "AdminPostOrdersOrderSwapsSwapProcessPaymentParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.processSwapPayment(order_id, swap_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/orders/{id}/swaps/{swap_id}/shipments": { + "post": { + "operationId": "PostOrdersOrderSwapsSwapShipments", + "summary": "Create Swap Shipment", + "description": "Registers a Swap Fulfillment as shipped.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "swap_id", + "required": true, + "description": "The ID of the Swap.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the result.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq" + } + } + } + }, + "x-codegen": { + "method": "createSwapShipment", + "params": "AdminPostOrdersOrderSwapsSwapShipmentsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createSwapShipment(order_id, swap_id, {\n fulfillment_id\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"fulfillment_id\": \"{fulfillment_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/payment-collections/{id}": { + "get": { + "operationId": "GetPaymentCollectionsPaymentCollection", + "summary": "Get a PaymentCollection", + "description": "Retrieves a PaymentCollection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PaymentCollection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetPaymentCollectionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.paymentCollections.retrieve(paymentCollectionId)\n .then(({ payment_collection }) => {\n console.log(payment_collection.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/payment-collections/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostPaymentCollectionsPaymentCollection", + "summary": "Update PaymentCollection", + "description": "Updates a PaymentCollection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PaymentCollection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUpdatePaymentCollectionsReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.paymentCollections.update(payment_collection_id, {\n description: \"Description of payCol\"\n})\n .then(({ payment_collection }) => {\n console.log(payment_collection.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"description\": \"Description of payCol\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeletePaymentCollectionsPaymentCollection", + "summary": "Del a PaymentCollection", + "description": "Deletes a Payment Collection", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment Collection to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.paymentCollections.delete(payment_collection_id)\n .then(({ id, object, deleted }) => {\n console.log(id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentCollectionDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + } + } + } + }, + "/admin/payment-collections/{id}/authorize": { + "post": { + "operationId": "PostPaymentCollectionsPaymentCollectionAuthorize", + "summary": "Mark Authorized", + "description": "Sets the status of PaymentCollection as Authorized.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PaymentCollection.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "markAsAuthorized" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.paymentCollections.markAsAuthorized(payment_collection_id)\n .then(({ payment_collection }) => {\n console.log(payment_collection.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/payments/{id}": { + "get": { + "operationId": "GetPaymentsPayment", + "summary": "Get Payment details", + "description": "Retrieves the Payment details", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "GetPaymentsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.payments.retrieve(payment_id)\n.then(({ payment }) => {\n console.log(payment.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payments" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/payments/{id}/capture": { + "post": { + "operationId": "PostPaymentsPaymentCapture", + "summary": "Capture a Payment", + "description": "Captures a Payment.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "capturePayment" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.payments.capturePayment(payment_id)\n.then(({ payment }) => {\n console.log(payment.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payments" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/payments/{id}/refund": { + "post": { + "operationId": "PostPaymentsPaymentRefunds", + "summary": "Create a Refund", + "description": "Issues a Refund.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPaymentRefundsReq" + } + } + } + }, + "x-codegen": { + "method": "refundPayment" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.payments.refundPayment(payment_id, {\n amount: 1000,\n reason: 'return',\n note: 'Do not like it',\n})\n.then(({ payment }) => {\n console.log(payment.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/payments/pay_123/refund' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"amount\": 1000,\n \"reason\": \"return\",\n \"note\": \"Do not like it\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payments" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRefundRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/price-lists": { + "get": { + "operationId": "GetPriceLists", + "summary": "List Price Lists", + "description": "Retrieves a list of Price Lists.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of items to get", + "schema": { + "type": "number", + "default": "10" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset at which to get items", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each item of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "field to order results by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "ID to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "query to search in price list description, price list name, and customer group name fields.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "style": "form", + "explode": false, + "description": "Status to search for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "active", + "draft" + ] + } + } + }, + { + "in": "query", + "name": "name", + "description": "price list name to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "customer_groups", + "style": "form", + "explode": false, + "description": "Customer Group IDs to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "type", + "style": "form", + "explode": false, + "description": "Type to search for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "sale", + "override" + ] + } + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting price lists were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting price lists were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting price lists were deleted.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetPriceListPaginationParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.list()\n.then(({ price_lists, limit, offset, count }) => {\n console.log(price_lists.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/price-lists' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostPriceListsPriceList", + "summary": "Create a Price List", + "description": "Creates a Price List", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPriceListsPriceListReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nimport { PriceListType } from \"@medusajs/medusa\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.create({\n name: 'New Price List',\n description: 'A new price list',\n type: PriceListType.SALE,\n prices: [\n {\n amount: 1000,\n variant_id,\n currency_code: 'eur'\n }\n ]\n})\n.then(({ price_list }) => {\n console.log(price_list.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/price-lists' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"New Price List\",\n \"description\": \"A new price list\",\n \"type\": \"sale\",\n \"prices\": [\n {\n \"amount\": 1000,\n \"variant_id\": \"afafa\",\n \"currency_code\": \"eur\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/price-lists/{id}": { + "get": { + "operationId": "GetPriceListsPriceList", + "summary": "Get a Price List", + "description": "Retrieves a Price List.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Price List.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.retrieve(price_list_id)\n.then(({ price_list }) => {\n console.log(price_list.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostPriceListsPriceListPriceList", + "summary": "Update a Price List", + "description": "Updates a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Price List.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPriceListsPriceListPriceListReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.update(price_list_id, {\n name: 'New Price List'\n})\n.then(({ price_list }) => {\n console.log(price_list.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"New Price List\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "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" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.delete(price_list_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/price-lists/{id}/prices/batch": { + "post": { + "operationId": "PostPriceListsPriceListPricesBatch", + "summary": "Update Prices", + "description": "Batch update prices for a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Price List to update prices for.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPriceListPricesPricesReq" + } + } + } + }, + "x-codegen": { + "method": "addPrices" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.addPrices(price_list_id, {\n prices: [\n {\n amount: 1000,\n variant_id,\n currency_code: 'eur'\n }\n ]\n})\n.then(({ price_list }) => {\n console.log(price_list.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"prices\": [\n {\n \"amount\": 100,\n \"variant_id\": \"afasfa\",\n \"currency_code\": \"eur\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeletePriceListsPriceListPricesBatch", + "summary": "Delete Prices", + "description": "Batch delete prices that belong to a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Price List that the Money Amounts (Prices) that will be deleted belongs to.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeletePriceListPricesPricesReq" + } + } + } + }, + "x-codegen": { + "method": "deletePrices" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.deletePrices(price_list_id, {\n price_ids: [\n price_id\n ]\n})\n.then(({ ids, object, deleted }) => {\n console.log(ids.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"price_ids\": [\n \"adasfa\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListDeleteBatchRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/price-lists/{id}/products": { + "get": { + "operationId": "GetPriceListsPriceListProducts", + "summary": "List Products", + "description": "Retrieves a list of Product that are part of a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the price list.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "Query used for searching product title and description, variant title and sku, and collection title.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "ID of the product to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "description": "Product status to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "draft", + "proposed", + "published", + "rejected" + ] + } + } + }, + { + "in": "query", + "name": "collection_id", + "description": "Collection IDs to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "tags", + "description": "Tag IDs to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "title", + "description": "product title to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "product description to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "product handle to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_giftcard", + "description": "Search for giftcards using is_giftcard=true.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "type", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "field to sort results by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting products were deleted.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each product of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each product of the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "listProducts", + "queryParams": "AdminGetPriceListsPriceListProductsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.listProducts(price_list_id)\n.then(({ products, limit, offset, count }) => {\n console.log(products.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}/products' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListsProductsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/price-lists/{id}/products/{product_id}/prices": { + "delete": { + "operationId": "DeletePriceListsPriceListProductsProductPrices", + "summary": "Delete Product's Prices", + "description": "Delete all the prices related to a specific product in a price list", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Price List that the Money Amounts that will be deleted belongs to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "product_id", + "required": true, + "description": "The ID of the product from which the money amount will be deleted.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteProductPrices" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.deleteProductPrices(price_list_id, product_id)\n.then(({ ids, object, deleted }) => {\n console.log(ids.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListDeleteProductPricesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/price-lists/{id}/variants/{variant_id}/prices": { + "delete": { + "operationId": "DeletePriceListsPriceListVariantsVariantPrices", + "summary": "Delete Variant's Prices", + "description": "Delete all the prices related to a specific variant in a price list", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Price List that the Money Amounts that will be deleted belongs to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "variant_id", + "required": true, + "description": "The ID of the variant from which the money amount will be deleted.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteVariantPrices" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.priceLists.deleteVariantPrices(price_list_id, variant_id)\n.then(({ ids, object, deleted }) => {\n console.log(ids);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Price Lists" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPriceListDeleteVariantPricesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/product-categories": { + "get": { + "operationId": "GetProductCategories", + "summary": "List Product Categories", + "description": "Retrieve a list of product categories.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching product category names orhandles.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_internal", + "description": "Search for only internal categories.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "is_active", + "description": "Search for only active categories", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "include_descendants_tree", + "description": "Include all nested descendants of category", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "parent_category_id", + "description": "Returns categories scoped by parent", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many product categories to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of product categories returned.", + "schema": { + "type": "integer", + "default": 100 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the product category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the product category.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetProductCategoriesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.list()\n.then(({ product_categories, limit, offset, count }) => {\n console.log(product_categories.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/product-categories' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostProductCategories", + "summary": "Create a Product Category", + "description": "Creates a Product Category.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be retrieved in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductCategoriesReq" + } + } + } + }, + "x-codegen": { + "method": "create", + "queryParams": "AdminPostProductCategoriesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.create({\n name: \"Skinny Jeans\",\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/product-categories' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Skinny Jeans\",\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesCategoryRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/product-categories/{id}": { + "get": { + "operationId": "GetProductCategoriesCategory", + "summary": "Get a Product Category", + "description": "Retrieves a Product Category.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Category", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetProductCategoryParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.retrieve(product_category_id)\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/product-categories/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesCategoryRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostProductCategoriesCategory", + "summary": "Update a Product Category", + "description": "Updates a Product Category.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each product category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be retrieved in each product category.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductCategoriesCategoryReq" + } + } + } + }, + "x-codegen": { + "method": "update", + "queryParams": "AdminPostProductCategoriesCategoryParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.update(product_category_id, {\n name: \"Skinny Jeans\"\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/product-categories/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Skinny Jeans\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesCategoryRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteProductCategoriesCategory", + "summary": "Delete a Product Category", + "description": "Deletes a ProductCategory.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Category", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.delete(product_category_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesCategoryDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/product-categories/{id}/products/batch": { + "post": { + "operationId": "PostProductCategoriesCategoryProductsBatch", + "summary": "Add Products to a category", + "description": "Assign a batch of products to a product category.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Category fields to be expanded in the response.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Category fields to be retrieved in the response.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq" + } + } + } + }, + "x-codegen": { + "method": "addProducts", + "queryParams": "AdminPostProductCategoriesCategoryProductsBatchParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.addProducts(product_category_id, {\n product_ids: [\n {\n id: product_id\n }\n ]\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location \\\n--request POST 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n {\n \"id\": \"{product_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesCategoryRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteProductCategoriesCategoryProductsBatch", + "summary": "Delete Products", + "description": "Remove a list of products from a product category.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Category fields to be expanded in the response.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Category fields to be retrieved in the response.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq" + } + } + } + }, + "x-codegen": { + "method": "removeProducts", + "queryParams": "AdminDeleteProductCategoriesCategoryProductsBatchParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.removeProducts(product_category_id, {\n product_ids: [\n {\n id: product_id\n }\n ]\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n {\n \"id\": \"{product_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductCategoriesCategoryRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/product-tags": { + "get": { + "operationId": "GetProductTags", + "summary": "List Product Tags", + "description": "Retrieve a list of Product Tags.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of tags to return.", + "schema": { + "type": "integer", + "default": 10 + } + }, + { + "in": "query", + "name": "offset", + "description": "The number of items to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "order", + "description": "The field to sort items by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the tags.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "style": "form", + "explode": false, + "description": "The tag values to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "q", + "description": "A query string to search values for", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "The tag IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting product tags were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting product tags were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetProductTagsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productTags.list()\n.then(({ product_tags }) => {\n console.log(product_tags.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/product-tags' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Tags" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductTagsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/product-types": { + "get": { + "operationId": "GetProductTypes", + "summary": "List Product Types", + "description": "Retrieve a list of Product Types.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of types to return.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "offset", + "description": "The number of items to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "order", + "description": "The field to sort items by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the product types.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "style": "form", + "explode": false, + "description": "The type values to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "The type IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "q", + "description": "A query string to search values for", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting product types were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting product types were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetProductTypesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productTypes.list()\n.then(({ product_types }) => {\n console.log(product_types.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/product-types' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Types" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductTypesListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products": { + "get": { + "operationId": "GetProducts", + "summary": "List Products", + "description": "Retrieves a list of Product", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching product title and description, variant title and sku, and collection title.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the product.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "Filter by product IDs.", + "schema": { + "oneOf": [ + { + "type": "string", + "description": "ID of the product to search for." + }, + { + "type": "array", + "items": { + "type": "string", + "description": "ID of a product." + } + } + ] + } + }, + { + "in": "query", + "name": "status", + "style": "form", + "explode": false, + "description": "Status to search for", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "draft", + "proposed", + "published", + "rejected" + ] + } + } + }, + { + "in": "query", + "name": "collection_id", + "style": "form", + "explode": false, + "description": "Collection ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "tags", + "style": "form", + "explode": false, + "description": "Tag IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "price_list_id", + "style": "form", + "explode": false, + "description": "Price List IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "sales_channel_id", + "style": "form", + "explode": false, + "description": "Sales Channel IDs to filter products by", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "type_id", + "style": "form", + "explode": false, + "description": "Type IDs to filter products by", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "category_id", + "style": "form", + "explode": false, + "description": "Category IDs to filter products by", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "include_category_children", + "description": "Include category children when filtering by category_id", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "title", + "description": "title to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "description to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "handle to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_giftcard", + "description": "Search for giftcards using is_giftcard=true.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting products were deleted.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each product of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each product of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "the field used to order the products.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetProductsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.list()\n.then(({ products, limit, offset, count }) => {\n console.log(products.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/products' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostProducts", + "summary": "Create a Product", + "x-authenticated": true, + "description": "Creates a Product", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.create({\n title: 'Shirt',\n is_giftcard: false,\n discountable: true\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Shirt\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/tag-usage": { + "get": { + "operationId": "GetProductsTagUsage", + "summary": "List Tags Usage Number", + "description": "Retrieves a list of Product Tags with how many times each is used.", + "x-authenticated": true, + "x-codegen": { + "method": "listTags" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.listTags()\n.then(({ tags }) => {\n console.log(tags.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/products/tag-usage' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsListTagsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/types": { + "get": { + "deprecated": true, + "operationId": "GetProductsTypes", + "summary": "List Product Types", + "description": "Retrieves a list of Product Types.", + "x-authenticated": true, + "x-codegen": { + "method": "listTypes" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.listTypes()\n.then(({ types }) => {\n console.log(types.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/products/types' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsListTypesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/{id}": { + "get": { + "operationId": "GetProductsProduct", + "summary": "Get a Product", + "description": "Retrieves a Product.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.retrieve(product_id)\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/products/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostProductsProduct", + "summary": "Update a Product", + "description": "Updates a Product", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsProductReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.update(product_id, {\n title: 'Shirt',\n images: []\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Size\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteProductsProduct", + "summary": "Delete a Product", + "description": "Deletes a Product and it's associated Product Variants.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.delete(product_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/products/asfsaf' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/{id}/metadata": { + "post": { + "operationId": "PostProductsProductMetadata", + "summary": "Set Product Metadata", + "description": "Set metadata key/value pair for Product", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsProductMetadataReq" + } + } + } + }, + "x-codegen": { + "method": "setMetadata" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.setMetadata(product_id, {\nkey: 'test',\n value: 'true'\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products/{id}/metadata' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"key\": \"test\",\n \"value\": \"true\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/{id}/options": { + "post": { + "operationId": "PostProductsProductOptions", + "summary": "Add an Option", + "x-authenticated": true, + "description": "Adds a Product Option to a Product", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsProductOptionsReq" + } + } + } + }, + "x-codegen": { + "method": "addOption" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.addOption(product_id, {\n title: 'Size'\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Size\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/{id}/options/{option_id}": { + "post": { + "operationId": "PostProductsProductOptionsOption", + "summary": "Update a Product Option", + "description": "Updates a Product Option", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "option_id", + "required": true, + "description": "The ID of the Product Option.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsProductOptionsOption" + } + } + } + }, + "x-codegen": { + "method": "updateOption" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.updateOption(product_id, option_id, {\n title: 'Size'\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Size\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteProductsProductOptionsOption", + "summary": "Delete a Product Option", + "description": "Deletes a Product Option. Before a Product Option can be deleted all Option Values for the Product Option must be the same. You may, for example, have to delete some of your variants prior to deleting the Product Option", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "option_id", + "required": true, + "description": "The ID of the Product Option.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteOption" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.deleteOption(product_id, option_id)\n.then(({ option_id, object, delete, product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsDeleteOptionRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/{id}/variants": { + "get": { + "operationId": "GetProductsProductVariants", + "summary": "List a Product's Variants", + "description": "Retrieves a list of the Product Variants associated with a Product.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the product to search for the variants.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated string of the column to select.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated string of the relations to include.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many items to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of items returned.", + "schema": { + "type": "integer", + "default": 100 + } + } + ], + "x-codegen": { + "method": "listVariants", + "queryParams": "AdminGetProductsVariantsParams" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/products/{id}/variants' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsListVariantsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostProductsProductVariants", + "summary": "Create a Product Variant", + "description": "Creates a Product Variant. Each Product Variant must have a unique combination of Product Option Values.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsProductVariantsReq" + } + } + } + }, + "x-codegen": { + "method": "createVariant" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.createVariant(product_id, {\n title: 'Color',\n prices: [\n {\n amount: 1000,\n currency_code: \"eur\"\n }\n ],\n options: [\n {\n option_id,\n value: 'S'\n }\n ],\n inventory_quantity: 100\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products/{id}/variants' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Color\",\n \"prices\": [\n {\n \"amount\": 1000,\n \"currency_code\": \"eur\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"asdasf\",\n \"value\": \"S\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/products/{id}/variants/{variant_id}": { + "post": { + "operationId": "PostProductsProductVariantsVariant", + "summary": "Update a Product Variant", + "description": "Update a Product Variant.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "variant_id", + "required": true, + "description": "The ID of the Product Variant.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostProductsProductVariantsVariantReq" + } + } + } + }, + "x-codegen": { + "method": "updateVariant" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.updateVariant(product_id, variant_id, {\n title: 'Color',\n prices: [\n {\n amount: 1000,\n currency_code: \"eur\"\n }\n ],\n options: [\n {\n option_id,\n value: 'S'\n }\n ],\n inventory_quantity: 100\n})\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Color\",\n \"prices\": [\n {\n \"amount\": 1000,\n \"currency_code\": \"eur\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteProductsProductVariantsVariant", + "summary": "Delete a Product Variant", + "description": "Deletes a Product Variant.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "variant_id", + "required": true, + "description": "The ID of the Product Variant.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteVariant" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.products.deleteVariant(product_id, variant_id)\n.then(({ variant_id, object, deleted, product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminProductsDeleteVariantRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/publishable-api-key/{id}": { + "post": { + "operationId": "PostPublishableApiKysPublishableApiKey", + "summary": "Update PublishableApiKey", + "description": "Updates a PublishableApiKey.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PublishableApiKey.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.update(publishableApiKeyId, {\n title: \"new title\"\n})\n.then(({ publishable_api_key }) => {\n console.log(publishable_api_key.id)\n})\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"new title\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/publishable-api-keys": { + "get": { + "operationId": "GetPublishableApiKeys", + "summary": "List PublishableApiKeys", + "description": "List PublishableApiKeys.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching publishable api keys by title.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of items in the response", + "schema": { + "type": "number", + "default": "20" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of items in response", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "GetPublishableApiKeysParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.list()\n .then(({ publishable_api_keys, count, limit, offset }) => {\n console.log(publishable_api_keys)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostPublishableApiKeys", + "summary": "Create PublishableApiKey", + "description": "Creates a PublishableApiKey.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPublishableApiKeysReq" + } + } + } + }, + "x-authenticated": true, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.create({\n title\n})\n.then(({ publishable_api_key }) => {\n console.log(publishable_api_key.id)\n})\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Web API Key\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/publishable-api-keys/{id}": { + "get": { + "operationId": "GetPublishableApiKeysPublishableApiKey", + "summary": "Get a PublishableApiKey", + "description": "Retrieve the Publishable Api Key.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PublishableApiKey.", + "schema": { + "type": "string" + } + } + ], + "x-authenticated": true, + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.retrieve(publishableApiKeyId)\n.then(({ publishable_api_key }) => {\n console.log(publishable_api_key.id)\n})\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeletePublishableApiKeysPublishableApiKey", + "summary": "Delete PublishableApiKey", + "description": "Deletes a PublishableApiKeys", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PublishableApiKeys to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.delete(publishableApiKeyId)\n.then(({ id, object, deleted }) => {\n console.log(id)\n})\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeyDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + } + } + } + }, + "/admin/publishable-api-keys/{id}/revoke": { + "post": { + "operationId": "PostPublishableApiKeysPublishableApiKeyRevoke", + "summary": "Revoke PublishableApiKey", + "description": "Revokes a PublishableApiKey.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PublishableApiKey.", + "schema": { + "type": "string" + } + } + ], + "x-authenticated": true, + "x-codegen": { + "method": "revoke" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.revoke(publishableApiKeyId)\n .then(({ publishable_api_key }) => {\n console.log(publishable_api_key.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/publishable-api-keys/{id}/sales-channels": { + "get": { + "operationId": "GetPublishableApiKeySalesChannels", + "summary": "List SalesChannels", + "description": "List PublishableApiKey's SalesChannels", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Publishable Api Key.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "Query used for searching sales channels' names and descriptions.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "listSalesChannels", + "queryParams": "GetPublishableApiKeySalesChannelsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.listSalesChannels()\n .then(({ sales_channels }) => {\n console.log(sales_channels.length)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysListSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/publishable-api-keys/{id}/sales-channels/batch": { + "post": { + "operationId": "PostPublishableApiKeySalesChannelsChannelsBatch", + "summary": "Add SalesChannels", + "description": "Assign a batch of sales channels to a publishable api key.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Publishable Api Key.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq" + } + } + } + }, + "x-codegen": { + "method": "addSalesChannelsBatch" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, {\n sales_channel_ids: [\n {\n id: channel_id\n }\n ]\n})\n.then(({ publishable_api_key }) => {\n console.log(publishable_api_key.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"sales_channel_ids\": [\n {\n \"id\": \"{sales_channel_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeletePublishableApiKeySalesChannelsChannelsBatch", + "summary": "Delete SalesChannels", + "description": "Remove a batch of sales channels from a publishable api key.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Publishable Api Key.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq" + } + } + } + }, + "x-codegen": { + "method": "deleteSalesChannelsBatch" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, {\n sales_channel_ids: [\n {\n id: channel_id\n }\n ]\n})\n.then(({ publishable_api_key }) => {\n console.log(publishable_api_key.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"sales_channel_ids\": [\n {\n \"id\": \"{sales_channel_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Publishable Api Keys" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPublishableApiKeysRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions": { + "get": { + "operationId": "GetRegions", + "summary": "List Regions", + "description": "Retrieves a list of Regions.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 50 + }, + "required": false, + "description": "limit the number of regions in response" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "default": 0 + }, + "required": false, + "description": "Offset of regions in response (used for pagination)" + }, + { + "in": "query", + "name": "created_at", + "schema": { + "type": "object" + }, + "required": false, + "description": "Date comparison for when resulting region was created, i.e. less than, greater than etc." + }, + { + "in": "query", + "name": "updated_at", + "schema": { + "type": "object" + }, + "required": false, + "description": "Date comparison for when resulting region was updated, i.e. less than, greater than etc." + }, + { + "in": "query", + "name": "deleted_at", + "schema": { + "type": "object" + }, + "required": false, + "description": "Date comparison for when resulting region was deleted, i.e. less than, greater than etc." + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetRegionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.list()\n.then(({ regions, limit, offset, count }) => {\n console.log(regions.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/regions' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostRegions", + "summary": "Create a Region", + "description": "Creates a Region", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostRegionsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.create({\n name: 'Europe',\n currency_code: 'eur',\n tax_rate: 0,\n payment_providers: [\n 'manual'\n ],\n fulfillment_providers: [\n 'manual'\n ],\n countries: [\n 'DK'\n ]\n})\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/regions' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Europe\",\n \"currency_code\": \"eur\",\n \"tax_rate\": 0,\n \"payment_providers\": [\n \"manual\"\n ],\n \"fulfillment_providers\": [\n \"manual\"\n ],\n \"countries\": [\n \"DK\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}": { + "get": { + "operationId": "GetRegionsRegion", + "summary": "Get a Region", + "description": "Retrieves a Region.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.retrieve(region_id)\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/regions/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostRegionsRegion", + "summary": "Update a Region", + "description": "Updates a Region", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostRegionsRegionReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.update(region_id, {\n name: 'Europe'\n})\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/regions/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Europe\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteRegionsRegion", + "summary": "Delete a Region", + "description": "Deletes a Region.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.delete(region_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/countries": { + "post": { + "operationId": "PostRegionsRegionCountries", + "summary": "Add Country", + "description": "Adds a Country to the list of Countries in a Region", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostRegionsRegionCountriesReq" + } + } + } + }, + "x-codegen": { + "method": "addCountry" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.addCountry(region_id, {\n country_code: 'dk'\n})\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/regions/{region_id}/countries' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"country_code\": \"dk\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/countries/{country_code}": { + "delete": { + "operationId": "PostRegionsRegionCountriesCountry", + "summary": "Delete Country", + "x-authenticated": true, + "description": "Removes a Country from the list of Countries in a Region", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "country_code", + "description": "The 2 character ISO code for the Country.", + "required": true, + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + } + ], + "x-codegen": { + "method": "deleteCountry" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.deleteCountry(region_id, 'dk')\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/countries/dk' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/fulfillment-options": { + "get": { + "operationId": "GetRegionsRegionFulfillmentOptions", + "summary": "List Fulfillment Options", + "description": "Gathers all the fulfillment options available to in the Region.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieveFulfillmentOptions" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.retrieveFulfillmentOptions(region_id)\n.then(({ fulfillment_options }) => {\n console.log(fulfillment_options.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/fulfillment-providers": { + "post": { + "operationId": "PostRegionsRegionFulfillmentProviders", + "summary": "Add Fulfillment Provider", + "description": "Adds a Fulfillment Provider to a Region", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq" + } + } + } + }, + "x-codegen": { + "method": "addFulfillmentProvider" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.addFulfillmentProvider(region_id, {\n provider_id: 'manual'\n})\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"provider_id\": \"manual\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/fulfillment-providers/{provider_id}": { + "delete": { + "operationId": "PostRegionsRegionFulfillmentProvidersProvider", + "summary": "Del. Fulfillment Provider", + "description": "Removes a Fulfillment Provider.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "provider_id", + "required": true, + "description": "The ID of the Fulfillment Provider.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteFulfillmentProvider" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual')\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/payment-providers": { + "post": { + "operationId": "PostRegionsRegionPaymentProviders", + "summary": "Add Payment Provider", + "description": "Adds a Payment Provider to a Region", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq" + } + } + } + }, + "x-codegen": { + "method": "addPaymentProvider" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.addPaymentProvider(region_id, {\n provider_id: 'manual'\n})\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/payment-providers' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"provider_id\": \"manual\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/regions/{id}/payment-providers/{provider_id}": { + "delete": { + "operationId": "PostRegionsRegionPaymentProvidersProvider", + "summary": "Delete Payment Provider", + "description": "Removes a Payment Provider.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Region.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "provider_id", + "required": true, + "description": "The ID of the Payment Provider.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deletePaymentProvider" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.regions.deletePaymentProvider(region_id, 'manual')\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/reservations": { + "get": { + "operationId": "GetReservations", + "summary": "List Reservations", + "description": "Retrieve a list of Reservations.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "location_id", + "style": "form", + "explode": false, + "description": "Location ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "inventory_item_id", + "style": "form", + "explode": false, + "description": "Inventory Item ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "line_item_id", + "style": "form", + "explode": false, + "description": "Line Item ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "quantity", + "description": "Filter by reservation quantity", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "number", + "description": "filter by reservation quantity less than this number" + }, + "gt": { + "type": "number", + "description": "filter by reservation quantity greater than this number" + }, + "lte": { + "type": "number", + "description": "filter by reservation quantity less than or equal to this number" + }, + "gte": { + "type": "number", + "description": "filter by reservation quantity greater than or equal to this number" + } + } + } + }, + { + "in": "query", + "name": "offset", + "description": "How many Reservations to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of Reservations returned.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the product category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the product category.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetReservationsParams" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/product-categories' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Reservations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReservationsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostReservations", + "summary": "Creates a Reservation", + "description": "Creates a Reservation which can be associated with any resource as required.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostReservationsReq" + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.create({\n})\n.then(({ reservations }) => {\n console.log(reservations.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/reservations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"resource_id\": \"{resource_id}\",\n \"resource_type\": \"order\",\n \"value\": \"We delivered this order\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Reservations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReservationsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/reservations/{id}": { + "get": { + "operationId": "GetReservationsReservation", + "summary": "Get a Reservation", + "description": "Retrieves a single reservation using its id", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the reservation to retrieve.", + "schema": { + "type": "string" + } + } + ], + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.retrieve(reservation_id)\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Reservations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReservationsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostReservationsReservation", + "summary": "Updates a Reservation", + "description": "Updates a Reservation which can be associated with any resource as required.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Reservation to update.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostReservationsReservationReq" + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.update(reservation.id, {\n quantity: 3\n})\n.then(({ reservations }) => {\n console.log(reservations.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/reservations/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"quantity\": 3,\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Reservations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReservationsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteReservationsReservation", + "summary": "Delete a Reservation", + "description": "Deletes a Reservation.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Reservation to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.delete(reservation.id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Reservations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReservationsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/return-reasons": { + "get": { + "operationId": "GetReturnReasons", + "summary": "List Return Reasons", + "description": "Retrieves a list of Return Reasons.", + "x-authenticated": true, + "x-codegen": { + "method": "list" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returnReasons.list()\n.then(({ return_reasons }) => {\n console.log(return_reasons.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/return-reasons' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnReasonsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostReturnReasons", + "summary": "Create a Return Reason", + "description": "Creates a Return Reason", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostReturnReasonsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returnReasons.create({\n label: 'Damaged',\n value: 'damaged'\n})\n.then(({ return_reason }) => {\n console.log(return_reason.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/return-reasons' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"label\": \"Damaged\",\n \"value\": \"damaged\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnReasonsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/return-reasons/{id}": { + "get": { + "operationId": "GetReturnReasonsReason", + "summary": "Get a Return Reason", + "description": "Retrieves a Return Reason.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Return Reason.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returnReasons.retrieve(return_reason_id)\n.then(({ return_reason }) => {\n console.log(return_reason.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/return-reasons/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnReasonsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostReturnReasonsReason", + "summary": "Update a Return Reason", + "description": "Updates a Return Reason", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Return Reason.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostReturnReasonsReasonReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returnReasons.update(return_reason_id, {\n label: 'Damaged'\n})\n.then(({ return_reason }) => {\n console.log(return_reason.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/return-reasons/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"label\": \"Damaged\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnReasonsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteReturnReason", + "summary": "Delete a Return Reason", + "description": "Deletes a return reason.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the return reason", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returnReasons.delete(return_reason_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/return-reasons/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnReasonsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/returns": { + "get": { + "operationId": "GetReturns", + "summary": "List Returns", + "description": "Retrieves a list of Returns", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The upper limit for the amount of responses returned.", + "schema": { + "type": "number", + "default": "50" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of the list returned.", + "schema": { + "type": "number", + "default": "0" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetReturnsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returns.list()\n.then(({ returns, limit, offset, count }) => {\n console.log(returns.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/returns' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Returns" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/returns/{id}/cancel": { + "post": { + "operationId": "PostReturnsReturnCancel", + "summary": "Cancel a Return", + "description": "Registers a Return as canceled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Return.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "cancel" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returns.cancel(return_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/cancel' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Returns" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnsCancelRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/returns/{id}/receive": { + "post": { + "operationId": "PostReturnsReturnReceive", + "summary": "Receive a Return", + "description": "Registers a Return as received. Updates statuses on Orders and Swaps accordingly.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Return.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostReturnsReturnReceiveReq" + } + } + } + }, + "x-codegen": { + "method": "receive" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.returns.receive(return_id, {\n items: [\n {\n item_id,\n quantity: 1\n }\n ]\n})\n.then((data) => {\n console.log(data.return.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/receive' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"items\": [\n {\n \"item_id\": \"asafg\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Returns" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminReturnsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/sales-channels": { + "get": { + "operationId": "GetSalesChannels", + "summary": "List Sales Channels", + "description": "Retrieves a list of sales channels", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "id", + "description": "ID of the sales channel", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "name", + "description": "Name of the sales channel", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "Description of the sales channel", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "q", + "description": "Query used for searching sales channels' names and descriptions.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "The field to order the results by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting collections were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting collections were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting collections were deleted.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "offset", + "description": "How many sales channels to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of sales channels returned.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each sales channel of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each sales channel of the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetSalesChannelsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.list()\n.then(({ sales_channels, limit, offset, count }) => {\n console.log(sales_channels.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/sales-channels' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostSalesChannels", + "summary": "Create a Sales Channel", + "description": "Creates a Sales Channel.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostSalesChannelsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.create({\n name: 'App',\n description: 'Mobile app'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/sales-channels' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"App\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/sales-channels/{id}": { + "get": { + "operationId": "GetSalesChannelsSalesChannel", + "summary": "Get a Sales Channel", + "description": "Retrieves the sales channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales channel.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.retrieve(sales_channel_id)\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/sales-channels/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostSalesChannelsSalesChannel", + "summary": "Update a Sales Channel", + "description": "Updates a Sales Channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales Channel.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostSalesChannelsSalesChannelReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.update(sales_channel_id, {\n name: 'App'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"App\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteSalesChannelsSalesChannel", + "summary": "Delete a Sales Channel", + "description": "Deletes the sales channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales channel.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.delete(sales_channel_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/sales-channels/{id}/products/batch": { + "post": { + "operationId": "PostSalesChannelsChannelProductsBatch", + "summary": "Add Products", + "description": "Assign a batch of product to a sales channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales channel.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq" + } + } + } + }, + "x-codegen": { + "method": "addProducts" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.addProducts(sales_channel_id, {\n product_ids: [\n {\n id: product_id\n }\n ]\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n {\n \"id\": \"{product_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteSalesChannelsChannelProductsBatch", + "summary": "Delete Products", + "description": "Remove a list of products from a sales channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales Channel", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq" + } + } + } + }, + "x-codegen": { + "method": "removeProducts" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.removeProducts(sales_channel_id, {\n product_ids: [\n {\n id: product_id\n }\n ]\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n {\n \"id\": \"{product_id}\"\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/sales-channels/{id}/stock-locations": { + "post": { + "operationId": "PostSalesChannelsSalesChannelStockLocation", + "summary": "Associate a stock location to a Sales Channel", + "description": "Associates a stock location to a Sales Channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales Channel.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq" + } + } + } + }, + "x-codegen": { + "method": "addLocation" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.addLocation(sales_channel_id, {\n location_id: 'App'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"locaton_id\": \"stock_location_id\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteSalesChannelsSalesChannelStockLocation", + "summary": "Remove a stock location from a Sales Channel", + "description": "Removes a stock location from a Sales Channel.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Sales Channel.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq" + } + } + } + }, + "x-codegen": { + "method": "removeLocation" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.removeLocation(sales_channel_id, {\n location_id: 'App'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"locaton_id\": \"stock_location_id\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Sales Channels" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSalesChannelsDeleteLocationRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/shipping-options": { + "get": { + "operationId": "GetShippingOptions", + "summary": "List Shipping Options", + "description": "Retrieves a list of Shipping Options.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "region_id", + "schema": { + "type": "string" + }, + "description": "Region ID to fetch options from" + }, + { + "in": "query", + "name": "is_return", + "schema": { + "type": "boolean" + }, + "description": "Flag for fetching return options only" + }, + { + "in": "query", + "name": "admin_only", + "schema": { + "type": "boolean" + }, + "description": "Flag for fetching admin specific options" + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetShippingOptionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingOptions.list()\n.then(({ shipping_options, count }) => {\n console.log(shipping_options.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/shipping-options' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingOptionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostShippingOptions", + "summary": "Create Shipping Option", + "description": "Creates a Shipping Option", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostShippingOptionsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingOptions.create({\n name: 'PostFake',\n region_id: \"saasf\",\n provider_id: \"manual\",\n data: {\n },\n price_type: 'flat_rate'\n})\n.then(({ shipping_option }) => {\n console.log(shipping_option.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/shipping-options' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"PostFake\",\n \"region_id\": \"afasf\",\n \"provider_id\": \"manual\",\n \"data\": {},\n \"price_type\": \"flat_rate\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingOptionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/shipping-options/{id}": { + "get": { + "operationId": "GetShippingOptionsOption", + "summary": "Get a Shipping Option", + "description": "Retrieves a Shipping Option.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Option.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingOptions.retrieve(option_id)\n.then(({ shipping_option }) => {\n console.log(shipping_option.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/shipping-options/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingOptionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostShippingOptionsOption", + "summary": "Update Shipping Option", + "description": "Updates a Shipping Option", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Option.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostShippingOptionsOptionReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingOptions.update(option_id, {\n name: 'PostFake',\n requirements: [\n {\n id,\n type: 'max_subtotal',\n amount: 1000\n }\n ]\n})\n.then(({ shipping_option }) => {\n console.log(shipping_option.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/shipping-options/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"requirements\": [\n {\n \"type\": \"max_subtotal\",\n \"amount\": 1000\n }\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingOptionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteShippingOptionsOption", + "summary": "Delete a Shipping Option", + "description": "Deletes a Shipping Option.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Option.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingOptions.delete(option_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/shipping-options/{option_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingOptionsDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/shipping-profiles": { + "get": { + "operationId": "GetShippingProfiles", + "summary": "List Shipping Profiles", + "description": "Retrieves a list of Shipping Profile.", + "x-authenticated": true, + "x-codegen": { + "method": "list" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingProfiles.list()\n.then(({ shipping_profiles }) => {\n console.log(shipping_profiles.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Profiles" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingProfilesListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostShippingProfiles", + "summary": "Create a Shipping Profile", + "description": "Creates a Shipping Profile", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostShippingProfilesReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingProfiles.create({\n name: 'Large Products'\n})\n.then(({ shipping_profile }) => {\n console.log(shipping_profile.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Large Products\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Profiles" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingProfilesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/shipping-profiles/{id}": { + "get": { + "operationId": "GetShippingProfilesProfile", + "summary": "Get a Shipping Profile", + "description": "Retrieves a Shipping Profile.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Profile.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingProfiles.retrieve(profile_id)\n.then(({ shipping_profile }) => {\n console.log(shipping_profile.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Profiles" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingProfilesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostShippingProfilesProfile", + "summary": "Update a Shipping Profile", + "description": "Updates a Shipping Profile", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Profile.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostShippingProfilesProfileReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingProfiles.update(shipping_profile_id, {\n name: 'Large Products'\n})\n.then(({ shipping_profile }) => {\n console.log(shipping_profile.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles/{id} \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Large Products\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Profiles" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminShippingProfilesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteShippingProfilesProfile", + "summary": "Delete a Shipping Profile", + "description": "Deletes a Shipping Profile.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Profile.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.shippingProfiles.delete(profile_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/shipping-profiles/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Shipping Profiles" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteShippingProfileRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/stock-locations": { + "get": { + "operationId": "GetStockLocations", + "summary": "List Stock Locations", + "description": "Retrieves a list of stock locations", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "id", + "description": "ID of the stock location", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "name", + "description": "Name of the stock location", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "The field to order the results by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting collections were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting collections were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting collections were deleted.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "offset", + "description": "How many stock locations to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of stock locations returned.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each stock location of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each stock location of the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetStockLocationsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.list()\n.then(({ stock_locations, limit, offset, count }) => {\n console.log(stock_locations.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/stock-locations' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Stock Locations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStockLocationsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostStockLocations", + "summary": "Create a Stock Location", + "description": "Creates a Stock Location.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostStockLocationsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.create({\n name: 'Main Warehouse',\n location_id: 'sloc'\n})\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"App\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Stock Locations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStockLocationsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/stock-locations/{id}": { + "get": { + "operationId": "GetStockLocationsStockLocation", + "summary": "Get a Stock Location", + "description": "Retrieves the Stock Location.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Stock Location.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetStockLocationsLocationParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.retrieve(stock_location_id)\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/stock-locations/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Stock Locations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStockLocationsRes" + } + } + } + } + } + }, + "post": { + "operationId": "PostStockLocationsStockLocation", + "summary": "Update a Stock Location", + "description": "Updates a Stock Location.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Stock Location.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostStockLocationsLocationReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.update(stock_location_id, {\n name: 'App'\n})\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"App\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Stock Locations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStockLocationsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteStockLocationsStockLocation", + "summary": "Delete a Stock Location", + "description": "Delete a Stock Location", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Stock Location to delete.", + "schema": { + "type": "string" + } + } + ], + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.delete(stock_location_id)\n .then(({ id, object, deleted }) => {\n console.log(id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Stock Locations" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Stock Location." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "format": "stock_location" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Stock Location was deleted.", + "default": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + } + } + } + }, + "/admin/store": { + "get": { + "operationId": "GetStore", + "summary": "Get Store details", + "description": "Retrieves the Store details", + "x-authenticated": true, + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.store.retrieve()\n.then(({ store }) => {\n console.log(store.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/store' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminExtendedStoresRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostStore", + "summary": "Update Store Details", + "description": "Updates the Store details", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostStoreReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.store.update({\n name: 'Medusa Store'\n})\n.then(({ store }) => {\n console.log(store.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/store' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Medusa Store\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStoresRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/store/currencies/{code}": { + "post": { + "operationId": "PostStoreCurrenciesCode", + "summary": "Add a Currency Code", + "description": "Adds a Currency Code to the available currencies.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The 3 character ISO currency code.", + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + } + ], + "x-codegen": { + "method": "addCurrency" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.store.addCurrency('eur')\n.then(({ store }) => {\n console.log(store.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/store/currencies/eur' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStoresRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteStoreCurrenciesCode", + "summary": "Delete a Currency Code", + "description": "Removes a Currency Code from the available currencies.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The 3 character ISO currency code.", + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + } + ], + "x-codegen": { + "method": "deleteCurrency" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.store.deleteCurrency('eur')\n.then(({ store }) => {\n console.log(store.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/store/currencies/eur' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminStoresRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/store/payment-providers": { + "get": { + "operationId": "GetStorePaymentProviders", + "summary": "List Payment Providers", + "description": "Retrieves the configured Payment Providers", + "x-authenticated": true, + "x-codegen": { + "method": "listPaymentProviders" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.store.listPaymentProviders()\n.then(({ payment_providers }) => {\n console.log(payment_providers.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/store/payment-providers' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPaymentProvidersList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/store/tax-providers": { + "get": { + "operationId": "GetStoreTaxProviders", + "summary": "List Tax Providers", + "description": "Retrieves the configured Tax Providers", + "x-authenticated": true, + "x-codegen": { + "method": "listTaxProviders" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.store.listTaxProviders()\n.then(({ tax_providers }) => {\n console.log(tax_providers.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/store/tax-providers' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxProvidersList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/swaps": { + "get": { + "operationId": "GetSwaps", + "summary": "List Swaps", + "description": "Retrieves a list of Swaps.", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The upper limit for the amount of responses returned.", + "schema": { + "type": "number", + "default": "50" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of the list returned.", + "schema": { + "type": "number", + "default": "0" + } + } + ], + "x-authenticated": true, + "x-codegen": { + "method": "list", + "queryParams": "AdminGetSwapsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.swaps.list()\n.then(({ swaps }) => {\n console.log(swaps.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/swaps' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Swaps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSwapsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/swaps/{id}": { + "get": { + "operationId": "GetSwapsSwap", + "summary": "Get a Swap", + "description": "Retrieves a Swap.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Swap.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.swaps.retrieve(swap_id)\n.then(({ swap }) => {\n console.log(swap.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/swaps/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Swaps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminSwapsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/tax-rates": { + "get": { + "operationId": "GetTaxRates", + "summary": "List Tax Rates", + "description": "Retrieves a list of TaxRates", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "name", + "description": "Name of tax rate to retrieve", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "style": "form", + "explode": false, + "description": "Filter by Region ID", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + { + "in": "query", + "name": "code", + "description": "code to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "rate", + "style": "form", + "explode": false, + "description": "Filter by Rate", + "schema": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "object", + "properties": { + "lt": { + "type": "number", + "description": "filter by rates less than this number" + }, + "gt": { + "type": "number", + "description": "filter by rates greater than this number" + }, + "lte": { + "type": "number", + "description": "filter by rates less than or equal to this number" + }, + "gte": { + "type": "number", + "description": "filter by rates greater than or equal to this number" + } + } + } + ] + } + }, + { + "in": "query", + "name": "offset", + "description": "How many tax rates to skip before retrieving the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of tax rates returned.", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in each item.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved for each item.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetTaxRatesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.list()\n.then(({ tax_rates, limit, offset, count }) => {\n console.log(tax_rates.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/tax-rates' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostTaxRates", + "summary": "Create a Tax Rate", + "description": "Creates a Tax Rate", + "parameters": [ + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostTaxRatesReq" + } + } + } + }, + "x-codegen": { + "method": "create", + "queryParams": "AdminPostTaxRatesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.create({\n code: 'TEST',\n name: 'New Tax Rate',\n region_id\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/tax-rates' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"code\": \"TEST\",\n \"name\": \"New Tax Rate\",\n \"region_id\": \"{region_id}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/tax-rates/{id}": { + "get": { + "operationId": "GetTaxRatesTaxRate", + "summary": "Get a Tax Rate", + "description": "Retrieves a TaxRate", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetTaxRatesTaxRateParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.retrieve(tax_rate_id)\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/tax-rates/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostTaxRatesTaxRate", + "summary": "Update a Tax Rate", + "description": "Updates a Tax Rate", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostTaxRatesTaxRateReq" + } + } + } + }, + "x-codegen": { + "method": "update", + "queryParams": "AdminPostTaxRatesTaxRateParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.update(tax_rate_id, {\n name: 'New Tax Rate'\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"New Tax Rate\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRate", + "summary": "Delete a Tax Rate", + "description": "Deletes a Tax Rate", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Shipping Option.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.delete(tax_rate_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesDeleteRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/tax-rates/{id}/product-types/batch": { + "post": { + "operationId": "PostTaxRatesTaxRateProductTypes", + "summary": "Add to Product Types", + "description": "Associates a Tax Rate with a list of Product Types", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq" + } + } + } + }, + "x-codegen": { + "method": "addProductTypes", + "queryParams": "AdminPostTaxRatesTaxRateProductTypesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.addProductTypes(tax_rate_id, {\n product_types: [\n product_type_id\n ]\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_types\": [\n \"{product_type_id}\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRateProductTypes", + "summary": "Delete from Product Types", + "description": "Removes a Tax Rate from a list of Product Types", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq" + } + } + } + }, + "x-codegen": { + "method": "removeProductTypes", + "queryParams": "AdminDeleteTaxRatesTaxRateProductTypesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.removeProductTypes(tax_rate_id, {\n product_types: [\n product_type_id\n ]\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_types\": [\n \"{product_type_id}\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/tax-rates/{id}/products/batch": { + "post": { + "operationId": "PostTaxRatesTaxRateProducts", + "summary": "Add to Products", + "description": "Associates a Tax Rate with a list of Products", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostTaxRatesTaxRateProductsReq" + } + } + } + }, + "x-codegen": { + "method": "addProducts", + "queryParams": "AdminPostTaxRatesTaxRateProductsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.addProducts(tax_rate_id, {\n products: [\n product_id\n ]\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"products\": [\n \"{product_id}\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRateProducts", + "summary": "Delete from Products", + "description": "Removes a Tax Rate from a list of Products", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq" + } + } + } + }, + "x-codegen": { + "method": "removeProducts", + "queryParams": "AdminDeleteTaxRatesTaxRateProductsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.removeProducts(tax_rate_id, {\n products: [\n product_id\n ]\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"products\": [\n \"{product_id}\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/tax-rates/{id}/shipping-options/batch": { + "post": { + "operationId": "PostTaxRatesTaxRateShippingOptions", + "summary": "Add to Shipping Options", + "description": "Associates a Tax Rate with a list of Shipping Options", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq" + } + } + } + }, + "x-codegen": { + "method": "addShippingOptions", + "queryParams": "AdminPostTaxRatesTaxRateShippingOptionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.addShippingOptions(tax_rate_id, {\n shipping_options: [\n shipping_option_id\n ]\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"shipping_options\": [\n \"{shipping_option_id}\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRateShippingOptions", + "summary": "Del. for Shipping Options", + "description": "Removes a Tax Rate from a list of Shipping Options", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "ID of the tax rate.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Which fields should be included in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "expand", + "description": "Which fields should be expanded and retrieved in the result.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq" + } + } + } + }, + "x-codegen": { + "method": "removeShippingOptions", + "queryParams": "AdminDeleteTaxRatesTaxRateShippingOptionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.taxRates.removeShippingOptions(tax_rate_id, {\n shipping_options: [\n shipping_option_id\n ]\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"shipping_options\": [\n \"{shipping_option_id}\"\n ]\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminTaxRatesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/uploads": { + "post": { + "operationId": "PostUploads", + "summary": "Upload files", + "description": "Uploads at least one file to the specific fileservice that is installed in Medusa.", + "x-authenticated": true, + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "files": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.uploads.create(file)\n.then(({ uploads }) => {\n console.log(uploads.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/uploads' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: image/jpeg' \\\n--form 'files=@\"\"' \\\n--form 'files=@\"\"'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Uploads" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUploadsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteUploads", + "summary": "Delete an Uploaded File", + "description": "Removes an uploaded file using the installed fileservice", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteUploadsReq" + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.uploads.delete({\n file_key\n})\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"file_key\": \"{file_key}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Uploads" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteUploadsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/uploads/download-url": { + "post": { + "operationId": "PostUploadsDownloadUrl", + "summary": "Get a File's Download URL", + "description": "Creates a presigned download url for a file", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminPostUploadsDownloadUrlReq" + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.uploads.getPresignedDownloadUrl({\n file_key\n})\n.then(({ download_url }) => {\n console.log(download_url);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"file_key\": \"{file_key}\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Uploads" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUploadsDownloadUrlRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/uploads/protected": { + "post": { + "operationId": "PostUploadsProtected", + "summary": "Protected File Upload", + "description": "Uploads at least one file with ACL or a non-public bucket to the specific fileservice that is installed in Medusa.", + "x-authenticated": true, + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "files": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.uploads.createProtected(file)\n.then(({ uploads }) => {\n console.log(uploads.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/uploads/protected' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: image/jpeg' \\\n--form 'files=@\"\"' \\\n--form 'files=@\"\"'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Uploads" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUploadsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/users": { + "get": { + "operationId": "GetUsers", + "summary": "List Users", + "description": "Retrieves all users.", + "x-authenticated": true, + "x-codegen": { + "method": "list" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.list()\n.then(({ users }) => {\n console.log(users.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/users' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUsersListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostUsers", + "summary": "Create a User", + "description": "Creates a User", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminCreateUserRequest" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.create({\n email: 'user@example.com',\n password: 'supersecret'\n})\n.then(({ user }) => {\n console.log(user.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/users' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUserRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/users/password-token": { + "post": { + "operationId": "PostUsersUserPasswordToken", + "summary": "Request Password Reset", + "description": "Generates a password token for a User with a given email.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminResetPasswordTokenRequest" + } + } + } + }, + "x-codegen": { + "method": "sendResetPasswordToken" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.sendResetPasswordToken({\n email: 'user@example.com'\n})\n.then(() => {\n // successful\n})\n.catch(() => {\n // error occurred\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/users/password-token' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "204": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/users/reset-password": { + "post": { + "operationId": "PostUsersUserPassword", + "summary": "Reset Password", + "description": "Sets the password for a User given the correct token.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminResetPasswordRequest" + } + } + } + }, + "x-codegen": { + "method": "resetPassword" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.resetPassword({\n token: 'supersecrettoken',\n password: 'supersecret'\n})\n.then(({ user }) => {\n console.log(user.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/users/reset-password' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"token\": \"supersecrettoken\",\n \"password\": \"supersecret\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUserRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/users/{id}": { + "get": { + "operationId": "GetUsersUser", + "summary": "Get a User", + "description": "Retrieves a User.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the User.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.retrieve(user_id)\n.then(({ user }) => {\n console.log(user.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/users/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUserRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostUsersUser", + "summary": "Update a User", + "description": "Updates a User", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the User.", + "schema": { + "type": "string" + } + } + ], + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUpdateUserRequest" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.update(user_id, {\n first_name: 'Marcellus'\n})\n.then(({ user }) => {\n console.log(user.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/admin/users/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"first_name\": \"Marcellus\"\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminUserRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteUsersUser", + "summary": "Delete a User", + "description": "Deletes a User", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the User.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "delete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.users.delete(user_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/users/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminDeleteUserRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/variants": { + "get": { + "operationId": "GetVariants", + "summary": "List Product Variants", + "description": "Retrieves a list of Product Variants", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "id", + "description": "A Product Variant id to filter by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "ids", + "description": "A comma separated list of Product Variant ids to filter by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "A comma separated list of Product Variant relations to load.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "A comma separated list of Product Variant fields to include.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many product variants to skip in the result.", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "limit", + "description": "Maximum number of Product Variants to return.", + "schema": { + "type": "number", + "default": "100" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "The id of the cart to use for price selection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "The id of the region to use for price selection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "currency_code", + "description": "The currency code to use for price selection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "customer_id", + "description": "The id of the customer to use for price selection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "title", + "style": "form", + "explode": false, + "description": "product variant title to search for.", + "schema": { + "oneOf": [ + { + "type": "string", + "description": "a single title to search by" + }, + { + "type": "array", + "description": "multiple titles to search by", + "items": { + "type": "string" + } + } + ] + } + }, + { + "in": "query", + "name": "inventory_quantity", + "description": "Filter by available inventory quantity", + "schema": { + "oneOf": [ + { + "type": "number", + "description": "a specific number to search by." + }, + { + "type": "object", + "description": "search using less and greater than comparisons.", + "properties": { + "lt": { + "type": "number", + "description": "filter by inventory quantity less than this number" + }, + "gt": { + "type": "number", + "description": "filter by inventory quantity greater than this number" + }, + "lte": { + "type": "number", + "description": "filter by inventory quantity less than or equal to this number" + }, + "gte": { + "type": "number", + "description": "filter by inventory quantity greater than or equal to this number" + } + } + } + ] + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "AdminGetVariantsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.variants.list()\n.then(({ variants, limit, offset, count }) => {\n console.log(variants.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/variants' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Variants" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminVariantsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/variants/{id}": { + "get": { + "operationId": "GetVariantsVariant", + "summary": "Get a Product variant", + "description": "Retrieves a Product variant.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the variant.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded the order of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included the order of the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "AdminGetVariantParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.variants.retrieve(product_id)\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/variants/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdminVariantsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/admin/variants/{id}/inventory": { + "get": { + "operationId": "GetVariantsVariantInventory", + "summary": "Get inventory of Variant.", + "description": "Returns the available inventory of a Variant.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Product Variant id to get inventory for.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "getInventory" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.variants.list()\n .then(({ variants, limit, offset, count }) => {\n console.log(variants.length)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/admin/variants' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Variants" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "variant": { + "type": "object", + "$ref": "#/components/schemas/AdminGetVariantsVariantInventoryRes" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + } + }, + "components": { + "responses": { + "default_error": { + "description": "Default Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": "unknown_error", + "message": "An unknown error occurred.", + "type": "unknown_error" + } + } + } + }, + "invalid_state_error": { + "description": "Invalid State Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": "unknown_error", + "message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.", + "type": "QueryRunnerAlreadyReleasedError" + } + } + } + }, + "invalid_request_error": { + "description": "Invalid Request Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": "invalid_request_error", + "message": "Discount with code TEST already exists.", + "type": "duplicate_error" + } + } + } + }, + "not_found_error": { + "description": "Not Found Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "Entity with id 1 was not found", + "type": "not_found" + } + } + } + }, + "400_error": { + "description": "Client Error or Multiple Errors", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error" + }, + { + "$ref": "#/components/schemas/MultipleErrors" + } + ] + }, + "examples": { + "not_allowed": { + "$ref": "#/components/examples/not_allowed_error" + }, + "invalid_data": { + "$ref": "#/components/examples/invalid_data_error" + }, + "MultipleErrors": { + "$ref": "#/components/examples/multiple_errors" + } + } + } + } + }, + "500_error": { + "description": "Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "database": { + "$ref": "#/components/examples/database_error" + }, + "unexpected_state": { + "$ref": "#/components/examples/unexpected_state_error" + }, + "invalid_argument": { + "$ref": "#/components/examples/invalid_argument_error" + }, + "default_error": { + "$ref": "#/components/examples/default_error" + } + } + } + } + }, + "unauthorized": { + "description": "User is not authorized. Must log in first", + "content": { + "text/plain": { + "schema": { + "type": "string", + "default": "Unauthorized", + "example": "Unauthorized" + } + } + } + }, + "incorrect_credentials": { + "description": "User does not exist or incorrect credentials", + "content": { + "text/plain": { + "schema": { + "type": "string", + "default": "Unauthorized", + "example": "Unauthorized" + } + } + } + } + }, + "examples": { + "not_allowed_error": { + "summary": "Not Allowed Error", + "value": { + "message": "Discount must be set to dynamic", + "type": "not_allowed" + } + }, + "invalid_data_error": { + "summary": "Invalid Data Error", + "value": { + "message": "first_name must be a string", + "type": "invalid_data" + } + }, + "multiple_errors": { + "summary": "Multiple Errors", + "value": { + "message": "Provided request body contains errors. Please check the data and retry the request", + "errors": [ + { + "message": "first_name must be a string", + "type": "invalid_data" + }, + { + "message": "Discount must be set to dynamic", + "type": "not_allowed" + } + ] + } + }, + "database_error": { + "summary": "Database Error", + "value": { + "code": "api_error", + "message": "An error occured while hashing password", + "type": "database_error" + } + }, + "unexpected_state_error": { + "summary": "Unexpected State Error", + "value": { + "message": "cart.total must be defined", + "type": "unexpected_state" + } + }, + "invalid_argument_error": { + "summary": "Invalid Argument Error", + "value": { + "message": "cart.total must be defined", + "type": "unexpected_state" + } + }, + "default_error": { + "summary": "Default Error", + "value": { + "code": "unknown_error", + "message": "An unknown error occurred.", + "type": "unknown_error" + } + } + }, + "securitySchemes": { + "api_token": { + "type": "http", + "x-displayName": "API Token", + "description": "Use a user's API Token to send authenticated requests.\n\n### How to Add API Token to a User\n\nAt the moment, there's no direct way of adding an API Token for a user. The only way it can be done is through directly editing the database.\n\nIf you're using a PostgreSQL database, you can run the following commands in your command line to add API token:\n\n```bash\npsql -d -U \nUPDATE public.user SET api_token='' WHERE email='';\n```\n\nWhere:\n- `` is the name of the database schema you use for the Medusa server.\n- `` is the name of the user that has privileges over the database schema.\n- `` is the API token you want to associate with the user. You can use [this tool to generate a random token](https://randomkeygen.com/).\n- `` is the email address of the admin user you want to have this API token.\n\n### How to Use the API Token\n\nThe API token can be used for Bearer Authentication. It's passed in the `Authorization` header as the following:\n\n```\nAuthorization: Bearer {api_token}\n```\n\nIn this API reference, you'll find in the cURL request samples the use of `{api_token}`. This is where you must pass the API token.\n\nIf you're following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client:\n\n```ts\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, apiKey: '{api_token}' })\n```\n\nIf you're using Medusa React, you can pass the `apiKey` prop to `MedusaProvider`:\n\n```tsx\n\n```\n", + "scheme": "bearer" + }, + "cookie_auth": { + "type": "apiKey", + "in": "cookie", + "name": "connect.sid", + "x-displayName": "Cookie Session ID", + "description": "Use a cookie session to send authenticated requests.\n\n### How to Obtain the Cookie Session\n\nIf you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the admin user is logged in.\n\nIf you're sending requests using cURL, you must set the Session ID in the cookie manually.\n\nTo do that, send a request to [authenticate the user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`:\n\n```bash\ncurl -v --location --request POST 'https://medusa-url.com/admin/auth' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\"\n}'\n```\n\nThe headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this:\n\n```bash\nSet-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM;\n```\n\nCopy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following:\n\n```bash\ncurl --location --request GET 'https://medusa-url.com/admin/products' \\\n--header 'Cookie: connect.sid={sid}'\n```\n\nWhere `{sid}` is the value of `connect.sid` that you copied.\n" + } + }, + "schemas": { + "Address": { + "title": "Address", + "description": "An address.", + "type": "object", + "required": [ + "address_1", + "address_2", + "city", + "company", + "country_code", + "created_at", + "customer_id", + "deleted_at", + "first_name", + "id", + "last_name", + "metadata", + "phone", + "postal_code", + "province", + "updated_at" + ], + "properties": { + "id": { + "type": "string", + "description": "ID of the address", + "example": "addr_01G8ZC9VS1XVE149MGH2J7QSSH" + }, + "customer_id": { + "description": "ID of the customer this address belongs to", + "nullable": true, + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "company": { + "description": "Company name", + "nullable": true, + "type": "string", + "example": "Acme" + }, + "first_name": { + "description": "First name", + "nullable": true, + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "Last name", + "nullable": true, + "type": "string", + "example": "Willms" + }, + "address_1": { + "description": "Address line 1", + "nullable": true, + "type": "string", + "example": "14433 Kemmer Court" + }, + "address_2": { + "description": "Address line 2", + "nullable": true, + "type": "string", + "example": "Suite 369" + }, + "city": { + "description": "City", + "nullable": true, + "type": "string", + "example": "South Geoffreyview" + }, + "country_code": { + "description": "The 2 character ISO code of the country in lower case", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + }, + "example": "st" + }, + "country": { + "description": "A country object. Available if the relation `country` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Country" + }, + "province": { + "description": "Province", + "nullable": true, + "type": "string", + "example": "Kentucky" + }, + "postal_code": { + "description": "Postal Code", + "nullable": true, + "type": "string", + "example": 72093 + }, + "phone": { + "description": "Phone Number", + "nullable": true, + "type": "string", + "example": 16128234334802 + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "AddressCreatePayload": { + "type": "object", + "description": "Address fields used when creating an address.", + "required": [ + "first_name", + "last_name", + "address_1", + "city", + "country_code", + "postal_code" + ], + "properties": { + "first_name": { + "description": "First name", + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "Last name", + "type": "string", + "example": "Willms" + }, + "phone": { + "type": "string", + "description": "Phone Number", + "example": 16128234334802 + }, + "company": { + "type": "string" + }, + "address_1": { + "description": "Address line 1", + "type": "string", + "example": "14433 Kemmer Court" + }, + "address_2": { + "description": "Address line 2", + "type": "string", + "example": "Suite 369" + }, + "city": { + "description": "City", + "type": "string", + "example": "South Geoffreyview" + }, + "country_code": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + }, + "example": "st" + }, + "province": { + "description": "Province", + "type": "string", + "example": "Kentucky" + }, + "postal_code": { + "description": "Postal Code", + "type": "string", + "example": 72093 + }, + "metadata": { + "type": "object", + "example": { + "car": "white" + }, + "description": "An optional key-value map with additional details" + } + } + }, + "AddressPayload": { + "type": "object", + "description": "Address fields used when creating/updating an address.", + "properties": { + "first_name": { + "description": "First name", + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "Last name", + "type": "string", + "example": "Willms" + }, + "phone": { + "type": "string", + "description": "Phone Number", + "example": 16128234334802 + }, + "company": { + "type": "string" + }, + "address_1": { + "description": "Address line 1", + "type": "string", + "example": "14433 Kemmer Court" + }, + "address_2": { + "description": "Address line 2", + "type": "string", + "example": "Suite 369" + }, + "city": { + "description": "City", + "type": "string", + "example": "South Geoffreyview" + }, + "country_code": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + }, + "example": "st" + }, + "province": { + "description": "Province", + "type": "string", + "example": "Kentucky" + }, + "postal_code": { + "description": "Postal Code", + "type": "string", + "example": 72093 + }, + "metadata": { + "type": "object", + "example": { + "car": "white" + }, + "description": "An optional key-value map with additional details" + } + } + }, + "AdminAppsListRes": { + "type": "object", + "required": [ + "apps" + ], + "properties": { + "apps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuth" + } + } + } + }, + "AdminAppsRes": { + "type": "object", + "required": [ + "apps" + ], + "properties": { + "apps": { + "$ref": "#/components/schemas/OAuth" + } + } + }, + "AdminAuthRes": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "$ref": "#/components/schemas/User" + } + } + }, + "AdminBatchJobListRes": { + "type": "object", + "required": [ + "batch_jobs", + "count", + "offset", + "limit" + ], + "properties": { + "batch_jobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BatchJob" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminBatchJobRes": { + "type": "object", + "required": [ + "batch_job" + ], + "properties": { + "batch_job": { + "$ref": "#/components/schemas/BatchJob" + } + } + }, + "AdminCollectionsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Collection" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "product-collection" + }, + "deleted": { + "type": "boolean", + "description": "Whether the collection was deleted successfully or not.", + "default": true + } + } + }, + "AdminCollectionsListRes": { + "type": "object", + "required": [ + "collections", + "count", + "offset", + "limit" + ], + "properties": { + "collections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCollection" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminCollectionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "collection", + "relations": [ + "products" + ] + }, + "required": [ + "collection" + ], + "properties": { + "collection": { + "$ref": "#/components/schemas/ProductCollection" + } + } + }, + "AdminCreateUserRequest": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "description": "The Users email.", + "type": "string", + "format": "email" + }, + "first_name": { + "description": "The name of the User.", + "type": "string" + }, + "last_name": { + "description": "The name of the User.", + "type": "string" + }, + "role": { + "description": "Userrole assigned to the user.", + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ] + }, + "password": { + "description": "The Users password.", + "type": "string", + "format": "password" + } + } + }, + "AdminCurrenciesListRes": { + "type": "object", + "required": [ + "currencies", + "count", + "offset", + "limit" + ], + "properties": { + "currencies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Currency" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminCurrenciesRes": { + "type": "object", + "required": [ + "currency" + ], + "properties": { + "currency": { + "$ref": "#/components/schemas/Currency" + } + } + }, + "AdminCustomerGroupsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted customer group." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "customer_group" + }, + "deleted": { + "type": "boolean", + "description": "Whether the customer group was deleted successfully or not.", + "default": true + } + } + }, + "AdminCustomerGroupsListRes": { + "type": "object", + "required": [ + "customer_groups", + "count", + "offset", + "limit" + ], + "properties": { + "customer_groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminCustomerGroupsRes": { + "type": "object", + "required": [ + "customer_group" + ], + "properties": { + "customer_group": { + "$ref": "#/components/schemas/CustomerGroup" + } + } + }, + "AdminCustomersListRes": { + "type": "object", + "required": [ + "customers", + "count", + "offset", + "limit" + ], + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminCustomersRes": { + "type": "object", + "x-expanded-relations": { + "field": "customer", + "relations": [ + "orders", + "shipping_addresses" + ] + }, + "required": [ + "customer" + ], + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer" + } + } + }, + "AdminDeleteCustomerGroupsGroupCustomerBatchReq": { + "type": "object", + "required": [ + "customer_ids" + ], + "properties": { + "customer_ids": { + "description": "The ids of the customers to remove", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "ID of the customer", + "type": "string" + } + } + } + } + } + }, + "AdminDeleteDiscountsDiscountConditionsConditionBatchReq": { + "type": "object", + "required": [ + "resources" + ], + "properties": { + "resources": { + "description": "The resources to be deleted from the discount condition", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The id of the item", + "type": "string" + } + } + } + } + } + }, + "AdminDeletePriceListPricesPricesReq": { + "type": "object", + "properties": { + "price_ids": { + "description": "The price id's of the Money Amounts to delete.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AdminDeleteProductCategoriesCategoryProductsBatchReq": { + "type": "object", + "required": [ + "product_ids" + ], + "properties": { + "product_ids": { + "description": "The IDs of the products to delete from the Product Category.", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a product", + "type": "string" + } + } + } + } + } + }, + "AdminDeleteProductsFromCollectionReq": { + "type": "object", + "required": [ + "product_ids" + ], + "properties": { + "product_ids": { + "description": "An array of Product IDs to remove from the Product Collection.", + "type": "array", + "items": { + "description": "The ID of a Product to add to the Product Collection.", + "type": "string" + } + } + } + }, + "AdminDeleteProductsFromCollectionRes": { + "type": "object", + "required": [ + "id", + "object", + "removed_products" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the collection" + }, + "object": { + "type": "string", + "description": "The type of object the removal was executed on", + "default": "product-collection" + }, + "removed_products": { + "description": "The IDs of the products removed from the collection", + "type": "array", + "items": { + "description": "The ID of a Product to add to the Product Collection.", + "type": "string" + } + } + } + }, + "AdminDeletePublishableApiKeySalesChannelsBatchReq": { + "type": "object", + "required": [ + "sales_channel_ids" + ], + "properties": { + "sales_channel_ids": { + "description": "The IDs of the sales channels to delete from the publishable api key", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the sales channel" + } + } + } + } + } + }, + "AdminDeleteSalesChannelsChannelProductsBatchReq": { + "type": "object", + "required": [ + "product_ids" + ], + "properties": { + "product_ids": { + "description": "The IDs of the products to delete from the Sales Channel.", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a product", + "type": "string" + } + } + } + } + } + }, + "AdminDeleteSalesChannelsChannelStockLocationsReq": { + "type": "object", + "required": [ + "location_id" + ], + "properties": { + "location_id": { + "description": "The ID of the stock location", + "type": "string" + } + } + }, + "AdminDeleteShippingProfileRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Shipping Profile." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "shipping_profile" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminDeleteTaxRatesTaxRateProductTypesReq": { + "type": "object", + "required": [ + "product_types" + ], + "properties": { + "product_types": { + "type": "array", + "description": "The IDs of the types of products to remove association with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminDeleteTaxRatesTaxRateProductsReq": { + "type": "object", + "required": [ + "products" + ], + "properties": { + "products": { + "type": "array", + "description": "The IDs of the products to remove association with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminDeleteTaxRatesTaxRateShippingOptionsReq": { + "type": "object", + "required": [ + "shipping_options" + ], + "properties": { + "shipping_options": { + "type": "array", + "description": "The IDs of the shipping options to remove association with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminDeleteUploadsReq": { + "type": "object", + "required": [ + "file_key" + ], + "properties": { + "file_key": { + "description": "key of the file to delete", + "type": "string" + } + } + }, + "AdminDeleteUploadsRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The file key of the upload deleted" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "file" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminDeleteUserRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted user." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "user" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminDiscountConditionsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted", + "discount" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted DiscountCondition" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "discount-condition" + }, + "deleted": { + "type": "boolean", + "description": "Whether the discount condition was deleted successfully or not.", + "default": true + }, + "discount": { + "description": "The Discount to which the condition used to belong", + "$ref": "#/components/schemas/Discount" + } + } + }, + "AdminDiscountConditionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "discount_condition", + "relations": [ + "discount_rule" + ] + }, + "required": [ + "discount_condition" + ], + "properties": { + "discount_condition": { + "$ref": "#/components/schemas/DiscountCondition" + } + } + }, + "AdminDiscountsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Discount" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "discount" + }, + "deleted": { + "type": "boolean", + "description": "Whether the discount was deleted successfully or not.", + "default": true + } + } + }, + "AdminDiscountsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "discounts", + "relations": [ + "parent_discount", + "regions", + "rule", + "rule.conditions" + ] + }, + "required": [ + "discounts", + "count", + "offset", + "limit" + ], + "properties": { + "discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Discount" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminDiscountsRes": { + "type": "object", + "x-expanded-relations": { + "field": "discount", + "relations": [ + "parent_discount", + "regions", + "rule", + "rule.conditions" + ], + "eager": [ + "regions.fulfillment_providers", + "regions.payment_providers" + ] + }, + "required": [ + "discount" + ], + "properties": { + "discount": { + "$ref": "#/components/schemas/Discount" + } + } + }, + "AdminDraftOrdersDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Draft Order." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "draft-order" + }, + "deleted": { + "type": "boolean", + "description": "Whether the draft order was deleted successfully or not.", + "default": true + } + } + }, + "AdminDraftOrdersListRes": { + "type": "object", + "x-expanded-relations": { + "field": "draft_orders", + "relations": [ + "order", + "cart", + "cart.items", + "cart.items.adjustments" + ] + }, + "required": [ + "draft_orders", + "count", + "offset", + "limit" + ], + "properties": { + "draft_orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DraftOrder" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminDraftOrdersRes": { + "type": "object", + "x-expanded-relations": { + "field": "draft_order", + "relations": [ + "order", + "cart", + "cart.items", + "cart.items.adjustments", + "cart.billing_address", + "cart.customer", + "cart.discounts", + "cart.discounts.rule", + "cart.items", + "cart.items.adjustments", + "cart.payment", + "cart.payment_sessions", + "cart.region", + "cart.region.payment_providers", + "cart.shipping_address", + "cart.shipping_methods", + "cart.shipping_methods.shipping_option" + ], + "eager": [ + "cart.region.fulfillment_providers", + "cart.region.payment_providers", + "cart.shipping_methods.shipping_option" + ], + "implicit": [ + "cart.discounts", + "cart.discounts.rule", + "cart.gift_cards", + "cart.items", + "cart.items.adjustments", + "cart.items.tax_lines", + "cart.items.variant", + "cart.items.variant.product", + "cart.region", + "cart.region.tax_rates", + "cart.shipping_address", + "cart.shipping_methods", + "cart.shipping_methods.tax_lines" + ], + "totals": [ + "cart.discount_total", + "cart.gift_card_tax_total", + "cart.gift_card_total", + "cart.item_tax_total", + "cart.refundable_amount", + "cart.refunded_total", + "cart.shipping_tax_total", + "cart.shipping_total", + "cart.subtotal", + "cart.tax_total", + "cart.total", + "cart.items.discount_total", + "cart.items.gift_card_total", + "cart.items.original_tax_total", + "cart.items.original_total", + "cart.items.refundable", + "cart.items.subtotal", + "cart.items.tax_total", + "cart.items.total" + ] + }, + "required": [ + "draft_order" + ], + "properties": { + "draft_order": { + "$ref": "#/components/schemas/DraftOrder" + } + } + }, + "AdminExtendedStoresRes": { + "type": "object", + "x-expanded-relations": { + "field": "store", + "relations": [ + "currencies", + "default_currency" + ] + }, + "required": [ + "store" + ], + "properties": { + "store": { + "$ref": "#/components/schemas/ExtendedStoreDTO" + } + } + }, + "AdminGetRegionsRegionFulfillmentOptionsRes": { + "type": "object", + "required": [ + "fulfillment_options" + ], + "properties": { + "fulfillment_options": { + "type": "array", + "items": { + "type": "object", + "required": [ + "provider_id", + "options" + ], + "properties": { + "provider_id": { + "description": "ID of the fulfillment provider", + "type": "string" + }, + "options": { + "description": "fulfillment provider options", + "type": "array", + "items": { + "type": "object", + "example": [ + { + "id": "manual-fulfillment" + }, + { + "id": "manual-fulfillment-return", + "is_return": true + } + ] + } + } + } + } + } + } + }, + "AdminGetVariantsVariantInventoryRes": { + "type": "object", + "properties": { + "variant": { + "type": "object", + "$ref": "#/components/schemas/VariantInventory" + } + } + }, + "AdminGiftCardsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Gift Card" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "gift-card" + }, + "deleted": { + "type": "boolean", + "description": "Whether the gift card was deleted successfully or not.", + "default": true + } + } + }, + "AdminGiftCardsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "gift_cards", + "relations": [ + "order", + "region" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers" + ] + }, + "required": [ + "gift_cards", + "count", + "offset", + "limit" + ], + "properties": { + "gift_cards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminGiftCardsRes": { + "type": "object", + "x-expanded-relations": { + "field": "gift_card", + "relations": [ + "order", + "region" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers" + ] + }, + "required": [ + "gift_card" + ], + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard" + } + } + }, + "AdminInventoryItemsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Inventory Item." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "format": "inventory_item" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Inventory Item was deleted.", + "default": true + } + } + }, + "AdminInventoryItemsListRes": { + "type": "object", + "required": [ + "inventory_items", + "count", + "offset", + "limit" + ], + "properties": { + "inventory_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItemDTO" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminInventoryItemsListWithVariantsAndLocationLevelsRes": { + "type": "object", + "required": [ + "inventory_items", + "count", + "offset", + "limit" + ], + "properties": { + "inventory_items": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/InventoryItemDTO" + }, + { + "type": "object", + "properties": { + "location_levels": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/InventoryLevelDTO" + } + ] + } + }, + "variants": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/ProductVariant" + } + ] + } + } + } + } + ] + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminInventoryItemsLocationLevelsRes": { + "type": "object", + "required": [ + "inventory_item" + ], + "properties": { + "inventory_item": { + "type": "object", + "required": [ + "id", + "location_levels" + ], + "properties": { + "id": { + "description": "The id of the location" + }, + "location_levels": { + "description": "List of stock levels at a given location", + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryLevelDTO" + } + } + } + } + } + }, + "AdminInventoryItemsRes": { + "type": "object", + "required": [ + "inventory_item" + ], + "properties": { + "inventory_item": { + "$ref": "#/components/schemas/InventoryItemDTO" + } + } + }, + "AdminInviteDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Invite." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "invite" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Invite was deleted.", + "default": true + } + } + }, + "AdminListInvitesRes": { + "type": "object", + "required": [ + "invites" + ], + "properties": { + "invites": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invite" + } + } + } + }, + "AdminNotesDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Note." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "note" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Note was deleted.", + "default": true + } + } + }, + "AdminNotesListRes": { + "type": "object", + "required": [ + "notes", + "count", + "offset", + "limit" + ], + "properties": { + "notes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Note" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminNotesRes": { + "type": "object", + "required": [ + "note" + ], + "properties": { + "note": { + "$ref": "#/components/schemas/Note" + } + } + }, + "AdminNotificationsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "notifications", + "relations": [ + "resends" + ] + }, + "required": [ + "notifications" + ], + "properties": { + "notifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Notification" + } + } + } + }, + "AdminNotificationsRes": { + "type": "object", + "x-expanded-relations": { + "field": "notification", + "relations": [ + "resends" + ] + }, + "required": [ + "notification" + ], + "properties": { + "notification": { + "$ref": "#/components/schemas/Notification" + } + } + }, + "AdminOrderEditDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Order Edit." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "order_edit" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Order Edit was deleted.", + "default": true + } + } + }, + "AdminOrderEditItemChangeDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Order Edit Item Change." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "item_change" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Order Edit Item Change was deleted.", + "default": true + } + } + }, + "AdminOrderEditsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "order_edits", + "relations": [ + "changes", + "changes.line_item", + "changes.line_item.variant", + "changes.original_line_item", + "changes.original_line_item.variant", + "items", + "items.adjustments", + "items.tax_lines", + "items.variant", + "payment_collection" + ], + "implicit": [ + "items", + "items.tax_lines", + "items.adjustments", + "items.variant" + ], + "totals": [ + "difference_due", + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total" + ] + }, + "required": [ + "order_edits", + "count", + "offset", + "limit" + ], + "properties": { + "order_edits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderEdit" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminOrderEditsRes": { + "type": "object", + "x-expanded-relations": { + "field": "order_edit", + "relations": [ + "changes", + "changes.line_item", + "changes.line_item.variant", + "changes.original_line_item", + "changes.original_line_item.variant", + "items", + "items.adjustments", + "items.tax_lines", + "items.variant", + "payment_collection" + ], + "implicit": [ + "items", + "items.tax_lines", + "items.adjustments", + "items.variant" + ], + "totals": [ + "difference_due", + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total" + ] + }, + "required": [ + "order_edit" + ], + "properties": { + "order_edit": { + "$ref": "#/components/schemas/OrderEdit" + } + } + }, + "AdminOrdersListRes": { + "type": "object", + "x-expanded-relations": { + "field": "orders", + "relations": [ + "billing_address", + "claims", + "claims.additional_items", + "claims.additional_items.variant", + "claims.claim_items", + "claims.claim_items.images", + "claims.claim_items.item", + "claims.fulfillments", + "claims.fulfillments.tracking_links", + "claims.return_order", + "claims.return_order.shipping_method", + "claims.return_order.shipping_method.tax_lines", + "claims.shipping_address", + "claims.shipping_methods", + "customer", + "discounts", + "discounts.rule", + "fulfillments", + "fulfillments.items", + "fulfillments.tracking_links", + "gift_card_transactions", + "gift_cards", + "items", + "payments", + "refunds", + "region", + "returns", + "returns.items", + "returns.items.reason", + "returns.shipping_method", + "returns.shipping_method.tax_lines", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "fulfillments.items", + "region.fulfillment_providers", + "region.payment_providers", + "returns.items", + "shipping_methods.shipping_option" + ], + "implicit": [ + "claims", + "claims.additional_items", + "claims.additional_items.adjustments", + "claims.additional_items.refundable", + "claims.additional_items.tax_lines", + "discounts", + "discounts.rule", + "gift_card_transactions", + "gift_card_transactions.gift_card", + "gift_cards", + "items", + "items.adjustments", + "items.refundable", + "items.tax_lines", + "items.variant", + "items.variant.product", + "refunds", + "region", + "shipping_methods", + "shipping_methods.tax_lines", + "swaps", + "swaps.additional_items", + "swaps.additional_items.adjustments", + "swaps.additional_items.refundable", + "swaps.additional_items.tax_lines" + ], + "totals": [ + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "paid_total", + "refundable_amount", + "refunded_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "claims.additional_items.discount_total", + "claims.additional_items.gift_card_total", + "claims.additional_items.original_tax_total", + "claims.additional_items.original_total", + "claims.additional_items.refundable", + "claims.additional_items.subtotal", + "claims.additional_items.tax_total", + "claims.additional_items.total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total", + "swaps.additional_items.discount_total", + "swaps.additional_items.gift_card_total", + "swaps.additional_items.original_tax_total", + "swaps.additional_items.original_total", + "swaps.additional_items.refundable", + "swaps.additional_items.subtotal", + "swaps.additional_items.tax_total", + "swaps.additional_items.total" + ] + }, + "required": [ + "orders", + "count", + "offset", + "limit" + ], + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminOrdersOrderLineItemReservationReq": { + "type": "object", + "required": [ + "location_id" + ], + "properties": { + "location_id": { + "description": "The id of the location of the reservation", + "type": "string" + }, + "quantity": { + "description": "The quantity to reserve", + "type": "number" + } + } + }, + "AdminOrdersRes": { + "type": "object", + "x-expanded-relations": { + "field": "order", + "relations": [ + "billing_address", + "claims", + "claims.additional_items", + "claims.additional_items.variant", + "claims.claim_items", + "claims.claim_items.images", + "claims.claim_items.item", + "claims.fulfillments", + "claims.fulfillments.tracking_links", + "claims.return_order", + "claims.return_order.shipping_method", + "claims.return_order.shipping_method.tax_lines", + "claims.shipping_address", + "claims.shipping_methods", + "customer", + "discounts", + "discounts.rule", + "fulfillments", + "fulfillments.items", + "fulfillments.tracking_links", + "gift_card_transactions", + "gift_cards", + "items", + "payments", + "refunds", + "region", + "returns", + "returns.items", + "returns.items.reason", + "returns.shipping_method", + "returns.shipping_method.tax_lines", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "fulfillments.items", + "region.fulfillment_providers", + "region.payment_providers", + "returns.items", + "shipping_methods.shipping_option" + ], + "implicit": [ + "claims", + "claims.additional_items", + "claims.additional_items.adjustments", + "claims.additional_items.refundable", + "claims.additional_items.tax_lines", + "discounts", + "discounts.rule", + "gift_card_transactions", + "gift_card_transactions.gift_card", + "gift_cards", + "items", + "items.adjustments", + "items.refundable", + "items.tax_lines", + "items.variant", + "items.variant.product", + "refunds", + "region", + "shipping_methods", + "shipping_methods.tax_lines", + "swaps", + "swaps.additional_items", + "swaps.additional_items.adjustments", + "swaps.additional_items.refundable", + "swaps.additional_items.tax_lines" + ], + "totals": [ + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "paid_total", + "refundable_amount", + "refunded_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "claims.additional_items.discount_total", + "claims.additional_items.gift_card_total", + "claims.additional_items.original_tax_total", + "claims.additional_items.original_total", + "claims.additional_items.refundable", + "claims.additional_items.subtotal", + "claims.additional_items.tax_total", + "claims.additional_items.total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total", + "swaps.additional_items.discount_total", + "swaps.additional_items.gift_card_total", + "swaps.additional_items.original_tax_total", + "swaps.additional_items.original_total", + "swaps.additional_items.refundable", + "swaps.additional_items.subtotal", + "swaps.additional_items.tax_total", + "swaps.additional_items.total" + ] + }, + "required": [ + "order" + ], + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + } + } + }, + "AdminPaymentCollectionDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Payment Collection." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "payment_collection" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Payment Collection was deleted.", + "default": true + } + } + }, + "AdminPaymentCollectionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "payment_collection", + "relations": [ + "payment_sessions", + "payments", + "region" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers" + ] + }, + "required": [ + "payment_collection" + ], + "properties": { + "payment_collection": { + "$ref": "#/components/schemas/PaymentCollection" + } + } + }, + "AdminPaymentProvidersList": { + "type": "object", + "required": [ + "payment_providers" + ], + "properties": { + "payment_providers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentProvider" + } + } + } + }, + "AdminPaymentRes": { + "type": "object", + "required": [ + "payment" + ], + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment" + } + } + }, + "AdminPostAppsReq": { + "type": "object", + "required": [ + "application_name", + "state", + "code" + ], + "properties": { + "application_name": { + "type": "string", + "description": "Name of the application for the token to be generated for." + }, + "state": { + "type": "string", + "description": "State of the application." + }, + "code": { + "type": "string", + "description": "The code for the generated token." + } + } + }, + "AdminPostAuthReq": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The User's email.", + "format": "email" + }, + "password": { + "type": "string", + "description": "The User's password.", + "format": "password" + } + } + }, + "AdminPostBatchesReq": { + "type": "object", + "required": [ + "type", + "context" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of batch job to start.", + "example": "product-export" + }, + "context": { + "type": "object", + "description": "Additional infomration regarding the batch to be used for processing.", + "example": { + "shape": { + "prices": [ + { + "region": null, + "currency_code": "eur" + } + ], + "dynamicImageColumnCount": 4, + "dynamicOptionColumnCount": 2 + }, + "list_config": { + "skip": 0, + "take": 50, + "order": { + "created_at": "DESC" + }, + "relations": [ + "variants", + "variant.prices", + "images" + ] + } + } + }, + "dry_run": { + "type": "boolean", + "description": "Set a batch job in dry_run mode to get some information on what will be done without applying any modifications.", + "default": false + } + } + }, + "AdminPostCollectionsCollectionReq": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The title to identify the Collection by." + }, + "handle": { + "type": "string", + "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostCollectionsReq": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "type": "string", + "description": "The title to identify the Collection by." + }, + "handle": { + "type": "string", + "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostCurrenciesCurrencyReq": { + "type": "object", + "properties": { + "includes_tax": { + "type": "boolean", + "description": "[EXPERIMENTAL] Tax included in prices of currency." + } + } + }, + "AdminPostCustomerGroupsGroupCustomersBatchReq": { + "type": "object", + "required": [ + "customer_ids" + ], + "properties": { + "customer_ids": { + "description": "The ids of the customers to add", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "ID of the customer", + "type": "string" + } + } + } + } + } + }, + "AdminPostCustomerGroupsGroupReq": { + "type": "object", + "properties": { + "name": { + "description": "Name of the customer group", + "type": "string" + }, + "metadata": { + "description": "Metadata for the customer.", + "type": "object" + } + } + }, + "AdminPostCustomerGroupsReq": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the customer group" + }, + "metadata": { + "type": "object", + "description": "Metadata for the customer." + } + } + }, + "AdminPostCustomersCustomerReq": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Customer's email.", + "format": "email" + }, + "first_name": { + "type": "string", + "description": "The Customer's first name." + }, + "last_name": { + "type": "string", + "description": "The Customer's last name." + }, + "phone": { + "type": "string", + "description": "The Customer's phone number." + }, + "password": { + "type": "string", + "description": "The Customer's password.", + "format": "password" + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a customer group", + "type": "string" + } + } + }, + "description": "A list of customer groups to which the customer belongs." + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostCustomersReq": { + "type": "object", + "required": [ + "email", + "first_name", + "last_name", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The customer's email.", + "format": "email" + }, + "first_name": { + "type": "string", + "description": "The customer's first name." + }, + "last_name": { + "type": "string", + "description": "The customer's last name." + }, + "password": { + "type": "string", + "description": "The customer's password.", + "format": "password" + }, + "phone": { + "type": "string", + "description": "The customer's phone number." + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostDiscountsDiscountConditions": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "operator": { + "description": "Operator of the condition", + "type": "string", + "enum": [ + "in", + "not_in" + ] + }, + "products": { + "type": "array", + "description": "list of product IDs if the condition is applied on products.", + "items": { + "type": "string" + } + }, + "product_types": { + "type": "array", + "description": "list of product type IDs if the condition is applied on product types.", + "items": { + "type": "string" + } + }, + "product_collections": { + "type": "array", + "description": "list of product collection IDs if the condition is applied on product collections.", + "items": { + "type": "string" + } + }, + "product_tags": { + "type": "array", + "description": "list of product tag IDs if the condition is applied on product tags.", + "items": { + "type": "string" + } + }, + "customer_groups": { + "type": "array", + "description": "list of customer group IDs if the condition is applied on customer groups.", + "items": { + "type": "string" + } + } + } + }, + "AdminPostDiscountsDiscountConditionsCondition": { + "type": "object", + "properties": { + "products": { + "type": "array", + "description": "list of product IDs if the condition is applied on products.", + "items": { + "type": "string" + } + }, + "product_types": { + "type": "array", + "description": "list of product type IDs if the condition is applied on product types.", + "items": { + "type": "string" + } + }, + "product_collections": { + "type": "array", + "description": "list of product collection IDs if the condition is applied on product collections.", + "items": { + "type": "string" + } + }, + "product_tags": { + "type": "array", + "description": "list of product tag IDs if the condition is applied on product tags.", + "items": { + "type": "string" + } + }, + "customer_groups": { + "type": "array", + "description": "list of customer group IDs if the condition is applied on customer groups.", + "items": { + "type": "string" + } + } + } + }, + "AdminPostDiscountsDiscountConditionsConditionBatchReq": { + "type": "object", + "required": [ + "resources" + ], + "properties": { + "resources": { + "description": "The resources to be added to the discount condition", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The id of the item", + "type": "string" + } + } + } + } + } + }, + "AdminPostDiscountsDiscountDynamicCodesReq": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "description": "A unique code that will be used to redeem the Discount" + }, + "usage_limit": { + "type": "number", + "description": "Maximum times the discount can be used", + "default": 1 + }, + "metadata": { + "type": "object", + "description": "An optional set of key-value pairs to hold additional information." + } + } + }, + "AdminPostDiscountsDiscountReq": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "A unique code that will be used to redeem the Discount" + }, + "rule": { + "description": "The Discount Rule that defines how Discounts are calculated", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the Rule" + }, + "description": { + "type": "string", + "description": "A short description of the discount" + }, + "value": { + "type": "number", + "description": "The value that the discount represents; this will depend on the type of the discount" + }, + "allocation": { + "type": "string", + "description": "The scope that the discount should apply to.", + "enum": [ + "total", + "item" + ] + }, + "conditions": { + "type": "array", + "description": "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided.", + "items": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the Rule" + }, + "operator": { + "type": "string", + "description": "Operator of the condition", + "enum": [ + "in", + "not_in" + ] + }, + "products": { + "type": "array", + "description": "list of product IDs if the condition is applied on products.", + "items": { + "type": "string" + } + }, + "product_types": { + "type": "array", + "description": "list of product type IDs if the condition is applied on product types.", + "items": { + "type": "string" + } + }, + "product_collections": { + "type": "array", + "description": "list of product collection IDs if the condition is applied on product collections.", + "items": { + "type": "string" + } + }, + "product_tags": { + "type": "array", + "description": "list of product tag IDs if the condition is applied on product tags.", + "items": { + "type": "string" + } + }, + "customer_groups": { + "type": "array", + "description": "list of customer group IDs if the condition is applied on customer groups.", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "starts_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should be available." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should no longer be available." + }, + "valid_duration": { + "type": "string", + "description": "Duration the discount runs between", + "example": "P3Y6M4DT12H30M5S" + }, + "usage_limit": { + "type": "number", + "description": "Maximum times the discount can be used" + }, + "regions": { + "description": "A list of Region ids representing the Regions in which the Discount can be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "description": "An object containing metadata of the discount", + "type": "object" + } + } + }, + "AdminPostDiscountsReq": { + "type": "object", + "required": [ + "code", + "rule", + "regions" + ], + "properties": { + "code": { + "type": "string", + "description": "A unique code that will be used to redeem the Discount" + }, + "is_dynamic": { + "type": "boolean", + "description": "Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules.", + "default": false + }, + "rule": { + "description": "The Discount Rule that defines how Discounts are calculated", + "type": "object", + "required": [ + "type", + "value", + "allocation" + ], + "properties": { + "description": { + "type": "string", + "description": "A short description of the discount" + }, + "type": { + "type": "string", + "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.", + "enum": [ + "fixed", + "percentage", + "free_shipping" + ] + }, + "value": { + "type": "number", + "description": "The value that the discount represents; this will depend on the type of the discount" + }, + "allocation": { + "type": "string", + "description": "The scope that the discount should apply to.", + "enum": [ + "total", + "item" + ] + }, + "conditions": { + "type": "array", + "description": "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided.", + "items": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "operator": { + "type": "string", + "description": "Operator of the condition", + "enum": [ + "in", + "not_in" + ] + }, + "products": { + "type": "array", + "description": "list of product IDs if the condition is applied on products.", + "items": { + "type": "string" + } + }, + "product_types": { + "type": "array", + "description": "list of product type IDs if the condition is applied on product types.", + "items": { + "type": "string" + } + }, + "product_collections": { + "type": "array", + "description": "list of product collection IDs if the condition is applied on product collections.", + "items": { + "type": "string" + } + }, + "product_tags": { + "type": "array", + "description": "list of product tag IDs if the condition is applied on product tags.", + "items": { + "type": "string" + } + }, + "customer_groups": { + "type": "array", + "description": "list of customer group IDs if the condition is applied on customer groups.", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers.", + "default": false + }, + "starts_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should be available." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should no longer be available." + }, + "valid_duration": { + "type": "string", + "description": "Duration the discount runs between", + "example": "P3Y6M4DT12H30M5S" + }, + "regions": { + "description": "A list of Region ids representing the Regions in which the Discount can be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "usage_limit": { + "type": "number", + "description": "Maximum times the discount can be used" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostDraftOrdersDraftOrderLineItemsItemReq": { + "type": "object", + "properties": { + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + }, + "AdminPostDraftOrdersDraftOrderLineItemsReq": { + "type": "object", + "required": [ + "quantity" + ], + "properties": { + "variant_id": { + "description": "The ID of the Product Variant to generate the Line Item from.", + "type": "string" + }, + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string", + "default": "Custom item" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + }, + "AdminPostDraftOrdersDraftOrderRegisterPaymentRes": { + "type": "object", + "required": [ + "order" + ], + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + } + } + }, + "AdminPostDraftOrdersDraftOrderReq": { + "type": "object", + "properties": { + "region_id": { + "type": "string", + "description": "The ID of the Region to create the Draft Order in." + }, + "country_code": { + "type": "string", + "description": "The 2 character ISO code for the Country.", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "email": { + "type": "string", + "description": "An email to be used on the Draft Order.", + "format": "email" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload" + }, + { + "type": "string" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload" + }, + { + "type": "string" + } + ] + }, + "discounts": { + "description": "An array of Discount codes to add to the Draft Order.", + "type": "array", + "items": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "description": "The code that a Discount is identifed by.", + "type": "string" + } + } + } + }, + "no_notification_order": { + "description": "An optional flag passed to the resulting order to determine use of notifications.", + "type": "boolean" + }, + "customer_id": { + "description": "The ID of the Customer to associate the Draft Order with.", + "type": "string" + } + } + }, + "AdminPostDraftOrdersReq": { + "type": "object", + "required": [ + "email", + "region_id", + "shipping_methods" + ], + "properties": { + "status": { + "description": "The status of the draft order", + "type": "string", + "enum": [ + "open", + "completed" + ] + }, + "email": { + "description": "The email of the customer of the draft order", + "type": "string", + "format": "email" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload" + }, + { + "type": "string" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload" + }, + { + "type": "string" + } + ] + }, + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "type": "object", + "required": [ + "quantity" + ], + "properties": { + "variant_id": { + "description": "The ID of the Product Variant to generate the Line Item from.", + "type": "string" + }, + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + }, + "region_id": { + "description": "The ID of the region for the draft order", + "type": "string" + }, + "discounts": { + "description": "The discounts to add on the draft order", + "type": "array", + "items": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "description": "The code of the discount to apply", + "type": "string" + } + } + } + }, + "customer_id": { + "description": "The ID of the customer to add on the draft order", + "type": "string" + }, + "no_notification_order": { + "description": "An optional flag passed to the resulting order to determine use of notifications.", + "type": "boolean" + }, + "shipping_methods": { + "description": "The shipping methods for the draft order", + "type": "array", + "items": { + "type": "object", + "required": [ + "option_id" + ], + "properties": { + "option_id": { + "description": "The ID of the shipping option in use", + "type": "string" + }, + "data": { + "description": "The optional additional data needed for the shipping method", + "type": "object" + }, + "price": { + "description": "The potential custom price of the shipping", + "type": "integer" + } + } + } + }, + "metadata": { + "description": "The optional key-value map with additional details about the Draft Order.", + "type": "object" + } + } + }, + "AdminPostGiftCardsGiftCardReq": { + "type": "object", + "properties": { + "balance": { + "type": "integer", + "description": "The value (excluding VAT) that the Gift Card should represent." + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Gift Card should no longer be available." + }, + "region_id": { + "description": "The ID of the Region in which the Gift Card can be used.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostGiftCardsReq": { + "type": "object", + "required": [ + "region_id" + ], + "properties": { + "value": { + "type": "integer", + "description": "The value (excluding VAT) that the Gift Card should represent." + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Gift Card should no longer be available." + }, + "region_id": { + "description": "The ID of the Region in which the Gift Card can be used.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostInventoryItemsInventoryItemReq": { + "type": "object", + "properties": { + "hs_code": { + "description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "origin_country": { + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "material": { + "description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "weight": { + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "height": { + "description": "The height of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "width": { + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "length": { + "description": "The length of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "requires_shipping": { + "description": "Whether the item requires shipping.", + "type": "boolean" + } + } + }, + "AdminPostInventoryItemsItemLocationLevelsLevelReq": { + "type": "object", + "properties": { + "stocked_quantity": { + "description": "the total stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "incoming_quantity": { + "description": "the incoming stock quantity of an inventory item at the given location ID", + "type": "number" + } + } + }, + "AdminPostInventoryItemsItemLocationLevelsReq": { + "type": "object", + "required": [ + "location_id", + "stocked_quantity" + ], + "properties": { + "location_id": { + "description": "the item location ID", + "type": "string" + }, + "stocked_quantity": { + "description": "the stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "incoming_quantity": { + "description": "the incoming stock quantity of an inventory item at the given location ID", + "type": "number" + } + } + }, + "AdminPostInventoryItemsReq": { + "type": "object", + "properties": { + "sku": { + "description": "The unique SKU for the Product Variant.", + "type": "string" + }, + "ean": { + "description": "The EAN number of the item.", + "type": "string" + }, + "upc": { + "description": "The UPC number of the item.", + "type": "string" + }, + "barcode": { + "description": "A generic GTIN field for the Product Variant.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code for the Product Variant.", + "type": "string" + }, + "inventory_quantity": { + "description": "The amount of stock kept for the Product Variant.", + "type": "integer", + "default": 0 + }, + "allow_backorder": { + "description": "Whether the Product Variant can be purchased when out of stock.", + "type": "boolean" + }, + "manage_inventory": { + "description": "Whether Medusa should keep track of the inventory for this Product Variant.", + "type": "boolean", + "default": true + }, + "weight": { + "description": "The wieght of the Product Variant.", + "type": "number" + }, + "length": { + "description": "The length of the Product Variant.", + "type": "number" + }, + "height": { + "description": "The height of the Product Variant.", + "type": "number" + }, + "width": { + "description": "The width of the Product Variant.", + "type": "number" + }, + "origin_country": { + "description": "The country of origin of the Product Variant.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product Variant.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product Variant.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostInvitesInviteAcceptReq": { + "type": "object", + "required": [ + "token", + "user" + ], + "properties": { + "token": { + "description": "The invite token provided by the admin.", + "type": "string" + }, + "user": { + "description": "The User to create.", + "type": "object", + "required": [ + "first_name", + "last_name", + "password" + ], + "properties": { + "first_name": { + "type": "string", + "description": "the first name of the User" + }, + "last_name": { + "type": "string", + "description": "the last name of the User" + }, + "password": { + "description": "The desired password for the User", + "type": "string", + "format": "password" + } + } + } + } + }, + "AdminPostInvitesReq": { + "type": "object", + "required": [ + "user", + "role" + ], + "properties": { + "user": { + "description": "The email for the user to be created.", + "type": "string", + "format": "email" + }, + "role": { + "description": "The role of the user to be created.", + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ] + } + } + }, + "AdminPostNotesNoteReq": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string", + "description": "The updated description of the Note." + } + } + }, + "AdminPostNotesReq": { + "type": "object", + "required": [ + "resource_id", + "resource_type", + "value" + ], + "properties": { + "resource_id": { + "type": "string", + "description": "The ID of the resource which the Note relates to." + }, + "resource_type": { + "type": "string", + "description": "The type of resource which the Note relates to." + }, + "value": { + "type": "string", + "description": "The content of the Note to create." + } + } + }, + "AdminPostNotificationsNotificationResendReq": { + "type": "object", + "properties": { + "to": { + "description": "A new address or user identifier that the Notification should be sent to", + "type": "string" + } + } + }, + "AdminPostOrderEditsEditLineItemsLineItemReq": { + "type": "object", + "required": [ + "quantity" + ], + "properties": { + "quantity": { + "description": "The quantity to update", + "type": "number" + } + } + }, + "AdminPostOrderEditsEditLineItemsReq": { + "type": "object", + "required": [ + "variant_id", + "quantity" + ], + "properties": { + "variant_id": { + "description": "The ID of the variant ID to add", + "type": "string" + }, + "quantity": { + "description": "The quantity to add", + "type": "number" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostOrderEditsOrderEditReq": { + "type": "object", + "properties": { + "internal_note": { + "description": "An optional note to create or update for the order edit.", + "type": "string" + } + } + }, + "AdminPostOrderEditsReq": { + "type": "object", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "description": "The ID of the order to create the edit for.", + "type": "string" + }, + "internal_note": { + "description": "An optional note to create for the order edit.", + "type": "string" + } + } + }, + "AdminPostOrdersOrderClaimsClaimFulfillmentsReq": { + "type": "object", + "properties": { + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" + } + } + }, + "AdminPostOrdersOrderClaimsClaimReq": { + "type": "object", + "properties": { + "claim_items": { + "description": "The Claim Items that the Claim will consist of.", + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "images", + "tags" + ], + "properties": { + "id": { + "description": "The ID of the Claim Item.", + "type": "string" + }, + "item_id": { + "description": "The ID of the Line Item that will be claimed.", + "type": "string" + }, + "quantity": { + "description": "The number of items that will be returned", + "type": "integer" + }, + "note": { + "description": "Short text describing the Claim Item in further detail.", + "type": "string" + }, + "reason": { + "description": "The reason for the Claim", + "type": "string", + "enum": [ + "missing_item", + "wrong_item", + "production_failure", + "other" + ] + }, + "tags": { + "description": "A list o tags to add to the Claim Item", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Tag ID" + }, + "value": { + "type": "string", + "description": "Tag value" + } + } + } + }, + "images": { + "description": "A list of image URL's that will be associated with the Claim", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Image ID" + }, + "url": { + "type": "string", + "description": "Image URL" + } + } + } + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + }, + "shipping_methods": { + "description": "The Shipping Methods to send the additional Line Items with.", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The ID of an existing Shipping Method", + "type": "string" + }, + "option_id": { + "description": "The ID of the Shipping Option to create a Shipping Method from", + "type": "string" + }, + "price": { + "description": "The price to charge for the Shipping Method", + "type": "integer" + }, + "data": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Swap.", + "type": "boolean" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostOrdersOrderClaimsClaimShipmentsReq": { + "type": "object", + "required": [ + "fulfillment_id" + ], + "properties": { + "fulfillment_id": { + "description": "The ID of the Fulfillment.", + "type": "string" + }, + "tracking_numbers": { + "description": "The tracking numbers for the shipment.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AdminPostOrdersOrderClaimsReq": { + "type": "object", + "required": [ + "type", + "claim_items" + ], + "properties": { + "type": { + "description": "The type of the Claim. This will determine how the Claim is treated: `replace` Claims will result in a Fulfillment with new items being created, while a `refund` Claim will refund the amount paid for the claimed items.", + "type": "string", + "enum": [ + "replace", + "refund" + ] + }, + "claim_items": { + "description": "The Claim Items that the Claim will consist of.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of the Line Item that will be claimed.", + "type": "string" + }, + "quantity": { + "description": "The number of items that will be returned", + "type": "integer" + }, + "note": { + "description": "Short text describing the Claim Item in further detail.", + "type": "string" + }, + "reason": { + "description": "The reason for the Claim", + "type": "string", + "enum": [ + "missing_item", + "wrong_item", + "production_failure", + "other" + ] + }, + "tags": { + "description": "A list o tags to add to the Claim Item", + "type": "array", + "items": { + "type": "string" + } + }, + "images": { + "description": "A list of image URL's that will be associated with the Claim", + "items": { + "type": "string" + } + } + } + } + }, + "return_shipping": { + "description": "Optional details for the Return Shipping Method, if the items are to be sent back.", + "type": "object", + "properties": { + "option_id": { + "type": "string", + "description": "The ID of the Shipping Option to create the Shipping Method from." + }, + "price": { + "type": "integer", + "description": "The price to charge for the Shipping Method." + } + } + }, + "additional_items": { + "description": "The new items to send to the Customer when the Claim type is Replace.", + "type": "array", + "items": { + "type": "object", + "required": [ + "variant_id", + "quantity" + ], + "properties": { + "variant_id": { + "description": "The ID of the Product Variant to ship.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Product Variant to ship.", + "type": "integer" + } + } + } + }, + "shipping_methods": { + "description": "The Shipping Methods to send the additional Line Items with.", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The ID of an existing Shipping Method", + "type": "string" + }, + "option_id": { + "description": "The ID of the Shipping Option to create a Shipping Method from", + "type": "string" + }, + "price": { + "description": "The price to charge for the Shipping Method", + "type": "integer" + }, + "data": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + }, + "shipping_address": { + "description": "An optional shipping address to send the claim to. Defaults to the parent order's shipping address", + "$ref": "#/components/schemas/AddressPayload" + }, + "refund_amount": { + "description": "The amount to refund the Customer when the Claim type is `refund`.", + "type": "integer" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostOrdersOrderFulfillmentsReq": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "description": "The Line Items to include in the Fulfillment.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of Line Item to fulfill.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item to fulfill.", + "type": "integer" + } + } + } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Swap.", + "type": "boolean" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminPostOrdersOrderRefundsReq": { + "type": "object", + "required": [ + "amount", + "reason" + ], + "properties": { + "amount": { + "description": "The amount to refund.", + "type": "integer" + }, + "reason": { + "description": "The reason for the Refund.", + "type": "string" + }, + "note": { + "description": "A note with additional details about the Refund.", + "type": "string" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Refund.", + "type": "boolean" + } + } + }, + "AdminPostOrdersOrderReq": { + "type": "object", + "properties": { + "email": { + "description": "the email for the order", + "type": "string" + }, + "billing_address": { + "description": "Billing address", + "$ref": "#/components/schemas/AddressPayload" + }, + "shipping_address": { + "description": "Shipping address", + "$ref": "#/components/schemas/AddressPayload" + }, + "items": { + "description": "The Line Items for the order", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "region": { + "description": "ID of the region where the order belongs", + "type": "string" + }, + "discounts": { + "description": "Discounts applied to the order", + "type": "array", + "items": { + "$ref": "#/components/schemas/Discount" + } + }, + "customer_id": { + "description": "ID of the customer", + "type": "string" + }, + "payment_method": { + "description": "payment method chosen for the order", + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "ID of the payment provider" + }, + "data": { + "description": "Data relevant for the given payment method", + "type": "object" + } + } + }, + "shipping_method": { + "description": "The Shipping Method used for shipping the order.", + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "The ID of the shipping provider." + }, + "profile_id": { + "type": "string", + "description": "The ID of the shipping profile." + }, + "price": { + "type": "integer", + "description": "The price of the shipping." + }, + "data": { + "type": "object", + "description": "Data relevant to the specific shipping method." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + }, + "description": "Items to ship" + } + } + }, + "no_notification": { + "description": "A flag to indicate if no notifications should be emitted related to the updated order.", + "type": "boolean" + } + } + }, + "AdminPostOrdersOrderReturnsReq": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "description": "The Line Items that will be returned.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of the Line Item.", + "type": "string" + }, + "reason_id": { + "description": "The ID of the Return Reason to use.", + "type": "string" + }, + "note": { + "description": "An optional note with information about the Return.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + } + } + } + }, + "return_shipping": { + "description": "The Shipping Method to be used to handle the return shipment.", + "type": "object", + "properties": { + "option_id": { + "type": "string", + "description": "The ID of the Shipping Option to create the Shipping Method from." + }, + "price": { + "type": "integer", + "description": "The price to charge for the Shipping Method." + } + } + }, + "note": { + "description": "An optional note with information about the Return.", + "type": "string" + }, + "receive_now": { + "description": "A flag to indicate if the Return should be registerd as received immediately.", + "type": "boolean", + "default": false + }, + "no_notification": { + "description": "A flag to indicate if no notifications should be emitted related to the requested Return.", + "type": "boolean" + }, + "refund": { + "description": "The amount to refund.", + "type": "integer" + } + } + }, + "AdminPostOrdersOrderShipmentReq": { + "type": "object", + "required": [ + "fulfillment_id" + ], + "properties": { + "fulfillment_id": { + "description": "The ID of the Fulfillment.", + "type": "string" + }, + "tracking_numbers": { + "description": "The tracking numbers for the shipment.", + "type": "array", + "items": { + "type": "string" + } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Shipment.", + "type": "boolean" + } + } + }, + "AdminPostOrdersOrderShippingMethodsReq": { + "type": "object", + "required": [ + "price", + "option_id" + ], + "properties": { + "price": { + "type": "number", + "description": "The price (excluding VAT) that should be charged for the Shipping Method" + }, + "option_id": { + "type": "string", + "description": "The ID of the Shipping Option to create the Shipping Method from." + }, + "date": { + "type": "object", + "description": "The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider." + } + } + }, + "AdminPostOrdersOrderSwapsReq": { + "type": "object", + "required": [ + "return_items" + ], + "properties": { + "return_items": { + "description": "The Line Items to return as part of the Swap.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of the Line Item that will be claimed.", + "type": "string" + }, + "quantity": { + "description": "The number of items that will be returned", + "type": "integer" + }, + "reason_id": { + "description": "The ID of the Return Reason to use.", + "type": "string" + }, + "note": { + "description": "An optional note with information about the Return.", + "type": "string" + } + } + } + }, + "return_shipping": { + "description": "How the Swap will be returned.", + "type": "object", + "required": [ + "option_id" + ], + "properties": { + "option_id": { + "type": "string", + "description": "The ID of the Shipping Option to create the Shipping Method from." + }, + "price": { + "type": "integer", + "description": "The price to charge for the Shipping Method." + } + } + }, + "additional_items": { + "description": "The new items to send to the Customer.", + "type": "array", + "items": { + "type": "object", + "required": [ + "variant_id", + "quantity" + ], + "properties": { + "variant_id": { + "description": "The ID of the Product Variant to ship.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Product Variant to ship.", + "type": "integer" + } + } + } + }, + "custom_shipping_options": { + "description": "The custom shipping options to potentially create a Shipping Method from.", + "type": "array", + "items": { + "type": "object", + "required": [ + "option_id", + "price" + ], + "properties": { + "option_id": { + "description": "The ID of the Shipping Option to override with a custom price.", + "type": "string" + }, + "price": { + "description": "The custom price of the Shipping Option.", + "type": "integer" + } + } + } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Swap.", + "type": "boolean" + }, + "allow_backorder": { + "description": "If true, swaps can be completed with items out of stock", + "type": "boolean", + "default": true + } + } + }, + "AdminPostOrdersOrderSwapsSwapFulfillmentsReq": { + "type": "object", + "properties": { + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" + } + } + }, + "AdminPostOrdersOrderSwapsSwapShipmentsReq": { + "type": "object", + "required": [ + "fulfillment_id" + ], + "properties": { + "fulfillment_id": { + "description": "The ID of the Fulfillment.", + "type": "string" + }, + "tracking_numbers": { + "description": "The tracking numbers for the shipment.", + "type": "array", + "items": { + "type": "string" + } + }, + "no_notification": { + "description": "If set to true no notification will be sent related to this Claim.", + "type": "boolean" + } + } + }, + "AdminPostPaymentRefundsReq": { + "type": "object", + "required": [ + "amount", + "reason" + ], + "properties": { + "amount": { + "description": "The amount to refund.", + "type": "integer" + }, + "reason": { + "description": "The reason for the Refund.", + "type": "string" + }, + "note": { + "description": "A note with additional details about the Refund.", + "type": "string" + } + } + }, + "AdminPostPriceListPricesPricesReq": { + "type": "object", + "properties": { + "prices": { + "description": "The prices to update or add.", + "type": "array", + "items": { + "type": "object", + "required": [ + "amount", + "variant_id" + ], + "properties": { + "id": { + "description": "The ID of the price.", + "type": "string" + }, + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currecny_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "variant_id": { + "description": "The ID of the Variant for which the price is used.", + "type": "string" + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "override": { + "description": "If true the prices will replace all existing prices associated with the Price List.", + "type": "boolean" + } + } + }, + "AdminPostPriceListsPriceListPriceListReq": { + "type": "object", + "properties": { + "name": { + "description": "The name of the Price List", + "type": "string" + }, + "description": { + "description": "A description of the Price List.", + "type": "string" + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "type": "string", + "format": "date" + }, + "ends_at": { + "description": "The date with timezone that the Price List ends being valid.", + "type": "string", + "format": "date" + }, + "type": { + "description": "The type of the Price List.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "status": { + "description": "The status of the Price List.", + "type": "string", + "enum": [ + "active", + "draft" + ] + }, + "prices": { + "description": "The prices of the Price List.", + "type": "array", + "items": { + "type": "object", + "required": [ + "amount", + "variant_id" + ], + "properties": { + "id": { + "description": "The ID of the price.", + "type": "string" + }, + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currecny_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "variant_id": { + "description": "The ID of the Variant for which the price is used.", + "type": "string" + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "customer_groups": { + "type": "array", + "description": "A list of customer groups that the Price List applies to.", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a customer group", + "type": "string" + } + } + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Tax included in prices of price list", + "type": "boolean" + } + } + }, + "AdminPostPriceListsPriceListReq": { + "type": "object", + "required": [ + "name", + "description", + "type", + "prices" + ], + "properties": { + "name": { + "description": "The name of the Price List", + "type": "string" + }, + "description": { + "description": "A description of the Price List.", + "type": "string" + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "type": "string", + "format": "date" + }, + "ends_at": { + "description": "The date with timezone that the Price List ends being valid.", + "type": "string", + "format": "date" + }, + "type": { + "description": "The type of the Price List.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "status": { + "description": "The status of the Price List.", + "type": "string", + "enum": [ + "active", + "draft" + ] + }, + "prices": { + "description": "The prices of the Price List.", + "type": "array", + "items": { + "type": "object", + "required": [ + "amount", + "variant_id" + ], + "properties": { + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currecny_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "variant_id": { + "description": "The ID of the Variant for which the price is used.", + "type": "string" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "customer_groups": { + "type": "array", + "description": "A list of customer groups that the Price List applies to.", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a customer group", + "type": "string" + } + } + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Tax included in prices of price list", + "type": "boolean" + } + } + }, + "AdminPostProductCategoriesCategoryProductsBatchReq": { + "type": "object", + "required": [ + "product_ids" + ], + "properties": { + "product_ids": { + "description": "The IDs of the products to add to the Product Category", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the product" + } + } + } + } + } + }, + "AdminPostProductCategoriesCategoryReq": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name to identify the Product Category by." + }, + "handle": { + "type": "string", + "description": "A handle to be used in slugs." + }, + "is_internal": { + "type": "boolean", + "description": "A flag to make product category an internal category for admins" + }, + "is_active": { + "type": "boolean", + "description": "A flag to make product category visible/hidden in the store front" + }, + "parent_category_id": { + "type": "string", + "description": "The ID of the parent product category" + }, + "rank": { + "type": "number", + "description": "The rank of the category in the tree node (starting from 0)" + } + } + }, + "AdminPostProductCategoriesReq": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name to identify the Product Category by." + }, + "handle": { + "type": "string", + "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + }, + "is_internal": { + "type": "boolean", + "description": "A flag to make product category an internal category for admins" + }, + "is_active": { + "type": "boolean", + "description": "A flag to make product category visible/hidden in the store front" + }, + "parent_category_id": { + "type": "string", + "description": "The ID of the parent product category" + } + } + }, + "AdminPostProductsProductMetadataReq": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "description": "The metadata key", + "type": "string" + }, + "value": { + "description": "The metadata value", + "type": "string" + } + } + }, + "AdminPostProductsProductOptionsOption": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "description": "The title of the Product Option", + "type": "string" + } + } + }, + "AdminPostProductsProductOptionsReq": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "description": "The title the Product Option will be identified by i.e. \"Size\"", + "type": "string" + } + } + }, + "AdminPostProductsProductReq": { + "type": "object", + "properties": { + "title": { + "description": "The title of the Product", + "type": "string" + }, + "subtitle": { + "description": "The subtitle of the Product", + "type": "string" + }, + "description": { + "description": "A description of the Product.", + "type": "string" + }, + "discountable": { + "description": "A flag to indicate if discounts can be applied to the LineItems generated from this Product", + "type": "boolean" + }, + "images": { + "description": "Images of the Product.", + "type": "array", + "items": { + "type": "string" + } + }, + "thumbnail": { + "description": "The thumbnail to use for the Product.", + "type": "string" + }, + "handle": { + "description": "A unique handle to identify the Product by.", + "type": "string" + }, + "status": { + "description": "The status of the product.", + "type": "string", + "enum": [ + "draft", + "proposed", + "published", + "rejected" + ] + }, + "type": { + "description": "The Product Type to associate the Product with.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "id": { + "description": "The ID of the Product Type.", + "type": "string" + }, + "value": { + "description": "The value of the Product Type.", + "type": "string" + } + } + }, + "collection_id": { + "description": "The ID of the Collection the Product should belong to.", + "type": "string" + }, + "tags": { + "description": "Tags to associate the Product with.", + "type": "array", + "items": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "id": { + "description": "The ID of an existing Tag.", + "type": "string" + }, + "value": { + "description": "The value of the Tag, these will be upserted.", + "type": "string" + } + } + } + }, + "sales_channels": { + "description": "[EXPERIMENTAL] Sales channels to associate the Product with.", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of an existing Sales channel.", + "type": "string" + } + } + } + }, + "categories": { + "description": "Categories to add the Product to.", + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a Product Category.", + "type": "string" + } + } + } + }, + "variants": { + "description": "A list of Product Variants to create with the Product.", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the Product Variant.", + "type": "string" + }, + "title": { + "description": "The title to identify the Product Variant by.", + "type": "string" + }, + "sku": { + "description": "The unique SKU for the Product Variant.", + "type": "string" + }, + "ean": { + "description": "The EAN number of the item.", + "type": "string" + }, + "upc": { + "description": "The UPC number of the item.", + "type": "string" + }, + "barcode": { + "description": "A generic GTIN field for the Product Variant.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code for the Product Variant.", + "type": "string" + }, + "inventory_quantity": { + "description": "The amount of stock kept for the Product Variant.", + "type": "integer" + }, + "allow_backorder": { + "description": "Whether the Product Variant can be purchased when out of stock.", + "type": "boolean" + }, + "manage_inventory": { + "description": "Whether Medusa should keep track of the inventory for this Product Variant.", + "type": "boolean" + }, + "weight": { + "description": "The wieght of the Product Variant.", + "type": "number" + }, + "length": { + "description": "The length of the Product Variant.", + "type": "number" + }, + "height": { + "description": "The height of the Product Variant.", + "type": "number" + }, + "width": { + "description": "The width of the Product Variant.", + "type": "number" + }, + "origin_country": { + "description": "The country of origin of the Product Variant.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product Variant.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product Variant.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "prices": { + "type": "array", + "items": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "id": { + "description": "The ID of the Price.", + "type": "string" + }, + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currency_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "options": { + "type": "array", + "items": { + "type": "object", + "required": [ + "option_id", + "value" + ], + "properties": { + "option_id": { + "description": "The ID of the Option.", + "type": "string" + }, + "value": { + "description": "The value to give for the Product Option at the same index in the Product's `options` field.", + "type": "string" + } + } + } + } + } + } + }, + "weight": { + "description": "The wieght of the Product.", + "type": "number" + }, + "length": { + "description": "The length of the Product.", + "type": "number" + }, + "height": { + "description": "The height of the Product.", + "type": "number" + }, + "width": { + "description": "The width of the Product.", + "type": "number" + }, + "origin_country": { + "description": "The country of origin of the Product.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostProductsProductVariantsReq": { + "type": "object", + "required": [ + "title", + "prices", + "options" + ], + "properties": { + "title": { + "description": "The title to identify the Product Variant by.", + "type": "string" + }, + "sku": { + "description": "The unique SKU for the Product Variant.", + "type": "string" + }, + "ean": { + "description": "The EAN number of the item.", + "type": "string" + }, + "upc": { + "description": "The UPC number of the item.", + "type": "string" + }, + "barcode": { + "description": "A generic GTIN field for the Product Variant.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code for the Product Variant.", + "type": "string" + }, + "inventory_quantity": { + "description": "The amount of stock kept for the Product Variant.", + "type": "integer", + "default": 0 + }, + "allow_backorder": { + "description": "Whether the Product Variant can be purchased when out of stock.", + "type": "boolean" + }, + "manage_inventory": { + "description": "Whether Medusa should keep track of the inventory for this Product Variant.", + "type": "boolean", + "default": true + }, + "weight": { + "description": "The wieght of the Product Variant.", + "type": "number" + }, + "length": { + "description": "The length of the Product Variant.", + "type": "number" + }, + "height": { + "description": "The height of the Product Variant.", + "type": "number" + }, + "width": { + "description": "The width of the Product Variant.", + "type": "number" + }, + "origin_country": { + "description": "The country of origin of the Product Variant.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product Variant.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product Variant.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "prices": { + "type": "array", + "items": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "id": { + "description": "The ID of the price.", + "type": "string" + }, + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currency_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "options": { + "type": "array", + "items": { + "type": "object", + "required": [ + "option_id", + "value" + ], + "properties": { + "option_id": { + "description": "The ID of the Product Option to set the value for.", + "type": "string" + }, + "value": { + "description": "The value to give for the Product Option.", + "type": "string" + } + } + } + } + } + }, + "AdminPostProductsProductVariantsVariantReq": { + "type": "object", + "required": [ + "prices" + ], + "properties": { + "title": { + "description": "The title to identify the Product Variant by.", + "type": "string" + }, + "sku": { + "description": "The unique SKU for the Product Variant.", + "type": "string" + }, + "ean": { + "description": "The EAN number of the item.", + "type": "string" + }, + "upc": { + "description": "The UPC number of the item.", + "type": "string" + }, + "barcode": { + "description": "A generic GTIN field for the Product Variant.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code for the Product Variant.", + "type": "string" + }, + "inventory_quantity": { + "description": "The amount of stock kept for the Product Variant.", + "type": "integer" + }, + "allow_backorder": { + "description": "Whether the Product Variant can be purchased when out of stock.", + "type": "boolean" + }, + "manage_inventory": { + "description": "Whether Medusa should keep track of the inventory for this Product Variant.", + "type": "boolean" + }, + "weight": { + "description": "The weight of the Product Variant.", + "type": "number" + }, + "length": { + "description": "The length of the Product Variant.", + "type": "number" + }, + "height": { + "description": "The height of the Product Variant.", + "type": "number" + }, + "width": { + "description": "The width of the Product Variant.", + "type": "number" + }, + "origin_country": { + "description": "The country of origin of the Product Variant.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product Variant.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product Variant.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "prices": { + "type": "array", + "items": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "id": { + "description": "The ID of the price.", + "type": "string" + }, + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currency_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "options": { + "type": "array", + "items": { + "type": "object", + "required": [ + "option_id", + "value" + ], + "properties": { + "option_id": { + "description": "The ID of the Product Option to set the value for.", + "type": "string" + }, + "value": { + "description": "The value to give for the Product Option.", + "type": "string" + } + } + } + } + } + }, + "AdminPostProductsReq": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "description": "The title of the Product", + "type": "string" + }, + "subtitle": { + "description": "The subtitle of the Product", + "type": "string" + }, + "description": { + "description": "A description of the Product.", + "type": "string" + }, + "is_giftcard": { + "description": "A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created.", + "type": "boolean", + "default": false + }, + "discountable": { + "description": "A flag to indicate if discounts can be applied to the LineItems generated from this Product", + "type": "boolean", + "default": true + }, + "images": { + "description": "Images of the Product.", + "type": "array", + "items": { + "type": "string" + } + }, + "thumbnail": { + "description": "The thumbnail to use for the Product.", + "type": "string" + }, + "handle": { + "description": "A unique handle to identify the Product by.", + "type": "string" + }, + "status": { + "description": "The status of the product.", + "type": "string", + "enum": [ + "draft", + "proposed", + "published", + "rejected" + ], + "default": "draft" + }, + "type": { + "description": "The Product Type to associate the Product with.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "id": { + "description": "The ID of the Product Type.", + "type": "string" + }, + "value": { + "description": "The value of the Product Type.", + "type": "string" + } + } + }, + "collection_id": { + "description": "The ID of the Collection the Product should belong to.", + "type": "string" + }, + "tags": { + "description": "Tags to associate the Product with.", + "type": "array", + "items": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "id": { + "description": "The ID of an existing Tag.", + "type": "string" + }, + "value": { + "description": "The value of the Tag, these will be upserted.", + "type": "string" + } + } + } + }, + "sales_channels": { + "description": "[EXPERIMENTAL] Sales channels to associate the Product with.", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of an existing Sales channel.", + "type": "string" + } + } + } + }, + "categories": { + "description": "Categories to add the Product to.", + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The ID of a Product Category.", + "type": "string" + } + } + } + }, + "options": { + "description": "The Options that the Product should have. These define on which properties the Product's Product Variants will differ.", + "type": "array", + "items": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "description": "The title to identify the Product Option by.", + "type": "string" + } + } + } + }, + "variants": { + "description": "A list of Product Variants to create with the Product.", + "type": "array", + "items": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "description": "The title to identify the Product Variant by.", + "type": "string" + }, + "sku": { + "description": "The unique SKU for the Product Variant.", + "type": "string" + }, + "ean": { + "description": "The EAN number of the item.", + "type": "string" + }, + "upc": { + "description": "The UPC number of the item.", + "type": "string" + }, + "barcode": { + "description": "A generic GTIN field for the Product Variant.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code for the Product Variant.", + "type": "string" + }, + "inventory_quantity": { + "description": "The amount of stock kept for the Product Variant.", + "type": "integer", + "default": 0 + }, + "allow_backorder": { + "description": "Whether the Product Variant can be purchased when out of stock.", + "type": "boolean" + }, + "manage_inventory": { + "description": "Whether Medusa should keep track of the inventory for this Product Variant.", + "type": "boolean" + }, + "weight": { + "description": "The wieght of the Product Variant.", + "type": "number" + }, + "length": { + "description": "The length of the Product Variant.", + "type": "number" + }, + "height": { + "description": "The height of the Product Variant.", + "type": "number" + }, + "width": { + "description": "The width of the Product Variant.", + "type": "number" + }, + "origin_country": { + "description": "The country of origin of the Product Variant.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product Variant.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product Variant.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "prices": { + "type": "array", + "items": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "region_id": { + "description": "The ID of the Region for which the price is used. Only required if currency_code is not provided.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "options": { + "type": "array", + "items": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "description": "The value to give for the Product Option at the same index in the Product's `options` field.", + "type": "string" + } + } + } + } + } + } + }, + "weight": { + "description": "The weight of the Product.", + "type": "number" + }, + "length": { + "description": "The length of the Product.", + "type": "number" + }, + "height": { + "description": "The height of the Product.", + "type": "number" + }, + "width": { + "description": "The width of the Product.", + "type": "number" + }, + "hs_code": { + "description": "The Harmonized System code for the Product Variant.", + "type": "string" + }, + "origin_country": { + "description": "The country of origin of the Product.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturer Identification code for the Product.", + "type": "string" + }, + "material": { + "description": "The material composition of the Product.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostProductsToCollectionReq": { + "type": "object", + "required": [ + "product_ids" + ], + "properties": { + "product_ids": { + "description": "An array of Product IDs to add to the Product Collection.", + "type": "array", + "items": { + "description": "The ID of a Product to add to the Product Collection.", + "type": "string" + } + } + } + }, + "AdminPostPublishableApiKeySalesChannelsBatchReq": { + "type": "object", + "required": [ + "sales_channel_ids" + ], + "properties": { + "sales_channel_ids": { + "description": "The IDs of the sales channels to add to the publishable api key", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the sales channel" + } + } + } + } + } + }, + "AdminPostPublishableApiKeysPublishableApiKeyReq": { + "type": "object", + "properties": { + "title": { + "description": "A title to update for the key.", + "type": "string" + } + } + }, + "AdminPostPublishableApiKeysReq": { + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "description": "A title for the publishable api key", + "type": "string" + } + } + }, + "AdminPostRegionsRegionCountriesReq": { + "type": "object", + "required": [ + "country_code" + ], + "properties": { + "country_code": { + "description": "The 2 character ISO code for the Country.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + } + } + } + }, + "AdminPostRegionsRegionFulfillmentProvidersReq": { + "type": "object", + "required": [ + "provider_id" + ], + "properties": { + "provider_id": { + "description": "The ID of the Fulfillment Provider to add.", + "type": "string" + } + } + }, + "AdminPostRegionsRegionPaymentProvidersReq": { + "type": "object", + "required": [ + "provider_id" + ], + "properties": { + "provider_id": { + "description": "The ID of the Payment Provider to add.", + "type": "string" + } + } + }, + "AdminPostRegionsRegionReq": { + "type": "object", + "properties": { + "name": { + "description": "The name of the Region", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code to use for the Region.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "automatic_taxes": { + "description": "If true Medusa will automatically calculate taxes for carts in this region. If false you have to manually call POST /carts/:id/taxes.", + "type": "boolean" + }, + "gift_cards_taxable": { + "description": "Whether gift cards in this region should be applied sales tax when purchasing a gift card", + "type": "boolean" + }, + "tax_provider_id": { + "description": "The ID of the tax provider to use; if null the system tax provider is used", + "type": "string" + }, + "tax_code": { + "description": "An optional tax code the Region.", + "type": "string" + }, + "tax_rate": { + "description": "The tax rate to use on Orders in the Region.", + "type": "number" + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Tax included in prices of region", + "type": "boolean" + }, + "payment_providers": { + "description": "A list of Payment Provider IDs that should be enabled for the Region", + "type": "array", + "items": { + "type": "string" + } + }, + "fulfillment_providers": { + "description": "A list of Fulfillment Provider IDs that should be enabled for the Region", + "type": "array", + "items": { + "type": "string" + } + }, + "countries": { + "description": "A list of countries' 2 ISO Characters that should be included in the Region.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AdminPostRegionsReq": { + "type": "object", + "required": [ + "name", + "currency_code", + "tax_rate", + "payment_providers", + "fulfillment_providers", + "countries" + ], + "properties": { + "name": { + "description": "The name of the Region", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code to use for the Region.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "tax_code": { + "description": "An optional tax code the Region.", + "type": "string" + }, + "tax_rate": { + "description": "The tax rate to use on Orders in the Region.", + "type": "number" + }, + "payment_providers": { + "description": "A list of Payment Provider IDs that should be enabled for the Region", + "type": "array", + "items": { + "type": "string" + } + }, + "fulfillment_providers": { + "description": "A list of Fulfillment Provider IDs that should be enabled for the Region", + "type": "array", + "items": { + "type": "string" + } + }, + "countries": { + "description": "A list of countries' 2 ISO Characters that should be included in the Region.", + "example": [ + "US" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Tax included in prices of region", + "type": "boolean" + } + } + }, + "AdminPostReservationsReq": { + "type": "object", + "required": [ + "location_id", + "inventory_item_id", + "quantity" + ], + "properties": { + "line_item_id": { + "description": "The id of the location of the reservation", + "type": "string" + }, + "location_id": { + "description": "The id of the location of the reservation", + "type": "string" + }, + "inventory_item_id": { + "description": "The id of the inventory item the reservation relates to", + "type": "string" + }, + "quantity": { + "description": "The id of the reservation item", + "type": "number" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostReservationsReservationReq": { + "type": "object", + "properties": { + "location_id": { + "description": "The id of the location of the reservation", + "type": "string" + }, + "quantity": { + "description": "The id of the reservation item", + "type": "number" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostReturnReasonsReasonReq": { + "type": "object", + "properties": { + "label": { + "description": "The label to display to the Customer.", + "type": "string" + }, + "value": { + "description": "The value that the Return Reason will be identified by. Must be unique.", + "type": "string" + }, + "description": { + "description": "An optional description to for the Reason.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostReturnReasonsReq": { + "type": "object", + "required": [ + "label", + "value" + ], + "properties": { + "label": { + "description": "The label to display to the Customer.", + "type": "string" + }, + "value": { + "description": "The value that the Return Reason will be identified by. Must be unique.", + "type": "string" + }, + "parent_return_reason_id": { + "description": "The ID of the parent return reason.", + "type": "string" + }, + "description": { + "description": "An optional description to for the Reason.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostReturnsReturnReceiveReq": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of the Line Item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + } + } + } + }, + "refund": { + "description": "The amount to refund.", + "type": "number" + } + } + }, + "AdminPostSalesChannelsChannelProductsBatchReq": { + "type": "object", + "required": [ + "product_ids" + ], + "properties": { + "product_ids": { + "description": "The IDs of the products to add to the Sales Channel", + "type": "array", + "items": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the product" + } + } + } + } + } + }, + "AdminPostSalesChannelsChannelStockLocationsReq": { + "type": "object", + "required": [ + "location_id" + ], + "properties": { + "location_id": { + "description": "The ID of the stock location", + "type": "string" + } + } + }, + "AdminPostSalesChannelsReq": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "The name of the Sales Channel", + "type": "string" + }, + "description": { + "description": "The description of the Sales Channel", + "type": "string" + }, + "is_disabled": { + "description": "Whether the Sales Channel is disabled or not.", + "type": "boolean" + } + } + }, + "AdminPostSalesChannelsSalesChannelReq": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the sales channel." + }, + "description": { + "type": "string", + "description": "Sales Channel description." + }, + "is_disabled": { + "type": "boolean", + "description": "Indication of if the sales channel is active." + } + } + }, + "AdminPostShippingOptionsOptionReq": { + "type": "object", + "required": [ + "requirements" + ], + "properties": { + "name": { + "description": "The name of the Shipping Option", + "type": "string" + }, + "amount": { + "description": "The amount to charge for the Shipping Option.", + "type": "integer" + }, + "admin_only": { + "description": "If true, the option can be used for draft orders", + "type": "boolean" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "requirements": { + "description": "The requirements that must be satisfied for the Shipping Option to be available.", + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "amount" + ], + "properties": { + "id": { + "description": "The ID of the requirement", + "type": "string" + }, + "type": { + "description": "The type of the requirement", + "type": "string", + "enum": [ + "max_subtotal", + "min_subtotal" + ] + }, + "amount": { + "description": "The amount to compare with.", + "type": "integer" + } + } + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Tax included in prices of shipping option", + "type": "boolean" + } + } + }, + "AdminPostShippingOptionsReq": { + "type": "object", + "required": [ + "name", + "region_id", + "provider_id", + "data", + "price_type" + ], + "properties": { + "name": { + "description": "The name of the Shipping Option", + "type": "string" + }, + "region_id": { + "description": "The ID of the Region in which the Shipping Option will be available.", + "type": "string" + }, + "provider_id": { + "description": "The ID of the Fulfillment Provider that handles the Shipping Option.", + "type": "string" + }, + "profile_id": { + "description": "The ID of the Shipping Profile to add the Shipping Option to.", + "type": "number" + }, + "data": { + "description": "The data needed for the Fulfillment Provider to handle shipping with this Shipping Option.", + "type": "object" + }, + "price_type": { + "description": "The type of the Shipping Option price.", + "type": "string", + "enum": [ + "flat_rate", + "calculated" + ] + }, + "amount": { + "description": "The amount to charge for the Shipping Option.", + "type": "integer" + }, + "requirements": { + "description": "The requirements that must be satisfied for the Shipping Option to be available.", + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "amount" + ], + "properties": { + "type": { + "description": "The type of the requirement", + "type": "string", + "enum": [ + "max_subtotal", + "min_subtotal" + ] + }, + "amount": { + "description": "The amount to compare with.", + "type": "integer" + } + } + } + }, + "is_return": { + "description": "Whether the Shipping Option defines a return shipment.", + "type": "boolean", + "default": false + }, + "admin_only": { + "description": "If true, the option can be used for draft orders", + "type": "boolean", + "default": false + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Tax included in prices of shipping option", + "type": "boolean" + } + } + }, + "AdminPostShippingProfilesProfileReq": { + "type": "object", + "properties": { + "name": { + "description": "The name of the Shipping Profile", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, + "type": { + "description": "The type of the Shipping Profile", + "type": "string", + "enum": [ + "default", + "gift_card", + "custom" + ] + }, + "products": { + "description": "An optional array of product ids to associate with the Shipping Profile", + "type": "array" + }, + "shipping_options": { + "description": "An optional array of shipping option ids to associate with the Shipping Profile", + "type": "array" + } + } + }, + "AdminPostShippingProfilesReq": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "The name of the Shipping Profile", + "type": "string" + }, + "type": { + "description": "The type of the Shipping Profile", + "type": "string", + "enum": [ + "default", + "gift_card", + "custom" + ] + } + } + }, + "AdminPostStockLocationsLocationReq": { + "type": "object", + "properties": { + "name": { + "description": "the name of the stock location", + "type": "string" + }, + "address_id": { + "description": "the stock location address ID", + "type": "string" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "address": { + "$ref": "#/components/schemas/StockLocationAddressInput" + } + } + }, + "AdminPostStockLocationsReq": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "the name of the stock location", + "type": "string" + }, + "address_id": { + "description": "the stock location address ID", + "type": "string" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "address": { + "$ref": "#/components/schemas/StockLocationAddressInput" + } + } + }, + "AdminPostStoreReq": { + "type": "object", + "properties": { + "name": { + "description": "The name of the Store", + "type": "string" + }, + "swap_link_template": { + "description": "A template for Swap links - use `{{cart_id}}` to insert the Swap Cart id", + "type": "string" + }, + "payment_link_template": { + "description": "A template for payment links links - use `{{cart_id}}` to insert the Cart id", + "type": "string" + }, + "invite_link_template": { + "description": "A template for invite links - use `{{invite_token}}` to insert the invite token", + "type": "string" + }, + "default_currency_code": { + "description": "The default currency code for the Store.", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currencies": { + "description": "Array of currencies in 2 character ISO code format.", + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminPostTaxRatesReq": { + "type": "object", + "required": [ + "code", + "name", + "region_id" + ], + "properties": { + "code": { + "type": "string", + "description": "A code to identify the tax type by" + }, + "name": { + "type": "string", + "description": "A human friendly name for the tax" + }, + "region_id": { + "type": "string", + "description": "The ID of the Region that the rate belongs to" + }, + "rate": { + "type": "number", + "description": "The numeric rate to charge" + }, + "products": { + "type": "array", + "description": "The IDs of the products associated with this tax rate", + "items": { + "type": "string" + } + }, + "shipping_options": { + "type": "array", + "description": "The IDs of the shipping options associated with this tax rate", + "items": { + "type": "string" + } + }, + "product_types": { + "type": "array", + "description": "The IDs of the types of products associated with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminPostTaxRatesTaxRateProductTypesReq": { + "type": "object", + "required": [ + "product_types" + ], + "properties": { + "product_types": { + "type": "array", + "description": "The IDs of the types of products to associate with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminPostTaxRatesTaxRateProductsReq": { + "type": "object", + "required": [ + "products" + ], + "properties": { + "products": { + "type": "array", + "description": "The IDs of the products to associate with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminPostTaxRatesTaxRateReq": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "A code to identify the tax type by" + }, + "name": { + "type": "string", + "description": "A human friendly name for the tax" + }, + "region_id": { + "type": "string", + "description": "The ID of the Region that the rate belongs to" + }, + "rate": { + "type": "number", + "description": "The numeric rate to charge" + }, + "products": { + "type": "array", + "description": "The IDs of the products associated with this tax rate", + "items": { + "type": "string" + } + }, + "shipping_options": { + "type": "array", + "description": "The IDs of the shipping options associated with this tax rate", + "items": { + "type": "string" + } + }, + "product_types": { + "type": "array", + "description": "The IDs of the types of products associated with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminPostTaxRatesTaxRateShippingOptionsReq": { + "type": "object", + "required": [ + "shipping_options" + ], + "properties": { + "shipping_options": { + "type": "array", + "description": "The IDs of the shipping options to associate with this tax rate", + "items": { + "type": "string" + } + } + } + }, + "AdminPostUploadsDownloadUrlReq": { + "type": "object", + "required": [ + "file_key" + ], + "properties": { + "file_key": { + "description": "key of the file to obtain the download link for", + "type": "string" + } + } + }, + "AdminPriceListDeleteBatchRes": { + "type": "object", + "required": [ + "ids", + "object", + "deleted" + ], + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string", + "description": "The IDs of the deleted Money Amounts (Prices)." + } + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "money-amount" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminPriceListDeleteProductPricesRes": { + "type": "object", + "required": [ + "ids", + "object", + "deleted" + ], + "properties": { + "ids": { + "type": "array", + "description": "The price ids that have been deleted.", + "items": { + "type": "string" + } + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "money-amount" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminPriceListDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Price List." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "price-list" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminPriceListDeleteVariantPricesRes": { + "type": "object", + "required": [ + "ids", + "object", + "deleted" + ], + "properties": { + "ids": { + "type": "array", + "description": "The price ids that have been deleted.", + "items": { + "type": "string" + } + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "money-amount" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminPriceListRes": { + "type": "object", + "x-expanded-relations": { + "field": "price_list", + "relations": [ + "customer_groups", + "prices" + ] + }, + "required": [ + "price_list" + ], + "properties": { + "price_list": { + "$ref": "#/components/schemas/PriceList" + } + } + }, + "AdminPriceListsListRes": { + "type": "object", + "required": [ + "price_lists", + "count", + "offset", + "limit" + ], + "properties": { + "price_lists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PriceList" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminPriceListsProductsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "products", + "relations": [ + "categories", + "collection", + "images", + "options", + "tags", + "type", + "variants", + "variants.options" + ] + }, + "required": [ + "products", + "count", + "offset", + "limit" + ], + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminProductCategoriesCategoryDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted product category" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "product-category" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminProductCategoriesCategoryRes": { + "type": "object", + "x-expanded-relations": { + "field": "product_category", + "relations": [ + "category_children", + "parent_category" + ] + }, + "required": [ + "product_category" + ], + "properties": { + "product_category": { + "$ref": "#/components/schemas/ProductCategory" + } + } + }, + "AdminProductCategoriesListRes": { + "type": "object", + "x-expanded-relations": { + "field": "product_categories", + "relations": [ + "category_children", + "parent_category" + ] + }, + "required": [ + "product_categories", + "count", + "offset", + "limit" + ], + "properties": { + "product_categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCategory" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminProductTagsListRes": { + "type": "object", + "required": [ + "product_tags", + "count", + "offset", + "limit" + ], + "properties": { + "product_tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductTag" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminProductTypesListRes": { + "type": "object", + "required": [ + "product_types", + "count", + "offset", + "limit" + ], + "properties": { + "product_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminProductsDeleteOptionRes": { + "type": "object", + "x-expanded-relations": { + "field": "product", + "relations": [ + "collection", + "images", + "options", + "tags", + "type", + "variants", + "variants.options", + "variants.prices" + ] + }, + "required": [ + "option_id", + "object", + "deleted", + "product" + ], + "properties": { + "option_id": { + "type": "string", + "description": "The ID of the deleted Product Option" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "option" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + }, + "product": { + "$ref": "#/components/schemas/PricedProduct" + } + } + }, + "AdminProductsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Product." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "product" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminProductsDeleteVariantRes": { + "type": "object", + "x-expanded-relations": { + "field": "product", + "relations": [ + "collection", + "images", + "options", + "tags", + "type", + "variants", + "variants.options", + "variants.prices" + ] + }, + "required": [ + "variant_id", + "object", + "deleted", + "product" + ], + "properties": { + "variant_id": { + "type": "string", + "description": "The ID of the deleted Product Variant." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "product-variant" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + }, + "product": { + "$ref": "#/components/schemas/PricedProduct" + } + } + }, + "AdminProductsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "products", + "relations": [ + "collection", + "images", + "options", + "tags", + "type", + "variants", + "variants.options", + "variants.prices" + ] + }, + "required": [ + "products", + "count", + "offset", + "limit" + ], + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedProduct" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminProductsListTagsRes": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "usage_count", + "value" + ], + "properties": { + "id": { + "description": "The ID of the tag.", + "type": "string" + }, + "usage_count": { + "description": "The number of products that use this tag.", + "type": "string" + }, + "value": { + "description": "The value of the tag.", + "type": "string" + } + } + } + } + } + }, + "AdminProductsListTypesRes": { + "type": "object", + "required": [ + "types" + ], + "properties": { + "types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + } + } + }, + "AdminProductsListVariantsRes": { + "type": "object", + "required": [ + "variants", + "count", + "offset", + "limit" + ], + "properties": { + "variants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductVariant" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminProductsRes": { + "type": "object", + "x-expanded-relations": { + "field": "product", + "relations": [ + "collection", + "images", + "options", + "tags", + "type", + "variants", + "variants.options", + "variants.prices" + ] + }, + "required": [ + "product" + ], + "properties": { + "product": { + "$ref": "#/components/schemas/PricedProduct" + } + } + }, + "AdminPublishableApiKeyDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted PublishableApiKey." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "publishable_api_key" + }, + "deleted": { + "type": "boolean", + "description": "Whether the PublishableApiKeys was deleted.", + "default": true + } + } + }, + "AdminPublishableApiKeysListRes": { + "type": "object", + "required": [ + "publishable_api_keys", + "count", + "offset", + "limit" + ], + "properties": { + "publishable_api_keys": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublishableApiKey" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminPublishableApiKeysListSalesChannelsRes": { + "type": "object", + "required": [ + "sales_channels" + ], + "properties": { + "sales_channels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SalesChannel" + } + } + } + }, + "AdminPublishableApiKeysRes": { + "type": "object", + "required": [ + "publishable_api_key" + ], + "properties": { + "publishable_api_key": { + "$ref": "#/components/schemas/PublishableApiKey" + } + } + }, + "AdminRefundRes": { + "type": "object", + "required": [ + "refund" + ], + "properties": { + "refund": { + "$ref": "#/components/schemas/Refund" + } + } + }, + "AdminRegionsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Region." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "region" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminRegionsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "regions", + "relations": [ + "countries", + "fulfillment_providers", + "payment_providers" + ], + "eager": [ + "fulfillment_providers", + "payment_providers" + ] + }, + "required": [ + "regions", + "count", + "offset", + "limit" + ], + "properties": { + "regions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Region" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminRegionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "region", + "relations": [ + "countries", + "fulfillment_providers", + "payment_providers" + ], + "eager": [ + "fulfillment_providers", + "payment_providers" + ] + }, + "required": [ + "region" + ], + "properties": { + "region": { + "$ref": "#/components/schemas/Region" + } + } + }, + "AdminReservationsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Reservation." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "reservation" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the Reservation was deleted.", + "default": true + } + } + }, + "AdminReservationsListRes": { + "type": "object", + "required": [ + "reservations", + "count", + "offset", + "limit" + ], + "properties": { + "reservations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReservationItemDTO" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminReservationsRes": { + "type": "object", + "required": [ + "reservation" + ], + "properties": { + "reservation": { + "$ref": "#/components/schemas/ReservationItemDTO" + } + } + }, + "AdminResetPasswordRequest": { + "type": "object", + "required": [ + "token", + "password" + ], + "properties": { + "email": { + "description": "The Users email.", + "type": "string", + "format": "email" + }, + "token": { + "description": "The token generated from the 'password-token' endpoint.", + "type": "string" + }, + "password": { + "description": "The Users new password.", + "type": "string", + "format": "password" + } + } + }, + "AdminResetPasswordTokenRequest": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "description": "The Users email.", + "type": "string", + "format": "email" + } + } + }, + "AdminReturnReasonsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted return reason" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "return_reason" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminReturnReasonsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "return_reasons", + "relations": [ + "parent_return_reason", + "return_reason_children" + ] + }, + "required": [ + "return_reasons" + ], + "properties": { + "return_reasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReturnReason" + } + } + } + }, + "AdminReturnReasonsRes": { + "type": "object", + "x-expanded-relations": { + "field": "return_reason", + "relations": [ + "parent_return_reason", + "return_reason_children" + ] + }, + "required": [ + "return_reason" + ], + "properties": { + "return_reason": { + "$ref": "#/components/schemas/ReturnReason" + } + } + }, + "AdminReturnsCancelRes": { + "type": "object", + "x-expanded-relations": { + "field": "order", + "relations": [ + "billing_address", + "claims", + "claims.additional_items", + "claims.additional_items.variant", + "claims.claim_items", + "claims.claim_items.images", + "claims.claim_items.item", + "claims.fulfillments", + "claims.fulfillments.tracking_links", + "claims.return_order", + "claims.return_order.shipping_method", + "claims.return_order.shipping_method.tax_lines", + "claims.shipping_address", + "claims.shipping_methods", + "customer", + "discounts", + "discounts.rule", + "fulfillments", + "fulfillments.items", + "fulfillments.tracking_links", + "gift_card_transactions", + "gift_cards", + "items", + "payments", + "refunds", + "region", + "returns", + "returns.items", + "returns.items.reason", + "returns.shipping_method", + "returns.shipping_method.tax_lines", + "shipping_address", + "shipping_methods", + "swaps", + "swaps.additional_items", + "swaps.additional_items.variant", + "swaps.fulfillments", + "swaps.fulfillments.tracking_links", + "swaps.payment", + "swaps.return_order", + "swaps.return_order.shipping_method", + "swaps.return_order.shipping_method.tax_lines", + "swaps.shipping_address", + "swaps.shipping_methods", + "swaps.shipping_methods.tax_lines" + ] + }, + "required": [ + "order" + ], + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + } + } + }, + "AdminReturnsListRes": { + "type": "object", + "x-expanded-relation": { + "field": "returns", + "relations": [ + "order", + "swap" + ] + }, + "required": [ + "returns", + "count", + "offset", + "limit" + ], + "properties": { + "returns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Return" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminReturnsRes": { + "type": "object", + "x-expanded-relation": { + "field": "return", + "relations": [ + "swap" + ] + }, + "required": [ + "return" + ], + "properties": { + "return": { + "$ref": "#/components/schemas/Return" + } + } + }, + "AdminSalesChannelsDeleteLocationRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the removed stock location from a sales channel" + }, + "object": { + "type": "string", + "description": "The type of the object that was removed.", + "default": "stock-location" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminSalesChannelsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted sales channel" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "sales-channel" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminSalesChannelsListRes": { + "type": "object", + "required": [ + "sales_channels", + "count", + "offset", + "limit" + ], + "properties": { + "sales_channels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SalesChannel" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminSalesChannelsRes": { + "type": "object", + "required": [ + "sales_channel" + ], + "properties": { + "sales_channel": { + "$ref": "#/components/schemas/SalesChannel" + } + } + }, + "AdminShippingOptionsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Shipping Option." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "shipping-option" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminShippingOptionsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "shipping_options", + "relations": [ + "profile", + "region", + "requirements" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers" + ] + }, + "required": [ + "shipping_options", + "count", + "offset", + "limit" + ], + "properties": { + "shipping_options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingOption" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminShippingOptionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "shipping_option", + "relations": [ + "profile", + "region", + "requirements" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers" + ] + }, + "required": [ + "shipping_option" + ], + "properties": { + "shipping_option": { + "$ref": "#/components/schemas/ShippingOption" + } + } + }, + "AdminShippingProfilesListRes": { + "type": "object", + "required": [ + "shipping_profiles" + ], + "properties": { + "shipping_profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingProfile" + } + } + } + }, + "AdminShippingProfilesRes": { + "type": "object", + "x-expanded-relations": { + "field": "shipping_profile", + "relations": [ + "products", + "shipping_options" + ] + }, + "required": [ + "shipping_profile" + ], + "properties": { + "shipping_profile": { + "$ref": "#/components/schemas/ShippingProfile" + } + } + }, + "AdminStockLocationsDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Stock Location." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "stock_location" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminStockLocationsListRes": { + "type": "object", + "required": [ + "stock_locations", + "count", + "offset", + "limit" + ], + "properties": { + "stock_locations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StockLocationExpandedDTO" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminStockLocationsRes": { + "type": "object", + "required": [ + "stock_location" + ], + "properties": { + "stock_location": { + "$ref": "#/components/schemas/StockLocationExpandedDTO" + } + } + }, + "AdminStoresRes": { + "type": "object", + "required": [ + "store" + ], + "properties": { + "store": { + "$ref": "#/components/schemas/Store" + } + } + }, + "AdminSwapsListRes": { + "type": "object", + "required": [ + "swaps", + "count", + "offset", + "limit" + ], + "properties": { + "swaps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Swap" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminSwapsRes": { + "type": "object", + "x-expanded-relations": { + "field": "swap", + "relations": [ + "additional_items", + "additional_items.adjustments", + "cart", + "cart.items", + "cart.items.adjustments", + "cart.items.variant", + "fulfillments", + "order", + "payment", + "return_order", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "fulfillments.items", + "shipping_methods.shipping_option" + ] + }, + "required": [ + "swap" + ], + "properties": { + "swap": { + "$ref": "#/components/schemas/Swap" + } + } + }, + "AdminTaxProvidersList": { + "type": "object", + "required": [ + "tax_providers" + ], + "properties": { + "tax_providers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxProvider" + } + } + } + }, + "AdminTaxRatesDeleteRes": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the deleted Shipping Option." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted.", + "default": "tax-rate" + }, + "deleted": { + "type": "boolean", + "description": "Whether or not the items were deleted.", + "default": true + } + } + }, + "AdminTaxRatesListRes": { + "type": "object", + "required": [ + "tax_rates", + "count", + "offset", + "limit" + ], + "properties": { + "tax_rates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxRate" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminTaxRatesRes": { + "type": "object", + "required": [ + "tax_rate" + ], + "properties": { + "tax_rate": { + "$ref": "#/components/schemas/TaxRate" + } + } + }, + "AdminUpdatePaymentCollectionsReq": { + "type": "object", + "properties": { + "description": { + "description": "An optional description to create or update the payment collection.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + }, + "AdminUpdateUserRequest": { + "type": "object", + "properties": { + "first_name": { + "description": "The name of the User.", + "type": "string" + }, + "last_name": { + "description": "The name of the User.", + "type": "string" + }, + "role": { + "description": "Userrole assigned to the user.", + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ] + }, + "api_token": { + "description": "The api token of the User.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + }, + "AdminUploadsDownloadUrlRes": { + "type": "object", + "required": [ + "download_url" + ], + "properties": { + "download_url": { + "description": "The Download URL of the file", + "type": "string" + } + } + }, + "AdminUploadsRes": { + "type": "object", + "required": [ + "uploads" + ], + "properties": { + "uploads": { + "type": "array", + "items": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "description": "The URL of the uploaded file.", + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "AdminUserRes": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "$ref": "#/components/schemas/User" + } + } + }, + "AdminUsersListRes": { + "type": "object", + "required": [ + "users" + ], + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "AdminVariantsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "variants", + "relations": [ + "options", + "prices", + "product" + ] + }, + "required": [ + "variants", + "count", + "offset", + "limit" + ], + "properties": { + "variants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedVariant" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "AdminVariantsRes": { + "type": "object", + "x-expanded-relations": { + "field": "variant", + "relations": [ + "options", + "prices", + "product" + ] + }, + "required": [ + "variant" + ], + "properties": { + "variant": { + "$ref": "#/components/schemas/PricedVariant" + } + } + }, + "BatchJob": { + "title": "Batch Job", + "description": "A Batch Job.", + "type": "object", + "required": [ + "canceled_at", + "completed_at", + "confirmed_at", + "context", + "created_at", + "created_by", + "deleted_at", + "dry_run", + "failed_at", + "id", + "pre_processed_at", + "processing_at", + "result", + "status", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The unique identifier for the batch job.", + "type": "string", + "example": "batch_01G8T782965PYFG0751G0Z38B4" + }, + "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", + "confirmed", + "processing", + "completed", + "canceled", + "failed" + ], + "default": "created" + }, + "created_by": { + "description": "The unique identifier of the user that created the batch job.", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "created_by_user": { + "description": "A user object. Available if the relation `created_by_user` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/User" + }, + "context": { + "description": "The context of the batch job, the type of the batch job determines what the context should contain.", + "nullable": true, + "type": "object", + "example": { + "shape": { + "prices": [ + { + "region": null, + "currency_code": "eur" + } + ], + "dynamicImageColumnCount": 4, + "dynamicOptionColumnCount": 2 + }, + "list_config": { + "skip": 0, + "take": 50, + "order": { + "created_at": "DESC" + }, + "relations": [ + "variants", + "variant.prices", + "images" + ] + } + } + }, + "dry_run": { + "description": "Specify if the job must apply the modifications or not.", + "type": "boolean", + "default": false + }, + "result": { + "description": "The result of the batch job.", + "nullable": true, + "allOf": [ + { + "type": "object", + "example": {} + }, + { + "type": "object", + "properties": { + "count": { + "type": "number" + }, + "advancement_count": { + "type": "number" + }, + "progress": { + "type": "number" + }, + "errors": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "err": { + "type": "array" + } + } + }, + "stat_descriptors": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "file_key": { + "type": "string" + }, + "file_size": { + "type": "number" + } + } + } + ], + "example": { + "errors": [ + { + "err": [], + "code": "unknown", + "message": "Method not implemented." + } + ], + "stat_descriptors": [ + { + "key": "product-export-count", + "name": "Product count to export", + "message": "There will be 8 products exported by this action" + } + ] + } + }, + "pre_processed_at": { + "description": "The date from which the job has been pre-processed.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "processing_at": { + "description": "The date the job is processing at.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "confirmed_at": { + "description": "The date when the confirmation has been done.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date of the completion.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date of the concellation.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "failed_at": { + "description": "The date when the job failed.", + "nullable": true, + "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.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "Cart": { + "title": "Cart", + "description": "Represents a user cart", + "type": "object", + "required": [ + "billing_address_id", + "completed_at", + "context", + "created_at", + "customer_id", + "deleted_at", + "email", + "id", + "idempotency_key", + "metadata", + "payment_authorized_at", + "payment_id", + "payment_session", + "region_id", + "shipping_address_id", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The cart's ID", + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "email": { + "description": "The email associated with the cart", + "nullable": true, + "type": "string", + "format": "email" + }, + "billing_address_id": { + "description": "The billing address's ID", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "billing_address": { + "description": "Available if the relation `billing_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_address_id": { + "description": "The shipping address's ID", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "items": { + "description": "Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "discounts": { + "description": "Available if the relation `discounts` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Discount" + } + }, + "gift_cards": { + "description": "Available if the relation `gift_cards` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + } + }, + "customer_id": { + "description": "The customer's ID", + "nullable": true, + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "A customer object. Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "payment_session": { + "description": "The selected payment session in the cart.", + "nullable": true, + "$ref": "#/components/schemas/PaymentSession" + }, + "payment_sessions": { + "description": "The payment sessions created on the cart.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentSession" + } + }, + "payment_id": { + "description": "The payment's ID if available", + "nullable": true, + "type": "string", + "example": "pay_01G8ZCC5W42ZNY842124G7P5R9" + }, + "payment": { + "description": "Available if the relation `payment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Payment" + }, + "shipping_methods": { + "description": "The shipping methods added to the cart.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "type": { + "description": "The cart's type.", + "type": "string", + "enum": [ + "default", + "swap", + "draft_order", + "payment_link", + "claim" + ], + "default": "default" + }, + "completed_at": { + "description": "The date with timezone at which the cart was completed.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "payment_authorized_at": { + "description": "The date with timezone at which the payment was authorized.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a cart in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "context": { + "description": "The context of the cart which can include info like IP or user agent.", + "nullable": true, + "type": "object", + "example": { + "ip": "::1", + "user_agent": "PostmanRuntime/7.29.2" + } + }, + "sales_channel_id": { + "description": "The sales channel ID the cart is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channel": { + "description": "A sales channel object. Available if the relation `sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + }, + "shipping_total": { + "description": "The total of shipping", + "type": "integer", + "example": 1000 + }, + "discount_total": { + "description": "The total of discount rounded", + "type": "integer", + "example": 800 + }, + "raw_discount_total": { + "description": "The total of discount", + "type": "integer", + "example": 800 + }, + "item_tax_total": { + "description": "The total of items with taxes", + "type": "integer", + "example": 8000 + }, + "shipping_tax_total": { + "description": "The total of shipping with taxes", + "type": "integer", + "example": 1000 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + }, + "refunded_total": { + "description": "The total amount refunded if the order associated with this cart is returned.", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the cart", + "type": "integer", + "example": 8200 + }, + "subtotal": { + "description": "The subtotal of the cart", + "type": "integer", + "example": 8000 + }, + "refundable_amount": { + "description": "The amount that can be refunded", + "type": "integer", + "example": 8200 + }, + "gift_card_total": { + "description": "The total of gift cards", + "type": "integer", + "example": 0 + }, + "gift_card_tax_total": { + "description": "The total of gift cards with taxes", + "type": "integer", + "example": 0 + } + } + }, + "ClaimImage": { + "title": "Claim Image", + "description": "Represents photo documentation of a claim.", + "type": "object", + "required": [ + "claim_item_id", + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "url" + ], + "properties": { + "id": { + "description": "The claim image's ID", + "type": "string", + "example": "cimg_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "claim_item_id": { + "description": "The ID of the claim item associated with the image", + "type": "string" + }, + "claim_item": { + "description": "A claim item object. Available if the relation `claim_item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimItem" + }, + "url": { + "description": "The URL of the image", + "type": "string", + "format": "uri" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ClaimItem": { + "title": "Claim Item", + "description": "Represents a claimed item along with information about the reasons for the claim.", + "type": "object", + "required": [ + "claim_order_id", + "created_at", + "deleted_at", + "id", + "item_id", + "metadata", + "note", + "quantity", + "reason", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The claim item's ID", + "type": "string", + "example": "citm_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "images": { + "description": "Available if the relation `images` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimImage" + } + }, + "claim_order_id": { + "description": "The ID of the claim this item is associated with.", + "type": "string" + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "item_id": { + "description": "The ID of the line item that the claim item refers to.", + "type": "string", + "example": "item_01G8ZM25TN49YV9EQBE2NC27KC" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "variant_id": { + "description": "The ID of the product variant that is claimed.", + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "A variant object. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "reason": { + "description": "The reason for the claim", + "type": "string", + "enum": [ + "missing_item", + "wrong_item", + "production_failure", + "other" + ] + }, + "note": { + "description": "An optional note about the claim, for additional information", + "nullable": true, + "type": "string", + "example": "I don't like it." + }, + "quantity": { + "description": "The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order.", + "type": "integer", + "example": 1 + }, + "tags": { + "description": "User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimTag" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ClaimOrder": { + "title": "Claim Order", + "description": "Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns.", + "type": "object", + "required": [ + "canceled_at", + "created_at", + "deleted_at", + "fulfillment_status", + "id", + "idempotency_key", + "metadata", + "no_notification", + "order_id", + "payment_status", + "refund_amount", + "shipping_address_id", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The claim's ID", + "type": "string", + "example": "claim_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "type": { + "description": "The claim's type", + "type": "string", + "enum": [ + "refund", + "replace" + ] + }, + "payment_status": { + "description": "The status of the claim's payment", + "type": "string", + "enum": [ + "na", + "not_refunded", + "refunded" + ], + "default": "na" + }, + "fulfillment_status": { + "description": "The claim's fulfillment status", + "type": "string", + "enum": [ + "not_fulfilled", + "partially_fulfilled", + "fulfilled", + "partially_shipped", + "shipped", + "partially_returned", + "returned", + "canceled", + "requires_action" + ], + "default": "not_fulfilled" + }, + "claim_items": { + "description": "The items that have been claimed", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimItem" + } + }, + "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/LineItem" + } + }, + "order_id": { + "description": "The ID of the order that the claim comes from.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "return_order": { + "description": "A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "shipping_address_id": { + "description": "The ID of the address that the new items should be shipped to", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_methods": { + "description": "The shipping methods that the claim order will be shipped with.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "fulfillments": { + "description": "The fulfillments of the new items to be shipped", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + } + }, + "refund_amount": { + "description": "The amount that will be refunded in conjunction with the claim", + "nullable": true, + "type": "integer", + "example": 1000 + }, + "canceled_at": { + "description": "The date with timezone at which the claim was canceled.", + "nullable": true, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the cart associated with the claim in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + } + } + }, + "ClaimTag": { + "title": "Claim Tag", + "description": "Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The claim tag's ID", + "type": "string", + "example": "ctag_01G8ZCC5Y63B95V6B5SHBZ91S4" + }, + "value": { + "description": "The value that the claim tag holds", + "type": "string", + "example": "Damaged" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Country": { + "title": "Country", + "description": "Country details", + "type": "object", + "required": [ + "display_name", + "id", + "iso_2", + "iso_3", + "name", + "num_code", + "region_id" + ], + "properties": { + "id": { + "description": "The country's ID", + "type": "string", + "example": 109 + }, + "iso_2": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "example": "it", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "iso_3": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "example": "ita", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "num_code": { + "description": "The numerical ISO code for the country.", + "type": "string", + "example": 380, + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "name": { + "description": "The normalized country name in upper case.", + "type": "string", + "example": "ITALY" + }, + "display_name": { + "description": "The country name appropriate for display.", + "type": "string", + "example": "Italy" + }, + "region_id": { + "description": "The region ID this country is associated with.", + "nullable": true, + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + } + } + }, + "CreateStockLocationInput": { + "title": "Create Stock Location Input", + "description": "Represents the Input to create a Stock Location", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The stock location name" + }, + "address_id": { + "type": "string", + "description": "The Stock location address ID" + }, + "address": { + "description": "Stock location address object", + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationAddressInput" + }, + { + "type": "object" + } + ] + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "Currency": { + "title": "Currency", + "description": "Currency", + "type": "object", + "required": [ + "code", + "name", + "symbol", + "symbol_native" + ], + "properties": { + "code": { + "description": "The 3 character ISO code for the currency.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "symbol": { + "description": "The symbol used to indicate the currency.", + "type": "string", + "example": "$" + }, + "symbol_native": { + "description": "The native symbol used to indicate the currency.", + "type": "string", + "example": "$" + }, + "name": { + "description": "The written name of the currency", + "type": "string", + "example": "US Dollar" + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the currency prices include tax", + "type": "boolean", + "default": false + } + } + }, + "CustomShippingOption": { + "title": "Custom Shipping Option", + "description": "Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option", + "type": "object", + "required": [ + "cart_id", + "created_at", + "deleted_at", + "id", + "metadata", + "price", + "shipping_option_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The custom shipping option's ID", + "type": "string", + "example": "cso_01G8X99XNB77DMFBJFWX6DN9V9" + }, + "price": { + "description": "The custom price set that will override the shipping option's original price", + "type": "integer", + "example": 1000 + }, + "shipping_option_id": { + "description": "The ID of the Shipping Option that the custom shipping option overrides", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "shipping_option": { + "description": "A shipping option object. Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "cart_id": { + "description": "The ID of the Cart that the custom shipping option is attached to", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Customer": { + "title": "Customer", + "description": "Represents a customer", + "type": "object", + "required": [ + "billing_address_id", + "created_at", + "deleted_at", + "email", + "first_name", + "has_account", + "id", + "last_name", + "metadata", + "phone", + "updated_at" + ], + "properties": { + "id": { + "description": "The customer's ID", + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "email": { + "description": "The customer's email", + "type": "string", + "format": "email" + }, + "first_name": { + "description": "The customer's first name", + "nullable": true, + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "The customer's last name", + "nullable": true, + "type": "string", + "example": "Willms" + }, + "billing_address_id": { + "description": "The customer's billing address ID", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "billing_address": { + "description": "Available if the relation `billing_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_addresses": { + "description": "Available if the relation `shipping_addresses` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "phone": { + "description": "The customer's phone number", + "nullable": true, + "type": "string", + "example": 16128234334802 + }, + "has_account": { + "description": "Whether the customer has an account or not", + "type": "boolean", + "default": false + }, + "orders": { + "description": "Available if the relation `orders` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + } + }, + "groups": { + "description": "The customer groups the customer belongs to. Available if the relation `groups` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "CustomerGroup": { + "title": "Customer Group", + "description": "Represents a customer group", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "name", + "updated_at" + ], + "properties": { + "id": { + "description": "The customer group's ID", + "type": "string", + "example": "cgrp_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "name": { + "description": "The name of the customer group", + "type": "string", + "example": "VIP" + }, + "customers": { + "description": "The customers that belong to the customer group. Available if the relation `customers` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + } + }, + "price_lists": { + "description": "The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PriceList" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Discount": { + "title": "Discount", + "description": "Represents a discount that can be applied to a cart for promotional purposes.", + "type": "object", + "required": [ + "code", + "created_at", + "deleted_at", + "ends_at", + "id", + "is_disabled", + "is_dynamic", + "metadata", + "parent_discount_id", + "rule_id", + "starts_at", + "updated_at", + "usage_count", + "usage_limit", + "valid_duration" + ], + "properties": { + "id": { + "description": "The discount's ID", + "type": "string", + "example": "disc_01F0YESMW10MGHWJKZSDDMN0VN" + }, + "code": { + "description": "A unique code for the discount - this will be used by the customer to apply the discount", + "type": "string", + "example": "10DISC" + }, + "is_dynamic": { + "description": "A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts", + "type": "boolean", + "example": false + }, + "rule_id": { + "description": "The Discount Rule that governs the behaviour of the Discount", + "nullable": true, + "type": "string", + "example": "dru_01F0YESMVK96HVX7N419E3CJ7C" + }, + "rule": { + "description": "Available if the relation `rule` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountRule" + }, + "is_disabled": { + "description": "Whether the Discount has been disabled. Disabled discounts cannot be applied to carts", + "type": "boolean", + "example": false + }, + "parent_discount_id": { + "description": "The Discount that the discount was created from. This will always be a dynamic discount", + "nullable": true, + "type": "string", + "example": "disc_01G8ZH853YPY9B94857DY91YGW" + }, + "parent_discount": { + "description": "Available if the relation `parent_discount` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Discount" + }, + "starts_at": { + "description": "The time at which the discount can be used.", + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The time at which the discount can no longer be used.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "valid_duration": { + "description": "Duration the discount runs between", + "nullable": true, + "type": "string", + "example": "P3Y6M4DT12H30M5S" + }, + "regions": { + "description": "The Regions in which the Discount can be used. Available if the relation `regions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Region" + } + }, + "usage_limit": { + "description": "The maximum number of times that a discount can be used.", + "nullable": true, + "type": "integer", + "example": 100 + }, + "usage_count": { + "description": "The number of times a discount has been used.", + "type": "integer", + "example": 50, + "default": 0 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountCondition": { + "title": "Discount Condition", + "description": "Holds rule conditions for when a discount is applicable", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "discount_rule_id", + "id", + "metadata", + "operator", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The discount condition's ID", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "type": { + "description": "The type of the Condition", + "type": "string", + "enum": [ + "products", + "product_types", + "product_collections", + "product_tags", + "customer_groups" + ] + }, + "operator": { + "description": "The operator of the Condition", + "type": "string", + "enum": [ + "in", + "not_in" + ] + }, + "discount_rule_id": { + "description": "The ID of the discount rule associated with the condition", + "type": "string", + "example": "dru_01F0YESMVK96HVX7N419E3CJ7C" + }, + "discount_rule": { + "description": "Available if the relation `discount_rule` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountRule" + }, + "products": { + "description": "products associated with this condition if type = products. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "product_types": { + "description": "Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + }, + "product_tags": { + "description": "Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductTag" + } + }, + "product_collections": { + "description": "Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCollection" + } + }, + "customer_groups": { + "description": "Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionCustomerGroup": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a customer group", + "type": "object", + "required": [ + "condition_id", + "created_at", + "customer_group_id", + "metadata", + "updated_at" + ], + "properties": { + "customer_group_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "cgrp_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "customer_group": { + "description": "Available if the relation `customer_group` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/CustomerGroup" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProduct": { + "title": "Product Discount Condition", + "description": "Associates a discount condition with a product", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_id", + "updated_at" + ], + "properties": { + "product_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product": { + "description": "Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProductCollection": { + "title": "Product Collection Discount Condition", + "description": "Associates a discount condition with a product collection", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_collection_id", + "updated_at" + ], + "properties": { + "product_collection_id": { + "description": "The ID of the Product Collection", + "type": "string", + "example": "pcol_01F0YESBFAZ0DV6V831JXWH0BG" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_collection": { + "description": "Available if the relation `product_collection` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductCollection" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProductTag": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a product tag", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_tag_id", + "updated_at" + ], + "properties": { + "product_tag_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "ptag_01F0YESHPZYY3H4SJ3A5918SBN" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_tag": { + "description": "Available if the relation `product_tag` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductTag" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProductType": { + "title": "Product Type Discount Condition", + "description": "Associates a discount condition with a product type", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_type_id", + "updated_at" + ], + "properties": { + "product_type_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_type": { + "description": "Available if the relation `product_type` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductType" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountRule": { + "title": "Discount Rule", + "description": "Holds the rules that governs how a Discount is calculated when applied to a Cart.", + "type": "object", + "required": [ + "allocation", + "created_at", + "deleted_at", + "description", + "id", + "metadata", + "type", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The discount rule's ID", + "type": "string", + "example": "dru_01F0YESMVK96HVX7N419E3CJ7C" + }, + "type": { + "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.", + "type": "string", + "enum": [ + "fixed", + "percentage", + "free_shipping" + ], + "example": "percentage" + }, + "description": { + "description": "A short description of the discount", + "nullable": true, + "type": "string", + "example": "10 Percent" + }, + "value": { + "description": "The value that the discount represents; this will depend on the type of the discount", + "type": "integer", + "example": 10 + }, + "allocation": { + "description": "The scope that the discount should apply to.", + "nullable": true, + "type": "string", + "enum": [ + "total", + "item" + ], + "example": "total" + }, + "conditions": { + "description": "A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/DiscountCondition" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DraftOrder": { + "title": "DraftOrder", + "description": "Represents a draft order", + "type": "object", + "required": [ + "canceled_at", + "cart_id", + "completed_at", + "created_at", + "display_id", + "id", + "idempotency_key", + "metadata", + "no_notification_order", + "order_id", + "status", + "updated_at" + ], + "properties": { + "id": { + "description": "The draft order's ID", + "type": "string", + "example": "dorder_01G8TJFKBG38YYFQ035MSVG03C" + }, + "status": { + "description": "The status of the draft order", + "type": "string", + "enum": [ + "open", + "completed" + ], + "default": "open" + }, + "display_id": { + "description": "The draft order's display ID", + "type": "string", + "example": 2 + }, + "cart_id": { + "description": "The ID of the cart associated with the draft order.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "order_id": { + "description": "The ID of the order associated with the draft order.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "canceled_at": { + "description": "The date the draft order was canceled at.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date the draft order was completed at.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification_order": { + "description": "Whether to send the customer notifications regarding order updates.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Error": { + "title": "Response Error", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "A slug code to indicate the type of the error." + }, + "message": { + "type": "string", + "description": "Description of the error that occurred." + }, + "type": { + "type": "string", + "description": "A slug indicating the type of the error." + } + } + }, + "ExtendedStoreDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/Store" + }, + { + "type": "object", + "required": [ + "payment_providers", + "fulfillment_providers", + "feature_flags", + "modules" + ], + "properties": { + "payment_providers": { + "$ref": "#/components/schemas/PaymentProvider" + }, + "fulfillment_providers": { + "$ref": "#/components/schemas/FulfillmentProvider" + }, + "feature_flags": { + "$ref": "#/components/schemas/FeatureFlagsResponse" + }, + "modules": { + "$ref": "#/components/schemas/ModulesResponse" + } + } + } + ] + }, + "FeatureFlagsResponse": { + "type": "array", + "items": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "description": "The key of the feature flag.", + "type": "string" + }, + "value": { + "description": "The value of the feature flag.", + "type": "boolean" + } + } + } + }, + "Fulfillment": { + "title": "Fulfillment", + "description": "Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments.", + "type": "object", + "required": [ + "canceled_at", + "claim_order_id", + "created_at", + "data", + "id", + "idempotency_key", + "location_id", + "metadata", + "no_notification", + "order_id", + "provider_id", + "shipped_at", + "swap_id", + "tracking_numbers", + "updated_at" + ], + "properties": { + "id": { + "description": "The fulfillment's ID", + "type": "string", + "example": "ful_01G8ZRTMQCA76TXNAT81KPJZRF" + }, + "claim_order_id": { + "description": "The id of the Claim that the Fulfillment belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "swap_id": { + "description": "The id of the Swap that the Fulfillment belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "order_id": { + "description": "The id of the Order that the Fulfillment belongs to.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "provider_id": { + "description": "The id of the Fulfillment Provider responsible for handling the fulfillment", + "type": "string", + "example": "manual" + }, + "provider": { + "description": "Available if the relation `provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/FulfillmentProvider" + }, + "location_id": { + "description": "The id of the stock location the fulfillment will be shipped from", + "nullable": true, + "type": "string", + "example": "sloc_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "items": { + "description": "The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentItem" + } + }, + "tracking_links": { + "description": "The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TrackingLink" + } + }, + "tracking_numbers": { + "description": "The tracking numbers that can be used to track the status of the fulfillment.", + "deprecated": true, + "type": "array", + "items": { + "type": "string" + } + }, + "data": { + "description": "This contains all the data necessary for the Fulfillment provider to handle the fulfillment.", + "type": "object", + "example": {} + }, + "shipped_at": { + "description": "The date with timezone at which the Fulfillment was shipped.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be sent.", + "nullable": true, + "type": "boolean", + "example": false + }, + "canceled_at": { + "description": "The date with timezone at which the Fulfillment was canceled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the fulfillment in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "FulfillmentItem": { + "title": "Fulfillment Item", + "description": "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item.", + "type": "object", + "required": [ + "fulfillment_id", + "item_id", + "quantity" + ], + "properties": { + "fulfillment_id": { + "description": "The id of the Fulfillment that the Fulfillment Item belongs to.", + "type": "string", + "example": "ful_01G8ZRTMQCA76TXNAT81KPJZRF" + }, + "item_id": { + "description": "The id of the Line Item that the Fulfillment Item references.", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "fulfillment": { + "description": "A fulfillment object. Available if the relation `fulfillment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Fulfillment" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "quantity": { + "description": "The quantity of the Line Item that is included in the Fulfillment.", + "type": "integer", + "example": 1 + } + } + }, + "FulfillmentProvider": { + "title": "Fulfillment Provider", + "description": "Represents a fulfillment provider plugin and holds its installation status.", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the fulfillment provider as given by the plugin.", + "type": "string", + "example": "manual" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "GiftCard": { + "title": "Gift Card", + "description": "Gift Cards are redeemable and represent a value that can be used towards the payment of an Order.", + "type": "object", + "required": [ + "balance", + "code", + "created_at", + "deleted_at", + "ends_at", + "id", + "is_disabled", + "metadata", + "order_id", + "region_id", + "tax_rate", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The gift card's ID", + "type": "string", + "example": "gift_01G8XKBPBQY2R7RBET4J7E0XQZ" + }, + "code": { + "description": "The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card.", + "type": "string", + "example": "3RFT-MH2C-Y4YZ-XMN4" + }, + "value": { + "description": "The value that the Gift Card represents.", + "type": "integer", + "example": 10 + }, + "balance": { + "description": "The remaining value on the Gift Card.", + "type": "integer", + "example": 10 + }, + "region_id": { + "description": "The id of the Region in which the Gift Card is available.", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "order_id": { + "description": "The id of the Order that the Gift Card was purchased in.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "is_disabled": { + "description": "Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts.", + "type": "boolean", + "default": false + }, + "ends_at": { + "description": "The time at which the Gift Card can no longer be used.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "tax_rate": { + "description": "The gift card's tax rate that will be applied on calculating totals", + "nullable": true, + "type": "number", + "example": 0 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "GiftCardTransaction": { + "title": "Gift Card Transaction", + "description": "Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order", + "type": "object", + "required": [ + "amount", + "created_at", + "gift_card_id", + "id", + "is_taxable", + "order_id", + "tax_rate" + ], + "properties": { + "id": { + "description": "The gift card transaction's ID", + "type": "string", + "example": "gct_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "gift_card_id": { + "description": "The ID of the Gift Card that was used in the transaction.", + "type": "string", + "example": "gift_01G8XKBPBQY2R7RBET4J7E0XQZ" + }, + "gift_card": { + "description": "A gift card object. Available if the relation `gift_card` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/GiftCard" + }, + "order_id": { + "description": "The ID of the Order that the Gift Card was used to pay for.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "amount": { + "description": "The amount that was used from the Gift Card.", + "type": "integer", + "example": 10 + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "is_taxable": { + "description": "Whether the transaction is taxable or not.", + "nullable": true, + "type": "boolean", + "example": false + }, + "tax_rate": { + "description": "The tax rate of the transaction", + "nullable": true, + "type": "number", + "example": 0 + } + } + }, + "IdempotencyKey": { + "title": "Idempotency Key", + "description": "Idempotency Key is used to continue a process in case of any failure that might occur.", + "type": "object", + "required": [ + "created_at", + "id", + "idempotency_key", + "locked_at", + "recovery_point", + "response_code", + "response_body", + "request_method", + "request_params", + "request_path" + ], + "properties": { + "id": { + "description": "The idempotency key's ID", + "type": "string", + "example": "ikey_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "idempotency_key": { + "description": "The unique randomly generated key used to determine the state of a process.", + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "created_at": { + "description": "Date which the idempotency key was locked.", + "type": "string", + "format": "date-time" + }, + "locked_at": { + "description": "Date which the idempotency key was locked.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "request_method": { + "description": "The method of the request", + "nullable": true, + "type": "string", + "example": "POST" + }, + "request_params": { + "description": "The parameters passed to the request", + "nullable": true, + "type": "object", + "example": { + "id": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + } + }, + "request_path": { + "description": "The request's path", + "nullable": true, + "type": "string", + "example": "/store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete" + }, + "response_code": { + "description": "The response's code.", + "nullable": true, + "type": "string", + "example": 200 + }, + "response_body": { + "description": "The response's body", + "nullable": true, + "type": "object", + "example": { + "id": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + } + }, + "recovery_point": { + "description": "Where to continue from.", + "type": "string", + "default": "started" + } + } + }, + "Image": { + "title": "Image", + "description": "Images holds a reference to a URL at which the image file can be found.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "url" + ], + "properties": { + "id": { + "type": "string", + "description": "The image's ID", + "example": "img_01G749BFYR6T8JTVW6SGW3K3E6" + }, + "url": { + "description": "The URL at which the image file can be found.", + "type": "string", + "format": "uri" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "InventoryItemDTO": { + "type": "object", + "required": [ + "sku" + ], + "properties": { + "sku": { + "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "origin_country": { + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "material": { + "description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "weight": { + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "height": { + "description": "The height of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "width": { + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "length": { + "description": "The length of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "requires_shipping": { + "description": "Whether the item requires shipping.", + "type": "boolean" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "InventoryLevelDTO": { + "type": "object", + "required": [ + "inventory_item_id", + "location_id", + "stocked_quantity", + "reserved_quantity", + "incoming_quantity" + ], + "properties": { + "location_id": { + "description": "the item location ID", + "type": "string" + }, + "stocked_quantity": { + "description": "the total stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "reserved_quantity": { + "description": "the reserved stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "incoming_quantity": { + "description": "the incoming stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "Invite": { + "title": "Invite", + "description": "Represents an invite", + "type": "object", + "required": [ + "accepted", + "created_at", + "deleted_at", + "expires_at", + "id", + "metadata", + "role", + "token", + "updated_at", + "user_email" + ], + "properties": { + "id": { + "type": "string", + "description": "The invite's ID", + "example": "invite_01G8TKE4XYCTHSCK2GDEP47RE1" + }, + "user_email": { + "description": "The email of the user being invited.", + "type": "string", + "format": "email" + }, + "role": { + "description": "The user's role.", + "nullable": true, + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ], + "default": "member" + }, + "accepted": { + "description": "Whether the invite was accepted or not.", + "type": "boolean", + "default": false + }, + "token": { + "description": "The token used to accept the invite.", + "type": "string" + }, + "expires_at": { + "description": "The date the invite expires at.", + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "LineItem": { + "title": "Line Item", + "description": "Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims.", + "type": "object", + "required": [ + "allow_discounts", + "cart_id", + "claim_order_id", + "created_at", + "description", + "fulfilled_quantity", + "has_shipping", + "id", + "is_giftcard", + "is_return", + "metadata", + "order_edit_id", + "order_id", + "original_item_id", + "quantity", + "returned_quantity", + "shipped_quantity", + "should_merge", + "swap_id", + "thumbnail", + "title", + "unit_price", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The line item's ID", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "cart_id": { + "description": "The ID of the Cart that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "order_id": { + "description": "The ID of the Order that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "swap_id": { + "description": "The id of the Swap that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "claim_order_id": { + "description": "The id of the Claim that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "tax_lines": { + "description": "Available if the relation `tax_lines` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItemTaxLine" + } + }, + "adjustments": { + "description": "Available if the relation `adjustments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItemAdjustment" + } + }, + "original_item_id": { + "description": "The id of the original line item", + "nullable": true, + "type": "string" + }, + "order_edit_id": { + "description": "The ID of the order edit to which a cloned item belongs", + "nullable": true, + "type": "string" + }, + "order_edit": { + "description": "The order edit joined. Available if the relation `order_edit` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/OrderEdit" + }, + "title": { + "description": "The title of the Line Item, this should be easily identifiable by the Customer.", + "type": "string", + "example": "Medusa Coffee Mug" + }, + "description": { + "description": "A more detailed description of the contents of the Line Item.", + "nullable": true, + "type": "string", + "example": "One Size" + }, + "thumbnail": { + "description": "A URL string to a small image of the contents of the Line Item.", + "nullable": true, + "type": "string", + "format": "uri", + "example": "https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png" + }, + "is_return": { + "description": "Is the item being returned", + "type": "boolean", + "default": false + }, + "is_giftcard": { + "description": "Flag to indicate if the Line Item is a Gift Card.", + "type": "boolean", + "default": false + }, + "should_merge": { + "description": "Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item.", + "type": "boolean", + "default": true + }, + "allow_discounts": { + "description": "Flag to indicate if the Line Item should be included when doing discount calculations.", + "type": "boolean", + "default": true + }, + "has_shipping": { + "description": "Flag to indicate if the Line Item has fulfillment associated with it.", + "nullable": true, + "type": "boolean", + "example": false + }, + "unit_price": { + "description": "The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to.", + "type": "integer", + "example": 8000 + }, + "variant_id": { + "description": "The id of the Product Variant contained in the Line Item.", + "nullable": true, + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "quantity": { + "description": "The quantity of the content in the Line Item.", + "type": "integer", + "example": 1 + }, + "fulfilled_quantity": { + "description": "The quantity of the Line Item that has been fulfilled.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "returned_quantity": { + "description": "The quantity of the Line Item that has been returned.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "shipped_quantity": { + "description": "The quantity of the Line Item that has been shipped.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "refundable": { + "description": "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.", + "type": "integer", + "example": 0 + }, + "subtotal": { + "description": "The subtotal of the line item", + "type": "integer", + "example": 8000 + }, + "tax_total": { + "description": "The total of tax of the line item", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the line item", + "type": "integer", + "example": 8000 + }, + "original_total": { + "description": "The original total amount of the line item", + "type": "integer", + "example": 8000 + }, + "original_tax_total": { + "description": "The original tax total amount of the line item", + "type": "integer", + "example": 0 + }, + "discount_total": { + "description": "The total of discount of the line item rounded", + "type": "integer", + "example": 0 + }, + "raw_discount_total": { + "description": "The total of discount of the line item", + "type": "integer", + "example": 0 + }, + "gift_card_total": { + "description": "The total of the gift card of the line item", + "type": "integer", + "example": 0 + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Indicates if the line item unit_price include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "LineItemAdjustment": { + "title": "Line Item Adjustment", + "description": "Represents a Line Item Adjustment", + "type": "object", + "required": [ + "amount", + "description", + "discount_id", + "id", + "item_id", + "metadata" + ], + "properties": { + "id": { + "description": "The Line Item Adjustment's ID", + "type": "string", + "example": "lia_01G8TKE4XYCTHSCK2GDEP47RE1" + }, + "item_id": { + "description": "The ID of the line item", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "description": { + "description": "The line item's adjustment description", + "type": "string", + "example": "Adjusted item's price." + }, + "discount_id": { + "description": "The ID of the discount associated with the adjustment", + "nullable": true, + "type": "string", + "example": "disc_01F0YESMW10MGHWJKZSDDMN0VN" + }, + "discount": { + "description": "Available if the relation `discount` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Discount" + }, + "amount": { + "description": "The adjustment amount", + "type": "number", + "example": 1000 + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "LineItemTaxLine": { + "title": "Line Item Tax Line", + "description": "Represents a Line Item Tax Line", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "item_id", + "metadata", + "name", + "rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The line item tax line's ID", + "type": "string", + "example": "litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8" + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number", + "example": 10 + }, + "item_id": { + "description": "The ID of the line item", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ModulesResponse": { + "type": "array", + "items": { + "type": "object", + "required": [ + "module", + "resolution" + ], + "properties": { + "module": { + "description": "The key of the module.", + "type": "string" + }, + "resolution": { + "description": "The resolution path of the module or false if module is not installed.", + "type": "string" + } + } + } + }, + "MoneyAmount": { + "title": "Money Amount", + "description": "Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon.", + "type": "object", + "required": [ + "amount", + "created_at", + "currency_code", + "deleted_at", + "id", + "max_quantity", + "min_quantity", + "price_list_id", + "region_id", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The money amount's ID", + "type": "string", + "example": "ma_01F0YESHRFQNH5S8Q0PK84YYZN" + }, + "currency_code": { + "description": "The 3 character currency code that the Money Amount is given in.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "amount": { + "description": "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.", + "type": "integer", + "example": 100 + }, + "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.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "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.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "price_list_id": { + "description": "The ID of the price list associated with the money amount", + "nullable": true, + "type": "string", + "example": "pl_01G8X3CKJXCG5VXVZ87H9KC09W" + }, + "price_list": { + "description": "Available if the relation `price_list` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/PriceList" + }, + "variant_id": { + "description": "The id of the Product Variant contained in the Line Item.", + "nullable": true, + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "The Product Variant contained in the Line Item. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "region_id": { + "description": "The region's ID", + "nullable": true, + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "MultipleErrors": { + "title": "Multiple Errors", + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Array of errors", + "items": { + "$ref": "#/components/schemas/Error" + } + }, + "message": { + "type": "string", + "default": "Provided request body contains errors. Please check the data and retry the request" + } + } + }, + "Note": { + "title": "Note", + "description": "Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these.", + "type": "object", + "required": [ + "author_id", + "created_at", + "deleted_at", + "id", + "metadata", + "resource_id", + "resource_type", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The note's ID", + "type": "string", + "example": "note_01G8TM8ENBMC7R90XRR1G6H26Q" + }, + "resource_type": { + "description": "The type of resource that the Note refers to.", + "type": "string", + "example": "order" + }, + "resource_id": { + "description": "The ID of the resource that the Note refers to.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "value": { + "description": "The contents of the note.", + "type": "string", + "example": "This order must be fulfilled on Monday" + }, + "author_id": { + "description": "The ID of the author (user)", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "author": { + "description": "Available if the relation `author` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/User" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Notification": { + "title": "Notification", + "description": "Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends.", + "type": "object", + "required": [ + "created_at", + "customer_id", + "data", + "event_name", + "id", + "parent_id", + "provider_id", + "resource_type", + "resource_id", + "to", + "updated_at" + ], + "properties": { + "id": { + "description": "The notification's ID", + "type": "string", + "example": "noti_01G53V9Y6CKMCGBM1P0X7C28RX" + }, + "event_name": { + "description": "The name of the event that the notification was sent for.", + "nullable": true, + "type": "string", + "example": "order.placed" + }, + "resource_type": { + "description": "The type of resource that the Notification refers to.", + "type": "string", + "example": "order" + }, + "resource_id": { + "description": "The ID of the resource that the Notification refers to.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "customer_id": { + "description": "The ID of the Customer that the Notification was sent to.", + "nullable": true, + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "A customer object. Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "to": { + "description": "The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id", + "type": "string", + "example": "user@example.com" + }, + "data": { + "description": "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.", + "type": "object", + "example": {} + }, + "parent_id": { + "description": "The notification's parent ID", + "nullable": true, + "type": "string", + "example": "noti_01G53V9Y6CKMCGBM1P0X7C28RX" + }, + "parent_notification": { + "description": "Available if the relation `parent_notification` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Notification" + }, + "resends": { + "description": "The resends that have been completed after the original Notification. Available if the relation `resends` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Notification" + } + }, + "provider_id": { + "description": "The id of the Notification Provider that handles the Notification.", + "nullable": true, + "type": "string", + "example": "sengrid" + }, + "provider": { + "description": "Available if the relation `provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/NotificationProvider" + }, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "NotificationProvider": { + "title": "Notification Provider", + "description": "Represents a notification provider plugin and holds its installation status.", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the notification provider as given by the plugin.", + "type": "string", + "example": "sendgrid" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "OAuth": { + "title": "OAuth", + "description": "Represent an OAuth app", + "type": "object", + "required": [ + "application_name", + "data", + "display_name", + "id", + "install_url", + "uninstall_url" + ], + "properties": { + "id": { + "description": "The app's ID", + "type": "string", + "example": "example_app" + }, + "display_name": { + "description": "The app's display name", + "type": "string", + "example": "Example app" + }, + "application_name": { + "description": "The app's name", + "type": "string", + "example": "example" + }, + "install_url": { + "description": "The URL to install the app", + "nullable": true, + "type": "string", + "format": "uri" + }, + "uninstall_url": { + "description": "The URL to uninstall the app", + "nullable": true, + "type": "string", + "format": "uri" + }, + "data": { + "description": "Any data necessary to the app.", + "nullable": true, + "type": "object", + "example": {} + } + } + }, + "Order": { + "title": "Order", + "description": "Represents an order", + "type": "object", + "required": [ + "billing_address_id", + "canceled_at", + "cart_id", + "created_at", + "currency_code", + "customer_id", + "draft_order_id", + "display_id", + "email", + "external_id", + "fulfillment_status", + "id", + "idempotency_key", + "metadata", + "no_notification", + "object", + "payment_status", + "region_id", + "shipping_address_id", + "status", + "tax_rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The order's ID", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "status": { + "description": "The order's status", + "type": "string", + "enum": [ + "pending", + "completed", + "archived", + "canceled", + "requires_action" + ], + "default": "pending" + }, + "fulfillment_status": { + "description": "The order's fulfillment status", + "type": "string", + "enum": [ + "not_fulfilled", + "partially_fulfilled", + "fulfilled", + "partially_shipped", + "shipped", + "partially_returned", + "returned", + "canceled", + "requires_action" + ], + "default": "not_fulfilled" + }, + "payment_status": { + "description": "The order's payment status", + "type": "string", + "enum": [ + "not_paid", + "awaiting", + "captured", + "partially_refunded", + "refunded", + "canceled", + "requires_action" + ], + "default": "not_paid" + }, + "display_id": { + "description": "The order's display ID", + "type": "integer", + "example": 2 + }, + "cart_id": { + "description": "The ID of the cart associated with the order", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "customer_id": { + "description": "The ID of the customer associated with the order", + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "A customer object. Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "email": { + "description": "The email associated with the order", + "type": "string", + "format": "email" + }, + "billing_address_id": { + "description": "The ID of the billing address associated with the order", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "billing_address": { + "description": "Available if the relation `billing_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_address_id": { + "description": "The ID of the shipping address associated with the order", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "currency_code": { + "description": "The 3 character currency code that is used in the order", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "tax_rate": { + "description": "The order's tax rate", + "nullable": true, + "type": "number", + "example": 0 + }, + "discounts": { + "description": "The discounts used in the order. Available if the relation `discounts` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Discount" + } + }, + "gift_cards": { + "description": "The gift cards used in the order. Available if the relation `gift_cards` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + } + }, + "shipping_methods": { + "description": "The shipping methods used in the order. Available if the relation `shipping_methods` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "payments": { + "description": "The payments used in the order. Available if the relation `payments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + } + }, + "fulfillments": { + "description": "The fulfillments used in the order. Available if the relation `fulfillments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + } + }, + "returns": { + "description": "The returns associated with the order. Available if the relation `returns` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Return" + } + }, + "claims": { + "description": "The claims associated with the order. Available if the relation `claims` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimOrder" + } + }, + "refunds": { + "description": "The refunds associated with the order. Available if the relation `refunds` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Refund" + } + }, + "swaps": { + "description": "The swaps associated with the order. Available if the relation `swaps` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Swap" + } + }, + "draft_order_id": { + "description": "The ID of the draft order this order is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "draft_order": { + "description": "A draft order object. Available if the relation `draft_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DraftOrder" + }, + "items": { + "description": "The line items that belong to the order. Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "edits": { + "description": "Order edits done on the order. Available if the relation `edits` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderEdit" + } + }, + "gift_card_transactions": { + "description": "The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCardTransaction" + } + }, + "canceled_at": { + "description": "The date the order was canceled on.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the processing of the order in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "external_id": { + "description": "The ID of an external order.", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channel_id": { + "description": "The ID of the sales channel this order is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channel": { + "description": "A sales channel object. Available if the relation `sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "shipping_total": { + "type": "integer", + "description": "The total of shipping", + "example": 1000 + }, + "raw_discount_total": { + "description": "The total of discount", + "type": "integer", + "example": 800 + }, + "discount_total": { + "description": "The total of discount rounded", + "type": "integer", + "example": 800 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + }, + "refunded_total": { + "description": "The total amount refunded if the order is returned.", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the order", + "type": "integer", + "example": 8200 + }, + "subtotal": { + "description": "The subtotal of the order", + "type": "integer", + "example": 8000 + }, + "paid_total": { + "description": "The total amount paid", + "type": "integer", + "example": 8000 + }, + "refundable_amount": { + "description": "The amount that can be refunded", + "type": "integer", + "example": 8200 + }, + "gift_card_total": { + "description": "The total of gift cards", + "type": "integer", + "example": 0 + }, + "gift_card_tax_total": { + "description": "The total of gift cards with taxes", + "type": "integer", + "example": 0 + }, + "returnable_items": { + "description": "The items that are returnable as part of the order, order swaps or order claims", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "OrderEdit": { + "title": "Order Edit", + "description": "Order edit keeps track of order items changes.", + "type": "object", + "required": [ + "canceled_at", + "canceled_by", + "confirmed_by", + "confirmed_at", + "created_at", + "created_by", + "declined_at", + "declined_by", + "declined_reason", + "id", + "internal_note", + "order_id", + "payment_collection_id", + "requested_at", + "requested_by", + "status", + "updated_at" + ], + "properties": { + "id": { + "description": "The order edit's ID", + "type": "string", + "example": "oe_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order_id": { + "description": "The ID of the order that is edited", + "type": "string", + "example": "order_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "order": { + "description": "Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "changes": { + "description": "Available if the relation `changes` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderItemChange" + } + }, + "internal_note": { + "description": "An optional note with additional details about the order edit.", + "nullable": true, + "type": "string", + "example": "Included two more items B to the order." + }, + "created_by": { + "description": "The unique identifier of the user or customer who created the order edit.", + "type": "string" + }, + "requested_by": { + "description": "The unique identifier of the user or customer who requested the order edit.", + "nullable": true, + "type": "string" + }, + "requested_at": { + "description": "The date with timezone at which the edit was requested.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "confirmed_by": { + "description": "The unique identifier of the user or customer who confirmed the order edit.", + "nullable": true, + "type": "string" + }, + "confirmed_at": { + "description": "The date with timezone at which the edit was confirmed.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "declined_by": { + "description": "The unique identifier of the user or customer who declined the order edit.", + "nullable": true, + "type": "string" + }, + "declined_at": { + "description": "The date with timezone at which the edit was declined.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "declined_reason": { + "description": "An optional note why the order edit is declined.", + "nullable": true, + "type": "string" + }, + "canceled_by": { + "description": "The unique identifier of the user or customer who cancelled the order edit.", + "nullable": true, + "type": "string" + }, + "canceled_at": { + "description": "The date with timezone at which the edit was cancelled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "subtotal": { + "description": "The total of subtotal", + "type": "integer", + "example": 8000 + }, + "discount_total": { + "description": "The total of discount", + "type": "integer", + "example": 800 + }, + "shipping_total": { + "description": "The total of the shipping amount", + "type": "integer", + "example": 800 + }, + "gift_card_total": { + "description": "The total of the gift card amount", + "type": "integer", + "example": 800 + }, + "gift_card_tax_total": { + "description": "The total of the gift card tax amount", + "type": "integer", + "example": 800 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the edited order.", + "type": "integer", + "example": 8200 + }, + "difference_due": { + "description": "The difference between the total amount of the order and total amount of edited order.", + "type": "integer", + "example": 8200 + }, + "status": { + "description": "The status of the order edit.", + "type": "string", + "enum": [ + "confirmed", + "declined", + "requested", + "created", + "canceled" + ] + }, + "items": { + "description": "Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "payment_collection_id": { + "description": "The ID of the payment collection", + "nullable": true, + "type": "string", + "example": "paycol_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "payment_collection": { + "description": "Available if the relation `payment_collection` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/PaymentCollection" + }, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "OrderItemChange": { + "title": "Order Item Change", + "description": "Represents an order edit item change", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "line_item_id", + "order_edit_id", + "original_line_item_id", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The order item change's ID", + "type": "string", + "example": "oic_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "type": { + "description": "The order item change's status", + "type": "string", + "enum": [ + "item_add", + "item_remove", + "item_update" + ] + }, + "order_edit_id": { + "description": "The ID of the order edit", + "type": "string", + "example": "oe_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "order_edit": { + "description": "Available if the relation `order_edit` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/OrderEdit" + }, + "original_line_item_id": { + "description": "The ID of the original line item in the order", + "nullable": true, + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "original_line_item": { + "description": "Available if the relation `original_line_item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "line_item_id": { + "description": "The ID of the cloned line item.", + "nullable": true, + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "line_item": { + "description": "Available if the relation `line_item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "Payment": { + "title": "Payment", + "description": "Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded.", + "type": "object", + "required": [ + "amount", + "amount_refunded", + "canceled_at", + "captured_at", + "cart_id", + "created_at", + "currency_code", + "data", + "id", + "idempotency_key", + "metadata", + "order_id", + "provider_id", + "swap_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The payment's ID", + "type": "string", + "example": "pay_01G2SJNT6DEEWDFNAJ4XWDTHKE" + }, + "swap_id": { + "description": "The ID of the Swap that the Payment is used for.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "cart_id": { + "description": "The id of the Cart that the Payment Session is created for.", + "nullable": true, + "type": "string" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "order_id": { + "description": "The ID of the Order that the Payment is used for.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "amount": { + "description": "The amount that the Payment has been authorized for.", + "type": "integer", + "example": 100 + }, + "currency_code": { + "description": "The 3 character ISO currency code that the Payment is completed in.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "amount_refunded": { + "description": "The amount of the original Payment amount that has been refunded back to the Customer.", + "type": "integer", + "default": 0, + "example": 0 + }, + "provider_id": { + "description": "The id of the Payment Provider that is responsible for the Payment", + "type": "string", + "example": "manual" + }, + "data": { + "description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.", + "type": "object", + "example": {} + }, + "captured_at": { + "description": "The date with timezone at which the Payment was captured.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date with timezone at which the Payment was canceled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a payment in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "PaymentCollection": { + "title": "Payment Collection", + "description": "Payment Collection", + "type": "object", + "required": [ + "amount", + "authorized_amount", + "created_at", + "created_by", + "currency_code", + "deleted_at", + "description", + "id", + "metadata", + "region_id", + "status", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The payment collection's ID", + "type": "string", + "example": "paycol_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "type": { + "description": "The type of the payment collection", + "type": "string", + "enum": [ + "order_edit" + ] + }, + "status": { + "description": "The type of the payment collection", + "type": "string", + "enum": [ + "not_paid", + "awaiting", + "authorized", + "partially_authorized", + "canceled" + ] + }, + "description": { + "description": "Description of the payment collection", + "nullable": true, + "type": "string" + }, + "amount": { + "description": "Amount of the payment collection.", + "type": "integer" + }, + "authorized_amount": { + "description": "Authorized amount of the payment collection.", + "nullable": true, + "type": "integer" + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "currency_code": { + "description": "The 3 character ISO code for the currency.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "payment_sessions": { + "description": "Available if the relation `payment_sessions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentSession" + } + }, + "payments": { + "description": "Available if the relation `payments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + } + }, + "created_by": { + "description": "The ID of the user that created the payment collection.", + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "PaymentProvider": { + "title": "Payment Provider", + "description": "Represents a Payment Provider plugin and holds its installation status.", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the payment provider as given by the plugin.", + "type": "string", + "example": "manual" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "PaymentSession": { + "title": "Payment Session", + "description": "Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc.", + "type": "object", + "required": [ + "amount", + "cart_id", + "created_at", + "data", + "id", + "is_initiated", + "is_selected", + "idempotency_key", + "payment_authorized_at", + "provider_id", + "status", + "updated_at" + ], + "properties": { + "id": { + "description": "The payment session's ID", + "type": "string", + "example": "ps_01G901XNSRM2YS3ASN9H5KG3FZ" + }, + "cart_id": { + "description": "The id of the Cart that the Payment Session is created for.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "provider_id": { + "description": "The id of the Payment Provider that is responsible for the Payment Session", + "type": "string", + "example": "manual" + }, + "is_selected": { + "description": "A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase.", + "nullable": true, + "type": "boolean", + "example": true + }, + "is_initiated": { + "description": "A flag to indicate if a communication with the third party provider has been initiated.", + "type": "boolean", + "default": false, + "example": true + }, + "status": { + "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer.", + "type": "string", + "enum": [ + "authorized", + "pending", + "requires_more", + "error", + "canceled" + ], + "example": "pending" + }, + "data": { + "description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.", + "type": "object", + "example": {} + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a cart in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "amount": { + "description": "The amount that the Payment Session has been authorized for.", + "nullable": true, + "type": "integer", + "example": 100 + }, + "payment_authorized_at": { + "description": "The date with timezone at which the Payment Session was authorized.", + "nullable": true, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "PriceList": { + "title": "Price List", + "description": "Price Lists represents a set of prices that overrides the default price for one or more product variants.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "description", + "ends_at", + "id", + "name", + "starts_at", + "status", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The price list's ID", + "type": "string", + "example": "pl_01G8X3CKJXCG5VXVZ87H9KC09W" + }, + "name": { + "description": "The price list's name", + "type": "string", + "example": "VIP Prices" + }, + "description": { + "description": "The price list's description", + "type": "string", + "example": "Prices for VIP customers" + }, + "type": { + "description": "The type of Price List. This can be one of either `sale` or `override`.", + "type": "string", + "enum": [ + "sale", + "override" + ], + "default": "sale" + }, + "status": { + "description": "The status of the Price List", + "type": "string", + "enum": [ + "active", + "draft" + ], + "default": "draft" + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The date with timezone that the Price List stops being valid.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "customer_groups": { + "description": "The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "prices": { + "description": "The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MoneyAmount" + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the price list prices include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "PricedProduct": { + "title": "Priced Product", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Product" + }, + { + "type": "object", + "properties": { + "variants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedVariant" + } + } + } + } + ] + }, + "PricedShippingOption": { + "title": "Priced Shipping Option", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ShippingOption" + }, + { + "type": "object", + "properties": { + "price_incl_tax": { + "type": "number", + "description": "Price including taxes" + }, + "tax_rates": { + "type": "array", + "description": "An array of applied tax rates", + "items": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "description": "The tax rate value" + }, + "name": { + "type": "string", + "description": "The name of the tax rate" + }, + "code": { + "type": "string", + "description": "The code of the tax rate" + } + } + } + }, + "tax_amount": { + "type": "number", + "description": "The taxes applied." + } + } + } + ] + }, + "PricedVariant": { + "title": "Priced Product Variant", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ProductVariant" + }, + { + "type": "object", + "properties": { + "original_price": { + "type": "number", + "description": "The original price of the variant without any discounted prices applied." + }, + "calculated_price": { + "type": "number", + "description": "The calculated price of the variant. Can be a discounted price." + }, + "original_price_incl_tax": { + "type": "number", + "description": "The original price of the variant including taxes." + }, + "calculated_price_incl_tax": { + "type": "number", + "description": "The calculated price of the variant including taxes." + }, + "original_tax": { + "type": "number", + "description": "The taxes applied on the original price." + }, + "calculated_tax": { + "type": "number", + "description": "The taxes applied on the calculated price." + }, + "tax_rates": { + "type": "array", + "description": "An array of applied tax rates", + "items": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "description": "The tax rate value" + }, + "name": { + "type": "string", + "description": "The name of the tax rate" + }, + "code": { + "type": "string", + "description": "The code of the tax rate" + } + } + } + } + } + } + ] + }, + "Product": { + "title": "Product", + "description": "Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by.", + "type": "object", + "required": [ + "collection_id", + "created_at", + "deleted_at", + "description", + "discountable", + "external_id", + "handle", + "height", + "hs_code", + "id", + "is_giftcard", + "length", + "material", + "metadata", + "mid_code", + "origin_country", + "profile_id", + "status", + "subtitle", + "type_id", + "thumbnail", + "title", + "updated_at", + "weight", + "width" + ], + "properties": { + "id": { + "description": "The product's ID", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "title": { + "description": "A title that can be displayed for easy identification of the Product.", + "type": "string", + "example": "Medusa Coffee Mug" + }, + "subtitle": { + "description": "An optional subtitle that can be used to further specify the Product.", + "nullable": true, + "type": "string" + }, + "description": { + "description": "A short description of the Product.", + "nullable": true, + "type": "string", + "example": "Every programmer's best friend." + }, + "handle": { + "description": "A unique identifier for the Product (e.g. for slug structure).", + "nullable": true, + "type": "string", + "example": "coffee-mug" + }, + "is_giftcard": { + "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.", + "type": "boolean", + "default": false + }, + "status": { + "description": "The status of the product", + "type": "string", + "enum": [ + "draft", + "proposed", + "published", + "rejected" + ], + "default": "draft" + }, + "images": { + "description": "Images of the Product. Available if the relation `images` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Image" + } + }, + "thumbnail": { + "description": "A URL to an image file that can be used to identify the Product.", + "nullable": true, + "type": "string", + "format": "uri" + }, + "options": { + "description": "The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductOption" + } + }, + "variants": { + "description": "The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductVariant" + } + }, + "categories": { + "description": "The product's associated categories. Available if the relation `categories` are expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCategory" + } + }, + "profile_id": { + "description": "The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products.", + "type": "string", + "example": "sp_01G1G5V239ENSZ5MV4JAR737BM" + }, + "profile": { + "description": "Available if the relation `profile` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingProfile" + }, + "weight": { + "description": "The weight of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "length": { + "description": "The length of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "height": { + "description": "The height of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "width": { + "description": "The width of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "hs_code": { + "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "origin_country": { + "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "material": { + "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "collection_id": { + "description": "The Product Collection that the Product belongs to", + "nullable": true, + "type": "string", + "example": "pcol_01F0YESBFAZ0DV6V831JXWH0BG" + }, + "collection": { + "description": "A product collection object. Available if the relation `collection` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductCollection" + }, + "type_id": { + "description": "The Product type that the Product belongs to", + "nullable": true, + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "type": { + "description": "Available if the relation `type` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductType" + }, + "tags": { + "description": "The Product Tags assigned to the Product. Available if the relation `tags` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductTag" + } + }, + "discountable": { + "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.", + "type": "boolean", + "default": true + }, + "external_id": { + "description": "The external ID of the product", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channels": { + "description": "The sales channels the product is associated with. Available if the relation `sales_channels` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SalesChannel" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductCategory": { + "title": "ProductCategory", + "description": "Represents a product category", + "x-resourceId": "ProductCategory", + "type": "object", + "required": [ + "category_children", + "created_at", + "handle", + "id", + "is_active", + "is_internal", + "mpath", + "name", + "parent_category_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The product category's ID", + "type": "string", + "example": "pcat_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "name": { + "description": "The product category's name", + "type": "string", + "example": "Regular Fit" + }, + "handle": { + "description": "A unique string that identifies the Product Category - can for example be used in slug structures.", + "type": "string", + "example": "regular-fit" + }, + "mpath": { + "description": "A string for Materialized Paths - used for finding ancestors and descendents", + "nullable": true, + "type": "string", + "example": "pcat_id1.pcat_id2.pcat_id3" + }, + "is_internal": { + "type": "boolean", + "description": "A flag to make product category an internal category for admins", + "default": false + }, + "is_active": { + "type": "boolean", + "description": "A flag to make product category visible/hidden in the store front", + "default": false + }, + "rank": { + "type": "integer", + "description": "An integer that depicts the rank of category in a tree node", + "default": 0 + }, + "category_children": { + "description": "Available if the relation `category_children` are expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCategory" + } + }, + "parent_category_id": { + "description": "The ID of the parent category.", + "nullable": true, + "type": "string", + "default": null + }, + "parent_category": { + "description": "A product category object. Available if the relation `parent_category` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductCategory" + }, + "products": { + "description": "Products associated with category. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "ProductCollection": { + "title": "Product Collection", + "description": "Product Collections represents a group of Products that are related.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "handle", + "id", + "metadata", + "title", + "updated_at" + ], + "properties": { + "id": { + "description": "The product collection's ID", + "type": "string", + "example": "pcol_01F0YESBFAZ0DV6V831JXWH0BG" + }, + "title": { + "description": "The title that the Product Collection is identified by.", + "type": "string", + "example": "Summer Collection" + }, + "handle": { + "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.", + "nullable": true, + "type": "string", + "example": "summer-collection" + }, + "products": { + "description": "The Products contained in the Product Collection. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductOption": { + "title": "Product Option", + "description": "Product Options define properties that may vary between different variants of a Product. Common Product Options are \"Size\" and \"Color\", but Medusa doesn't limit what Product Options that can be defined.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "product_id", + "title", + "updated_at" + ], + "properties": { + "id": { + "description": "The product option's ID", + "type": "string", + "example": "opt_01F0YESHQBZVKCEXJ24BS6PCX3" + }, + "title": { + "description": "The title that the Product Option is defined by (e.g. `Size`).", + "type": "string", + "example": "Size" + }, + "values": { + "description": "The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductOptionValue" + } + }, + "product_id": { + "description": "The ID of the Product that the Product Option is defined for.", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "product": { + "description": "A product object. Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductOptionValue": { + "title": "Product Option Value", + "description": "A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "option_id", + "updated_at", + "value", + "variant_id" + ], + "properties": { + "id": { + "description": "The product option value's ID", + "type": "string", + "example": "optval_01F0YESHR7S6ECD03RF6W12DSJ" + }, + "value": { + "description": "The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \\\"Size\\\" this value could be `Small`, `Medium` or `Large`).", + "type": "string", + "example": "large" + }, + "option_id": { + "description": "The ID of the Product Option that the Product Option Value is defined for.", + "type": "string", + "example": "opt_01F0YESHQBZVKCEXJ24BS6PCX3" + }, + "option": { + "description": "Available if the relation `option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductOption" + }, + "variant_id": { + "description": "The ID of the Product Variant that the Product Option Value is defined for.", + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductTag": { + "title": "Product Tag", + "description": "Product Tags can be added to Products for easy filtering and grouping.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The product tag's ID", + "type": "string", + "example": "ptag_01G8K2MTMG9168F2B70S1TAVK3" + }, + "value": { + "description": "The value that the Product Tag represents", + "type": "string", + "example": "Pants" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductTaxRate": { + "title": "Product Tax Rate", + "description": "Associates a tax rate with a product to indicate that the product is taxed in a certain way", + "type": "object", + "required": [ + "created_at", + "metadata", + "product_id", + "rate_id", + "updated_at" + ], + "properties": { + "product_id": { + "description": "The ID of the Product", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "product": { + "description": "Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "rate_id": { + "description": "The ID of the Tax Rate", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "tax_rate": { + "description": "Available if the relation `tax_rate` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxRate" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductType": { + "title": "Product Type", + "description": "Product Type can be added to Products for filtering and reporting purposes.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The product type's ID", + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "value": { + "description": "The value that the Product Type represents.", + "type": "string", + "example": "Clothing" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductTypeTaxRate": { + "title": "Product Type Tax Rate", + "description": "Associates a tax rate with a product type to indicate that the product type is taxed in a certain way", + "type": "object", + "required": [ + "created_at", + "metadata", + "product_type_id", + "rate_id", + "updated_at" + ], + "properties": { + "product_type_id": { + "description": "The ID of the Product type", + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_type": { + "description": "Available if the relation `product_type` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductType" + }, + "rate_id": { + "description": "The id of the Tax Rate", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "tax_rate": { + "description": "Available if the relation `tax_rate` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxRate" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductVariant": { + "title": "Product Variant", + "description": "Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations.", + "type": "object", + "required": [ + "allow_backorder", + "barcode", + "created_at", + "deleted_at", + "ean", + "height", + "hs_code", + "id", + "inventory_quantity", + "length", + "manage_inventory", + "material", + "metadata", + "mid_code", + "origin_country", + "product_id", + "sku", + "title", + "upc", + "updated_at", + "weight", + "width" + ], + "properties": { + "id": { + "description": "The product variant's ID", + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "title": { + "description": "A title that can be displayed for easy identification of the Product Variant.", + "type": "string", + "example": "Small" + }, + "product_id": { + "description": "The ID of the Product that the Product Variant belongs to.", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "product": { + "description": "A product object. Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "prices": { + "description": "The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MoneyAmount" + } + }, + "sku": { + "description": "The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems.", + "nullable": true, + "type": "string", + "example": "shirt-123" + }, + "barcode": { + "description": "A generic field for a GTIN number that can be used to identify the Product Variant.", + "nullable": true, + "type": "string", + "example": null + }, + "ean": { + "description": "An EAN barcode number that can be used to identify the Product Variant.", + "nullable": true, + "type": "string", + "example": null + }, + "upc": { + "description": "A UPC barcode number that can be used to identify the Product Variant.", + "nullable": true, + "type": "string", + "example": null + }, + "variant_rank": { + "description": "The ranking of this variant", + "nullable": true, + "type": "number", + "default": 0 + }, + "inventory_quantity": { + "description": "The current quantity of the item that is stocked.", + "type": "integer", + "example": 100 + }, + "allow_backorder": { + "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.", + "type": "boolean", + "default": false + }, + "manage_inventory": { + "description": "Whether Medusa should manage inventory for the Product Variant.", + "type": "boolean", + "default": true + }, + "hs_code": { + "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "origin_country": { + "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "material": { + "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "weight": { + "description": "The weight of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "length": { + "description": "The length of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "height": { + "description": "The height of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "width": { + "description": "The width of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "options": { + "description": "The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductOptionValue" + } + }, + "inventory_items": { + "description": "The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductVariantInventoryItem" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductVariantInventoryItem": { + "title": "Product Variant Inventory Item", + "description": "Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "inventory_item_id", + "required_quantity", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The product variant inventory item's ID", + "type": "string", + "example": "pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "inventory_item_id": { + "description": "The id of the inventory item", + "type": "string" + }, + "variant_id": { + "description": "The id of the variant.", + "type": "string" + }, + "variant": { + "description": "A ProductVariant object. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "required_quantity": { + "description": "The quantity of an inventory item required for one quantity of the variant.", + "type": "integer", + "default": 1 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "PublishableApiKey": { + "title": "Publishable API key", + "description": "Publishable API key defines scopes (i.e. resources) that are available within a request.", + "type": "object", + "required": [ + "created_at", + "created_by", + "id", + "revoked_by", + "revoked_at", + "title", + "updated_at" + ], + "properties": { + "id": { + "description": "The key's ID", + "type": "string", + "example": "pk_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "created_by": { + "description": "The unique identifier of the user that created the key.", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "revoked_by": { + "description": "The unique identifier of the user that revoked the key.", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "revoked_at": { + "description": "The date with timezone at which the key was revoked.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "title": { + "description": "The key's title.", + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "PublishableApiKeySalesChannel": { + "title": "Publishable API key sales channel", + "description": "Holds mapping between Publishable API keys and Sales Channels", + "type": "object", + "required": [ + "publishable_key_id", + "sales_channel_id" + ], + "properties": { + "sales_channel_id": { + "description": "The sales channel's ID", + "type": "string", + "example": "sc_01G1G5V21KADXNGH29BJMAJ4B4" + }, + "publishable_key_id": { + "description": "The publishable API key's ID", + "type": "string", + "example": "pak_01G1G5V21KADXNGH29BJMAJ4B4" + } + } + }, + "Refund": { + "title": "Refund", + "description": "Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator.", + "type": "object", + "required": [ + "amount", + "created_at", + "id", + "idempotency_key", + "metadata", + "note", + "order_id", + "payment_id", + "reason", + "updated_at" + ], + "properties": { + "id": { + "description": "The refund's ID", + "type": "string", + "example": "ref_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "order_id": { + "description": "The id of the Order that the Refund is related to.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "payment_id": { + "description": "The payment's ID if available", + "nullable": true, + "type": "string", + "example": "pay_01G8ZCC5W42ZNY842124G7P5R9" + }, + "payment": { + "description": "Available if the relation `payment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Payment" + }, + "amount": { + "description": "The amount that has be refunded to the Customer.", + "type": "integer", + "example": 1000 + }, + "note": { + "description": "An optional note explaining why the amount was refunded.", + "nullable": true, + "type": "string", + "example": "I didn't like it" + }, + "reason": { + "description": "The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return.", + "type": "string", + "enum": [ + "discount", + "return", + "swap", + "claim", + "other" + ], + "example": "return" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the refund in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Region": { + "title": "Region", + "description": "Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries.", + "type": "object", + "required": [ + "automatic_taxes", + "created_at", + "currency_code", + "deleted_at", + "gift_cards_taxable", + "id", + "metadata", + "name", + "tax_code", + "tax_provider_id", + "tax_rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "name": { + "description": "The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name.", + "type": "string", + "example": "EU" + }, + "currency_code": { + "description": "The 3 character currency code that the Region uses.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "tax_rate": { + "description": "The tax rate that should be charged on purchases in the Region.", + "type": "number", + "example": 0 + }, + "tax_rates": { + "description": "The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxRate" + } + }, + "tax_code": { + "description": "The tax code used on purchases in the Region. This may be used by other systems for accounting purposes.", + "nullable": true, + "type": "string", + "example": null + }, + "gift_cards_taxable": { + "description": "Whether the gift cards are taxable or not in this region.", + "type": "boolean", + "default": true + }, + "automatic_taxes": { + "description": "Whether taxes should be automated in this region.", + "type": "boolean", + "default": true + }, + "countries": { + "description": "The countries that are included in the Region. Available if the relation `countries` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Country" + } + }, + "tax_provider_id": { + "description": "The ID of the tax provider used in this region", + "nullable": true, + "type": "string", + "example": null + }, + "tax_provider": { + "description": "Available if the relation `tax_provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxProvider" + }, + "payment_providers": { + "description": "The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentProvider" + } + }, + "fulfillment_providers": { + "description": "The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentProvider" + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the prices for the region include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ReservationItemDTO": { + "title": "Reservation item", + "description": "Represents a reservation of an inventory item at a stock location", + "type": "object", + "required": [ + "id", + "location_id", + "inventory_item_id", + "quantity" + ], + "properties": { + "id": { + "description": "The id of the reservation item", + "type": "string" + }, + "location_id": { + "description": "The id of the location of the reservation", + "type": "string" + }, + "inventory_item_id": { + "description": "The id of the inventory item the reservation relates to", + "type": "string" + }, + "quantity": { + "description": "The id of the reservation item", + "type": "number" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "ResponseInventoryItem": { + "allOf": [ + { + "$ref": "#/components/schemas/InventoryItemDTO" + }, + { + "type": "object", + "required": [ + "available_quantity" + ], + "properties": { + "available_quantity": { + "type": "number" + } + } + } + ] + }, + "Return": { + "title": "Return", + "description": "Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap.", + "type": "object", + "required": [ + "claim_order_id", + "created_at", + "id", + "idempotency_key", + "location_id", + "metadata", + "no_notification", + "order_id", + "received_at", + "refund_amount", + "shipping_data", + "status", + "swap_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The return's ID", + "type": "string", + "example": "ret_01F0YET7XPCMF8RZ0Y151NZV2V" + }, + "status": { + "description": "Status of the Return.", + "type": "string", + "enum": [ + "requested", + "received", + "requires_action", + "canceled" + ], + "default": "requested" + }, + "items": { + "description": "The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ReturnItem" + } + }, + "swap_id": { + "description": "The ID of the Swap that the Return is a part of.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "claim_order_id": { + "description": "The ID of the Claim that the Return is a part of.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "order_id": { + "description": "The ID of the Order that the Return is made from.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "shipping_method": { + "description": "The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingMethod" + }, + "shipping_data": { + "description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.", + "nullable": true, + "type": "object", + "example": {} + }, + "location_id": { + "description": "The id of the stock location the return will be added back.", + "nullable": true, + "type": "string", + "example": "sloc_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "refund_amount": { + "description": "The amount that should be refunded as a result of the return.", + "type": "integer", + "example": 1000 + }, + "no_notification": { + "description": "When set to true, no notification will be sent related to this return.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the return in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "received_at": { + "description": "The date with timezone at which the return was received.", + "nullable": true, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ReturnItem": { + "title": "Return Item", + "description": "Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned.", + "type": "object", + "required": [ + "is_requested", + "item_id", + "metadata", + "note", + "quantity", + "reason_id", + "received_quantity", + "requested_quantity", + "return_id" + ], + "properties": { + "return_id": { + "description": "The id of the Return that the Return Item belongs to.", + "type": "string", + "example": "ret_01F0YET7XPCMF8RZ0Y151NZV2V" + }, + "item_id": { + "description": "The id of the Line Item that the Return Item references.", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "return_order": { + "description": "Available if the relation `return_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "quantity": { + "description": "The quantity of the Line Item that is included in the Return.", + "type": "integer", + "example": 1 + }, + "is_requested": { + "description": "Whether the Return Item was requested initially or received unexpectedly in the warehouse.", + "type": "boolean", + "default": true + }, + "requested_quantity": { + "description": "The quantity that was originally requested to be returned.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "received_quantity": { + "description": "The quantity that was received in the warehouse.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "reason_id": { + "description": "The ID of the reason for returning the item.", + "nullable": true, + "type": "string", + "example": "rr_01G8X82GCCV2KSQHDBHSSAH5TQ" + }, + "reason": { + "description": "Available if the relation `reason` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ReturnReason" + }, + "note": { + "description": "An optional note with additional details about the Return.", + "nullable": true, + "type": "string", + "example": "I didn't like it." + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ReturnReason": { + "title": "Return Reason", + "description": "A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "description", + "id", + "label", + "metadata", + "parent_return_reason_id", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The return reason's ID", + "type": "string", + "example": "rr_01G8X82GCCV2KSQHDBHSSAH5TQ" + }, + "value": { + "description": "The value to identify the reason by.", + "type": "string", + "example": "damaged" + }, + "label": { + "description": "A text that can be displayed to the Customer as a reason.", + "type": "string", + "example": "Damaged goods" + }, + "description": { + "description": "A description of the Reason.", + "nullable": true, + "type": "string", + "example": "Items that are damaged" + }, + "parent_return_reason_id": { + "description": "The ID of the parent reason.", + "nullable": true, + "type": "string", + "example": null + }, + "parent_return_reason": { + "description": "Available if the relation `parent_return_reason` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ReturnReason" + }, + "return_reason_children": { + "description": "Available if the relation `return_reason_children` is expanded.", + "$ref": "#/components/schemas/ReturnReason" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "SalesChannel": { + "title": "Sales Channel", + "description": "A Sales Channel", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "description", + "id", + "is_disabled", + "name", + "updated_at" + ], + "properties": { + "id": { + "description": "The sales channel's ID", + "type": "string", + "example": "sc_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "name": { + "description": "The name of the sales channel.", + "type": "string", + "example": "Market" + }, + "description": { + "description": "The description of the sales channel.", + "nullable": true, + "type": "string", + "example": "Multi-vendor market" + }, + "is_disabled": { + "description": "Specify if the sales channel is enabled or disabled.", + "type": "boolean", + "default": false + }, + "locations": { + "description": "The Stock Locations related to the sales channel. Available if the relation `locations` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SalesChannelLocation" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "SalesChannelLocation": { + "title": "Sales Channel Stock Location", + "description": "Sales Channel Stock Location link sales channels with stock locations.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "location_id", + "sales_channel_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The Sales Channel Stock Location's ID", + "type": "string", + "example": "scloc_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "sales_channel_id": { + "description": "The id of the Sales Channel", + "type": "string", + "example": "sc_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "location_id": { + "description": "The id of the Location Stock.", + "type": "string" + }, + "sales_channel": { + "description": "The sales channel the location is associated with. Available if the relation `sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "ShippingMethod": { + "title": "Shipping Method", + "description": "Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment.", + "type": "object", + "required": [ + "cart_id", + "claim_order_id", + "data", + "id", + "order_id", + "price", + "return_id", + "shipping_option_id", + "swap_id" + ], + "properties": { + "id": { + "description": "The shipping method's ID", + "type": "string", + "example": "sm_01F0YET7DR2E7CYVSDHM593QG2" + }, + "shipping_option_id": { + "description": "The id of the Shipping Option that the Shipping Method is built from.", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "order_id": { + "description": "The id of the Order that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "claim_order_id": { + "description": "The id of the Claim that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "cart_id": { + "description": "The id of the Cart that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "swap_id": { + "description": "The id of the Swap that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "return_id": { + "description": "The id of the Return that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": null + }, + "return_order": { + "description": "A return object. Available if the relation `return_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "shipping_option": { + "description": "Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "tax_lines": { + "description": "Available if the relation `tax_lines` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethodTaxLine" + } + }, + "price": { + "description": "The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of.", + "type": "integer", + "example": 200 + }, + "data": { + "description": "Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id.", + "type": "object", + "example": {} + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Indicates if the shipping method price include tax", + "type": "boolean", + "default": false + }, + "subtotal": { + "description": "The subtotal of the shipping", + "type": "integer", + "example": 8000 + }, + "total": { + "description": "The total amount of the shipping", + "type": "integer", + "example": 8200 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + } + } + }, + "ShippingMethodTaxLine": { + "title": "Shipping Method Tax Line", + "description": "Shipping Method Tax Line", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "shipping_method_id", + "metadata", + "name", + "rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The line item tax line's ID", + "type": "string", + "example": "smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8" + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number", + "example": 10 + }, + "shipping_method_id": { + "description": "The ID of the line item", + "type": "string", + "example": "sm_01F0YET7DR2E7CYVSDHM593QG2" + }, + "shipping_method": { + "description": "Available if the relation `shipping_method` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingMethod" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ShippingOption": { + "title": "Shipping Option", + "description": "Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information.", + "type": "object", + "required": [ + "admin_only", + "amount", + "created_at", + "data", + "deleted_at", + "id", + "is_return", + "metadata", + "name", + "price_type", + "profile_id", + "provider_id", + "region_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The shipping option's ID", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "name": { + "description": "The name given to the Shipping Option - this may be displayed to the Customer.", + "type": "string", + "example": "PostFake Standard" + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "profile_id": { + "description": "The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products.", + "type": "string", + "example": "sp_01G1G5V239ENSZ5MV4JAR737BM" + }, + "profile": { + "description": "Available if the relation `profile` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingProfile" + }, + "provider_id": { + "description": "The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option.", + "type": "string", + "example": "manual" + }, + "provider": { + "description": "Available if the relation `provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/FulfillmentProvider" + }, + "price_type": { + "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.", + "type": "string", + "enum": [ + "flat_rate", + "calculated" + ], + "example": "flat_rate" + }, + "amount": { + "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.", + "nullable": true, + "type": "integer", + "example": 200 + }, + "is_return": { + "description": "Flag to indicate if the Shipping Option can be used for Return shipments.", + "type": "boolean", + "default": false + }, + "admin_only": { + "description": "Flag to indicate if the Shipping Option usage is restricted to admin users.", + "type": "boolean", + "default": false + }, + "requirements": { + "description": "The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingOptionRequirement" + } + }, + "data": { + "description": "The data needed for the Fulfillment Provider to identify the Shipping Option.", + "type": "object", + "example": {} + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the shipping option price include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ShippingOptionRequirement": { + "title": "Shipping Option Requirement", + "description": "A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart.", + "type": "object", + "required": [ + "amount", + "deleted_at", + "id", + "shipping_option_id", + "type" + ], + "properties": { + "id": { + "description": "The shipping option requirement's ID", + "type": "string", + "example": "sor_01G1G5V29AB4CTNDRFSRWSRKWD" + }, + "shipping_option_id": { + "description": "The id of the Shipping Option that the hipping option requirement belongs to", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "shipping_option": { + "description": "Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "type": { + "description": "The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available.", + "type": "string", + "enum": [ + "min_subtotal", + "max_subtotal" + ], + "example": "min_subtotal" + }, + "amount": { + "description": "The amount to compare the Cart subtotal to.", + "type": "integer", + "example": 100 + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "ShippingProfile": { + "title": "Shipping Profile", + "description": "Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "name", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The shipping profile's ID", + "type": "string", + "example": "sp_01G1G5V239ENSZ5MV4JAR737BM" + }, + "name": { + "description": "The name given to the Shipping profile - this may be displayed to the Customer.", + "type": "string", + "example": "Default Shipping Profile" + }, + "type": { + "description": "The type of the Shipping Profile, may be `default`, `gift_card` or `custom`.", + "type": "string", + "enum": [ + "default", + "gift_card", + "custom" + ], + "example": "default" + }, + "products": { + "description": "The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "shipping_options": { + "description": "The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingOption" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ShippingTaxRate": { + "title": "Shipping Tax Rate", + "description": "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way", + "type": "object", + "required": [ + "created_at", + "metadata", + "rate_id", + "shipping_option_id", + "updated_at" + ], + "properties": { + "shipping_option_id": { + "description": "The ID of the Shipping Option", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "shipping_option": { + "description": "Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "rate_id": { + "description": "The ID of the Tax Rate", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "tax_rate": { + "description": "Available if the relation `tax_rate` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxRate" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "StagedJob": { + "title": "Staged Job", + "description": "A staged job resource", + "type": "object", + "required": [ + "data", + "event_name", + "id", + "options" + ], + "properties": { + "id": { + "description": "The staged job's ID", + "type": "string", + "example": "job_01F0YET7BZTARY9MKN1SJ7AAXF" + }, + "event_name": { + "description": "The name of the event", + "type": "string", + "example": "order.placed" + }, + "data": { + "description": "Data necessary for the job", + "type": "object", + "example": {} + }, + "option": { + "description": "The staged job's option", + "type": "object", + "example": {} + } + } + }, + "StockLocationAddressDTO": { + "title": "Stock Location Address", + "description": "Represents a Stock Location Address", + "type": "object", + "required": [ + "address_1", + "country_code", + "created_at", + "updated_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The stock location address' ID", + "example": "laddr_51G4ZW853Y6TFXWPG5ENJ81X42" + }, + "address_1": { + "type": "string", + "description": "Stock location address", + "example": "35, Jhon Doe Ave" + }, + "address_2": { + "type": "string", + "description": "Stock location address' complement", + "example": "apartment 4432" + }, + "company": { + "type": "string", + "description": "Stock location company' name", + "example": "Medusa" + }, + "city": { + "type": "string", + "description": "Stock location address' city", + "example": "Mexico city" + }, + "country_code": { + "type": "string", + "description": "Stock location address' country", + "example": "MX" + }, + "phone": { + "type": "string", + "description": "Stock location address' phone number", + "example": "+1 555 61646" + }, + "postal_code": { + "type": "string", + "description": "Stock location address' postal code", + "example": "HD3-1G8" + }, + "province": { + "type": "string", + "description": "Stock location address' province", + "example": "Sinaloa" + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "StockLocationAddressInput": { + "title": "Stock Location Address Input", + "description": "Represents a Stock Location Address Input", + "type": "object", + "required": [ + "address_1", + "country_code" + ], + "properties": { + "address_1": { + "type": "string", + "description": "Stock location address", + "example": "35, Jhon Doe Ave" + }, + "address_2": { + "type": "string", + "description": "Stock location address' complement", + "example": "apartment 4432" + }, + "city": { + "type": "string", + "description": "Stock location address' city", + "example": "Mexico city" + }, + "country_code": { + "type": "string", + "description": "Stock location address' country", + "example": "MX" + }, + "phone": { + "type": "string", + "description": "Stock location address' phone number", + "example": "+1 555 61646" + }, + "postal_code": { + "type": "string", + "description": "Stock location address' postal code", + "example": "HD3-1G8" + }, + "province": { + "type": "string", + "description": "Stock location address' province", + "example": "Sinaloa" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "StockLocationDTO": { + "title": "Stock Location", + "description": "Represents a Stock Location", + "type": "object", + "required": [ + "id", + "name", + "address_id", + "created_at", + "updated_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The stock location's ID", + "example": "sloc_51G4ZW853Y6TFXWPG5ENJ81X42" + }, + "address_id": { + "type": "string", + "description": "Stock location address' ID", + "example": "laddr_05B2ZE853Y6FTXWPW85NJ81A44" + }, + "name": { + "type": "string", + "description": "The name of the stock location", + "example": "Main Warehouse" + }, + "address": { + "description": "The Address of the Stock Location", + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationAddressDTO" + }, + { + "type": "object" + } + ] + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "StockLocationExpandedDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationDTO" + }, + { + "type": "object", + "properties": { + "sales_channels": { + "$ref": "#/components/schemas/SalesChannel" + } + } + } + ] + }, + "Store": { + "title": "Store", + "description": "Holds settings for the Store, such as name, currencies, etc.", + "type": "object", + "required": [ + "created_at", + "default_currency_code", + "default_location_id", + "id", + "invite_link_template", + "metadata", + "name", + "payment_link_template", + "swap_link_template", + "updated_at" + ], + "properties": { + "id": { + "description": "The store's ID", + "type": "string", + "example": "store_01G1G5V21KADXNGH29BJMAJ4B4" + }, + "name": { + "description": "The name of the Store - this may be displayed to the Customer.", + "type": "string", + "example": "Medusa Store" + }, + "default_currency_code": { + "description": "The 3 character currency code that is the default of the store.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "default_currency": { + "description": "Available if the relation `default_currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "currencies": { + "description": "The currencies that are enabled for the Store. Available if the relation `currencies` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Currency" + } + }, + "swap_link_template": { + "description": "A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link.", + "nullable": true, + "type": "string", + "example": null + }, + "payment_link_template": { + "description": "A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link.", + "nullable": true, + "type": "string", + "example": null + }, + "invite_link_template": { + "description": "A template to generate Invite links from", + "nullable": true, + "type": "string", + "example": null + }, + "default_location_id": { + "description": "The location ID the store is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "default_sales_channel_id": { + "description": "The sales channel ID the cart is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "default_sales_channel": { + "description": "A sales channel object. Available if the relation `default_sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Swap": { + "title": "Swap", + "description": "Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference.", + "type": "object", + "required": [ + "allow_backorder", + "canceled_at", + "cart_id", + "confirmed_at", + "created_at", + "deleted_at", + "difference_due", + "fulfillment_status", + "id", + "idempotency_key", + "metadata", + "no_notification", + "order_id", + "payment_status", + "shipping_address_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The swap's ID", + "type": "string", + "example": "swap_01F0YET86Y9G92D3YDR9Y6V676" + }, + "fulfillment_status": { + "description": "The status of the Fulfillment of the Swap.", + "type": "string", + "enum": [ + "not_fulfilled", + "fulfilled", + "shipped", + "partially_shipped", + "canceled", + "requires_action" + ], + "example": "not_fulfilled" + }, + "payment_status": { + "description": "The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.", + "type": "string", + "enum": [ + "not_paid", + "awaiting", + "captured", + "confirmed", + "canceled", + "difference_refunded", + "partially_refunded", + "refunded", + "requires_action" + ], + "example": "not_paid" + }, + "order_id": { + "description": "The ID of the Order where the Line Items to be returned where purchased.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "additional_items": { + "description": "The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "return_order": { + "description": "A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "fulfillments": { + "description": "The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + } + }, + "payment": { + "description": "The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Payment" + }, + "difference_due": { + "description": "The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "shipping_address_id": { + "description": "The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order.", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_methods": { + "description": "The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "cart_id": { + "description": "The id of the Cart that the Customer will use to confirm the Swap.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "confirmed_at": { + "description": "The date with timezone at which the Swap was confirmed by the Customer.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date with timezone at which the Swap was canceled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification": { + "description": "If set to true, no notification will be sent related to this swap", + "nullable": true, + "type": "boolean", + "example": false + }, + "allow_backorder": { + "description": "If true, swaps can be completed with items out of stock", + "type": "boolean", + "default": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the swap in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "TaxLine": { + "title": "Tax Line", + "description": "Line item that specifies an amount of tax to add to a line item.", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "metadata", + "name", + "rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The tax line's ID", + "type": "string", + "example": "tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8" + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number", + "example": 10 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "TaxProvider": { + "title": "Tax Provider", + "description": "The tax service used to calculate taxes", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the tax provider as given by the plugin.", + "type": "string", + "example": "manual" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "TaxRate": { + "title": "Tax Rate", + "description": "A Tax Rate can be used to associate a certain rate to charge on products within a given Region", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "metadata", + "name", + "rate", + "region_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The tax rate's ID", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "rate": { + "description": "The numeric rate to charge", + "nullable": true, + "type": "number", + "example": 10 + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "region_id": { + "description": "The id of the Region that the rate belongs to", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "products": { + "description": "The products that belong to this tax rate. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "product_types": { + "description": "The product types that belong to this tax rate. Available if the relation `product_types` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + }, + "shipping_options": { + "type": "array", + "description": "The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded.", + "items": { + "$ref": "#/components/schemas/ShippingOption" + } + }, + "product_count": { + "description": "The count of products", + "type": "integer", + "example": 10 + }, + "product_type_count": { + "description": "The count of product types", + "type": "integer", + "example": 2 + }, + "shipping_option_count": { + "description": "The count of shipping options", + "type": "integer", + "example": 1 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "TrackingLink": { + "title": "Tracking Link", + "description": "Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "fulfillment_id", + "id", + "idempotency_key", + "metadata", + "tracking_number", + "updated_at", + "url" + ], + "properties": { + "id": { + "description": "The tracking link's ID", + "type": "string", + "example": "tlink_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "url": { + "description": "The URL at which the status of the shipment can be tracked.", + "nullable": true, + "type": "string", + "format": "uri" + }, + "tracking_number": { + "description": "The tracking number given by the shipping carrier.", + "type": "string", + "format": "RH370168054CN" + }, + "fulfillment_id": { + "description": "The id of the Fulfillment that the Tracking Link references.", + "type": "string", + "example": "ful_01G8ZRTMQCA76TXNAT81KPJZRF" + }, + "fulfillment": { + "description": "Available if the relation `fulfillment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Fulfillment" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a process in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "UpdateStockLocationInput": { + "title": "Update Stock Location Input", + "description": "Represents the Input to update a Stock Location", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The stock location name" + }, + "address_id": { + "type": "string", + "description": "The Stock location address ID" + }, + "address": { + "description": "Stock location address object", + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationAddressInput" + }, + { + "type": "object" + } + ] + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "User": { + "title": "User", + "description": "Represents a User who can manage store settings.", + "type": "object", + "required": [ + "api_token", + "created_at", + "deleted_at", + "email", + "first_name", + "id", + "last_name", + "metadata", + "role", + "updated_at" + ], + "properties": { + "id": { + "description": "The user's ID", + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "role": { + "description": "The user's role", + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ], + "default": "member" + }, + "email": { + "description": "The email of the User", + "type": "string", + "format": "email" + }, + "first_name": { + "description": "The first name of the User", + "nullable": true, + "type": "string", + "example": "Levi" + }, + "last_name": { + "description": "The last name of the User", + "nullable": true, + "type": "string", + "example": "Bogan" + }, + "api_token": { + "description": "An API token associated with the user.", + "nullable": true, + "type": "string", + "example": null + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "VariantInventory": { + "type": "object", + "properties": { + "id": { + "description": "the id of the variant", + "type": "string" + }, + "inventory": { + "description": "the stock location address ID", + "$ref": "#/components/schemas/ResponseInventoryItem" + }, + "sales_channel_availability": { + "type": "object", + "description": "An optional key-value map with additional details", + "properties": { + "channel_name": { + "description": "Sales channel name", + "type": "string" + }, + "channel_id": { + "description": "Sales channel id", + "type": "string" + }, + "available_quantity": { + "description": "Available quantity in sales channel", + "type": "number" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/api/admin.oas.yaml b/docs/api/admin.oas.yaml new file mode 100644 index 0000000000..415beed096 --- /dev/null +++ b/docs/api/admin.oas.yaml @@ -0,0 +1,30611 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Medusa Admin API + description: | + API reference for Medusa's Admin endpoints. All endpoints are prefixed with `/admin`. + + ## Authentication + + There are two ways to send authenticated requests to the Medusa server: Using a user's API token, or using a Cookie Session ID. + + + + ## Expanding Fields + + In many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response. + + Please note that the relations you pass to `expand` replace any relations that are expanded by default in the request. + + ### Expanding One Relation + + For example, when you retrieve products, you can retrieve their collection by passing to the `expand` query parameter the value `collection`: + + ```bash + curl "http://localhost:9000/admin/products?expand=collection" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Expanding Multiple Relations + + You can expand more than one relation by separating the relations in the `expand` query parameter with a comma. + + For example, to retrieve both the variants and the collection of products, pass to the `expand` query parameter the value `variants,collection`: + + ```bash + curl "http://localhost:9000/admin/products?expand=variants,collection" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Prevent Expanding Relations + + Some requests expand relations by default. You can prevent that by passing an empty expand value to retrieve an entity without any extra relations. + + For example: + + ```bash + curl "http://localhost:9000/admin/products?expand" \ + -H 'Authorization: Bearer {api_token}' + ``` + + This would retrieve each product with only its properties, without any relations like `collection`. + + ## Selecting Fields + + In many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response. + + Please note that if you pass a `fields` query parameter, only the fields you pass in the value along with the `id` of the entity will be returned in the response. + + Also, the `fields` query parameter does not affect the expanded relations. You'll have to use the `expand` parameter instead. + + ### Selecting One Field + + For example, when you retrieve a list of products, you can retrieve only the titles of the products by passing `title` as a value to the `fields` query parameter: + + ```bash + curl "http://localhost:9000/admin/products?fields=title" \ + -H 'Authorization: Bearer {api_token}' + ``` + + As mentioned above, the expanded relations such as `variants` will still be returned as they're not affected by the `fields` parameter. + + You can ensure that only the `title` field is returned by passing an empty value to the `expand` query parameter. For example: + + ```bash + curl "http://localhost:9000/admin/products?fields=title&expand" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Selecting Multiple Fields + + You can pass more than one field by seperating the field names in the `fields` query parameter with a comma. + + For example, to select the `title` and `handle` of products: + + ```bash + curl "http://localhost:9000/admin/products?fields=title,handle" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Retrieve Only the ID + + You can pass an empty `fields` query parameter to return only the ID of an entity. For example: + + ```bash + curl "http://localhost:9000/admin/products?fields" \ + -H 'Authorization: Bearer {api_token}' + ``` + + You can also pair with an empty `expand` query parameter to ensure that the relations aren't retrieved as well. For example: + + ```bash + curl "http://localhost:9000/admin/products?fields&expand" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ## Query Parameter Types + + This section covers how to pass some common data types as query parameters. This is useful if you're sending requests to the API endpoints and not using our JS Client. For example, when using cURL or Postman. + + ### Strings + + You can pass a string value in the form of `=`. + + For example: + + ```bash + curl "http://localhost:9000/admin/products?title=Shirt" \ + -H 'Authorization: Bearer {api_token}' + ``` + + If the string has any characters other than letters and numbers, you must encode them. + + For example, if the string has spaces, you can encode the space with `+` or `%20`: + + ```bash + curl "http://localhost:9000/admin/products?title=Blue%20Shirt" \ + -H 'Authorization: Bearer {api_token}' + ``` + + You can use tools like [this one](https://www.urlencoder.org/) to learn how a value can be encoded. + + ### Integers + + You can pass an integer value in the form of `=`. + + For example: + + ```bash + curl "http://localhost:9000/admin/products?offset=1" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Boolean + + You can pass a boolean value in the form of `=`. + + For example: + + ```bash + curl "http://localhost:9000/admin/products?is_giftcard=true" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Date and DateTime + + You can pass a date value in the form `=`. The date must be in the format `YYYY-MM-DD`. + + For example: + + ```bash + curl -g "http://localhost:9000/admin/products?created_at[lt]=2023-02-17" \ + -H 'Authorization: Bearer {api_token}' + ``` + + You can also pass the time using the format `YYYY-MM-DDTHH:MM:SSZ`. Please note that the `T` and `Z` here are fixed. + + For example: + + ```bash + curl -g "http://localhost:9000/admin/products?created_at[lt]=2023-02-17T07:22:30Z" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Array + + Each array value must be passed as a separate query parameter in the form `[]=`. You can also specify the index of each parameter in the brackets `[0]=`. + + For example: + + ```bash + curl -g "http://localhost:9000/admin/products?sales_channel_id[]=sc_01GPGVB42PZ7N3YQEP2WDM7PC7&sales_channel_id[]=sc_234PGVB42PZ7N3YQEP2WDM7PC7" \ + -H 'Authorization: Bearer {api_token}' + ``` + + Note that the `-g` parameter passed to `curl` disables errors being thrown for using the brackets. Read more [here](https://curl.se/docs/manpage.html#-g). + + ### Object + + Object parameters must be passed as separate query parameters in the form `[]=`. + + For example: + + ```bash + curl -g "http://localhost:9000/admin/products?created_at[lt]=2023-02-17&created_at[gt]=2022-09-17" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ## Pagination + + ### Query Parameters + + In listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`. + + `limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities. + + You can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on. + + For example, to limit the number of products returned in the List Products endpoint: + + ```bash + curl "http://localhost:9000/admin/products?limit=5" \ + -H 'Authorization: Bearer {api_token}' + ``` + + ### Response Fields + + In the response of listing endpoints, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`. + + Similar to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result. + + `count` is the total number of available items of this entity. It can be used to determine how many pages are there. + + For example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + license: + name: MIT + url: https://github.com/medusajs/medusa/blob/master/LICENSE +tags: + - name: Auth + description: Auth endpoints that allow authorization of admin Users and manages their sessions. + - name: Apps + description: App endpoints that allow handling apps in Medusa. + - name: Batch Jobs + description: Batch Job endpoints that allow handling batch jobs in Medusa. + - name: Collections + description: Collection endpoints that allow handling collections in Medusa. + - name: Customers + description: Customer endpoints that allow handling customers in Medusa. + - name: Customer Groups + description: Customer Group endpoints that allow handling customer groups in Medusa. + - name: Discounts + description: Discount endpoints that allow handling discounts in Medusa. + - name: Draft Orders + description: Draft Order endpoints that allow handling draft orders in Medusa. + - name: Gift Cards + description: Gift Card endpoints that allow handling gift cards in Medusa. + - name: Invites + description: Invite endpoints that allow handling invites in Medusa. + - name: Notes + description: Note endpoints that allow handling notes in Medusa. + - name: Notifications + description: Notification endpoints that allow handling notifications in Medusa. + - name: Orders + description: Order endpoints that allow handling orders in Medusa. + - name: Price Lists + description: Price List endpoints that allow handling price lists in Medusa. + - name: Products + description: Product endpoints that allow handling products in Medusa. + - name: Product Tags + description: Product Tag endpoints that allow handling product tags in Medusa. + - name: Product Types + description: Product Types endpoints that allow handling product types in Medusa. + - name: Regions + description: Region endpoints that allow handling regions in Medusa. + - name: Return Reasons + description: Return Reason endpoints that allow handling return reasons in Medusa. + - name: Returns + description: Return endpoints that allow handling returns in Medusa. + - name: Sales Channels + description: Sales Channel endpoints that allow handling sales channels in Medusa. + - name: Shipping Options + description: Shipping Option endpoints that allow handling shipping options in Medusa. + - name: Shipping Profiles + description: Shipping Profile endpoints that allow handling shipping profiles in Medusa. + - name: Store + description: Store endpoints that allow handling stores in Medusa. + - name: Swaps + description: Swap endpoints that allow handling swaps in Medusa. + - name: Tax Rates + description: Tax Rate endpoints that allow handling tax rates in Medusa. + - name: Uploads + description: Upload endpoints that allow handling uploads in Medusa. + - name: Users + description: User endpoints that allow handling users in Medusa. + - name: Variants + description: Product Variant endpoints that allow handling product variants in Medusa. +servers: + - url: https://api.medusa-commerce.com +paths: + /admin/apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Apps + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAppsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/apps/authorizations: + post: + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostAppsReq' + x-codegen: + method: authorize + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/apps/authorizations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Apps + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAppsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/auth: + get: + operationId: GetAuth + summary: Get Current User + x-authenticated: true + description: Gets the currently logged in User. + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.auth.getSession() + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/auth' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostAuth + summary: User Login + x-authenticated: false + description: Logs a User in and authorizes them to manage Store settings. + parameters: [] + 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. + x-codegen: + method: createSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.admin.auth.createSession({ + email: 'user@example.com', + password: 'supersecret' + }).then((({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteAuth + summary: User Logout + x-authenticated: true + description: Deletes the current session for the logged in user. + x-codegen: + method: deleteSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.auth.deleteSession() + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/auth' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/batch-jobs: + get: + operationId: GetBatchJobs + summary: List Batch Jobs + description: Retrieve a list of Batch Jobs. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of batch jobs to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of batch jobs to skip before results. + schema: + type: integer + default: 0 + - in: query + name: id + style: form + explode: false + description: Filter by the batch ID + schema: + oneOf: + - type: string + description: batch job ID + - type: array + description: multiple batch job IDs + items: + type: string + - in: query + name: type + style: form + explode: false + description: Filter by the batch type + schema: + type: array + items: + type: string + - in: query + name: confirmed_at + style: form + explode: false + description: Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: pre_processed_at + style: form + explode: false + description: Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: completed_at + style: form + explode: false + description: Date comparison for when resulting collections was completed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: failed_at + style: form + explode: false + description: Date comparison for when resulting collections was failed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + style: form + explode: false + description: Date comparison for when resulting collections was canceled, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: order + description: Field used to order retrieved batch jobs + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each order of the result. + schema: + type: string + - in: query + name: created_at + style: form + explode: false + description: Date comparison for when resulting collections was created, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + style: form + explode: false + description: Date comparison for when resulting collections was updated, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.list() + .then(({ batch_jobs, limit, offset, count }) => { + console.log(batch_jobs.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/batch-jobs' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Jobs + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostBatchesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.create({ + type: 'product-export', + context: {}, + dry_run: false + }).then((({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' \ + --data-raw '{ + "type": "product-export", + "context": { } + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Jobs + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/batch-jobs/{id}: + get: + operationId: GetBatchJobsBatchJob + summary: Get a Batch Job + description: Retrieves a Batch Job. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Batch Job + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.retrieve(batch_job_id) + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/batch-jobs/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Jobs + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/batch-jobs/{id}/cancel: + post: + operationId: PostBatchJobsBatchJobCancel + summary: Cancel a Batch Job + description: Marks a batch job as canceled + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the batch job. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.cancel(batch_job_id) + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Jobs + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/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 + x-codegen: + method: confirm + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.confirm(batch_job_id) + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Jobs + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of collections to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of collections to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: title + description: The title of collections to return. + schema: + type: string + - in: query + name: handle + description: The handle of collections to return. + schema: + type: string + - in: query + name: q + description: a search term to search titles and handles. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product collections. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.list() + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/collections' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCollectionsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.create({ + title: 'New Collection' + }) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/collections/{id}: + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Collection + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.retrieve(collection_id) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.update(collection_id, { + title: 'New Collection' + }) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.delete(collection_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/collections/{id}/products/batch: + post: + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsToCollectionReq' + x-codegen: + method: addProducts + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' + x-codegen: + method: removeProducts + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codegen: + method: list + queryParams: AdminGetCurrenciesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.currencies.list() + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/currencies' \ + --header 'Authorization: Bearer {api_token}' + tags: + - Currencies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCurrenciesListRes' + /admin/currencies/{code}: + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.currencies.update(code, { + includes_tax: true + }) + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/currencies/{code}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "includes_tax": true + }' + tags: + - Currencies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCurrenciesRes' + /admin/customer-groups: + get: + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching customer group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: order + description: the field used to order the customer groups. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by the customer group ID + schema: + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID + - in: query + name: name + style: form + explode: false + description: Filter by the customer group name + schema: + type: array + description: multiple customer group names + items: + type: string + description: customer group name + - in: query + name: created_at + description: Date comparison for when resulting customer groups were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting customer groups were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: integer + default: 10 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer groups of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetCustomerGroupsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.list() + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/customer-groups/{id}: + get: + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the customer group. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the customer group. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetCustomerGroupsGroupParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.retrieve(customer_group_id) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.update(customer_group_id, { + name: 'VIP' + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.delete(customer_group_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/customer-groups/{id}/customers: + get: + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: a search term to search email, first_name, and last_name. + schema: + type: string + x-codegen: + method: listCustomers + queryParams: AdminGetGroupsGroupCustomersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.listCustomers(customer_group_id) + .then(({ customers }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/customer-groups/{id}/customers/batch: + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: Adds a list of customers, represented by id's, to a customer group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq' + x-codegen: + method: addCustomers + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: Removes a list of customers, represented by id's, from a customer group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq' + x-codegen: + method: removeCustomers + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/customers: + get: + operationId: GetCustomers + summary: List Customers + description: Retrieves a list of Customers. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: a search term to search email, first_name, and last_name. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetCustomersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.list() + .then(({ customers, limit, offset, count }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.create({ + email: 'user@example.com', + first_name: 'Caterina', + last_name: 'Yost', + password: 'supersecret' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customers' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "first_name": "Caterina", + "last_name": "Yost", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customers + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/customers/{id}: + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: Retrieves a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the customer. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.retrieve(customer_id) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customers/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update a Customer + description: Updates a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each customer. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.update(customer_id, { + first_name: 'Dolly' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customers/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Dolly" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts: + get: + operationId: GetDiscounts + summary: List Discounts + x-authenticated: true + description: Retrieves a list of Discounts + parameters: + - in: query + name: q + description: Search query applied on the code field. + schema: + type: string + - in: query + name: rule + description: Discount Rules filters to apply on the search + schema: + type: object + properties: + type: + type: string + enum: + - fixed + - percentage + - free_shipping + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + allocation: + type: string + enum: + - total + - item + description: The value that the discount represents; this will depend on the type of the discount + - in: query + name: is_dynamic + description: Return only dynamic discounts. + schema: + type: boolean + - in: query + name: is_disabled + description: Return only disabled discounts. + schema: + type: boolean + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.list() + .then(({ discounts, limit, offset, count }) => { + console.log(discounts.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDiscounts + summary: Creates a Discount + x-authenticated: true + description: Creates a Discount with a given set of rules that define how the Discount behaves. + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsReq' + x-codegen: + method: create + queryParams: AdminPostDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + import { AllocationType, DiscountRuleType } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.create({ + code: 'TEST', + rule: { + type: DiscountRuleType.FIXED, + value: 10, + allocation: AllocationType.ITEM + }, + regions: ["reg_XXXXXXXX"], + is_dynamic: false, + is_disabled: false + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST", + "rule": { + "type": "fixed", + "value": 10, + "allocation": "item" + }, + "regions": ["reg_XXXXXXXX"] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/code/{code}: + get: + operationId: GetDiscountsDiscountCode + summary: Get Discount by Code + description: Retrieves a Discount by its discount code + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieveByCode + queryParams: AdminGetDiscountsDiscountCodeParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.retrieveByCode(code) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/code/{code}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/{discount_id}/conditions: + post: + operationId: PostDiscountsDiscountConditions + summary: Create a Condition + description: Creates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' + x-codegen: + method: createCondition + queryParams: AdminPostDiscountsDiscountConditionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + import { DiscountConditionOperator } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.createCondition(discount_id, { + operator: DiscountConditionOperator.IN + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "operator": "in" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/{discount_id}/conditions/{condition_id}: + get: + operationId: GetDiscountsDiscountConditionsCondition + summary: Get a Condition + description: Gets a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: getCondition + queryParams: AdminGetDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.getCondition(discount_id, condition_id) + .then(({ discount_condition }) => { + console.log(discount_condition.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountConditionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDiscountsDiscountConditionsCondition + summary: Update a Condition + description: Updates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each item of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each item of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditionsCondition' + x-codegen: + method: updateCondition + queryParams: AdminPostDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.updateCondition(discount_id, condition_id, { + products: [ + product_id + ] + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "products": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a Condition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.deleteCondition(discount_id, condition_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountConditionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/{discount_id}/conditions/{condition_id}/batch: + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add Batch Resources + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which relations should be expanded in each discount of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each discount of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq' + x-codegen: + method: addConditionResourceBatch + queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.addConditionResourceBatch(discount_id, condition_id, { + resources: [{ id: item_id }] + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete Batch Resources + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which relations should be expanded in each discount of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each discount of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq' + x-codegen: + method: deleteConditionResourceBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, condition_id, { + resources: [{ id: item_id }] + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/{id}: + get: + operationId: GetDiscountsDiscount + summary: Get a Discount + description: Retrieves a Discount + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetDiscountParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.retrieve(discount_id) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: 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 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each item of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each item of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' + x-codegen: + method: update + queryParams: AdminPostDiscountsDiscountParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.update(discount_id, { + code: 'TEST' + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: 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 + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.delete(discount_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/{id}/dynamic-codes: + post: + operationId: PostDiscountsDiscountDynamicCodes + summary: Create a Dynamic Code + description: Creates a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount to create the dynamic code from." + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq' + x-codegen: + method: createDynamicCode + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.createDynamicCode(discount_id, { + code: 'TEST', + usage_limit: 1 + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/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 + x-codegen: + method: deleteDynamicCode + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.deleteDynamicCode(discount_id, code) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/discounts/{id}/regions/{region_id}: + post: + operationId: PostDiscountsDiscountRegionsRegion + summary: Add Region + description: Adds a Region to the list of Regions that a Discount can be used in. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: addRegion + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.addRegion(discount_id, region_id) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountRegionsRegion + summary: Remove Region + x-authenticated: true + description: Removes a Region from the list of Regions that a Discount can be used in. + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: removeRegion + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.removeRegion(discount_id, region_id) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/draft-orders: + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: a search term to search emails in carts associated with draft orders and display IDs of draft orders + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetDraftOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.list() + .then(({ draft_orders, limit, offset, count }) => { + console.log(draft_orders.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/draft-orders' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.create({ + email: 'user@example.com', + region_id, + items: [ + { + quantity: 1 + } + ], + shipping_methods: [ + { + option_id + } + ], + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "region_id": "{region_id}" + "items": [ + { + "quantity": 1 + } + ], + "shipping_methods": [ + { + "option_id": "{option_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/draft-orders/{id}: + get: + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.retrieve(draft_order_id) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/draft-orders/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDraftOrdersDraftOrder + summary: Update a Draft Order + description: Updates a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.update(draft_order_id, { + email: "user@example.com" + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDraftOrdersDraftOrder + summary: Delete a Draft Order + description: Deletes a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.delete(draft_order_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/draft-orders/{id}/line-items: + post: + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item + description: Creates a Line Item for the Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' + x-codegen: + method: addLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.addLineItem(draft_order_id, { + quantity: 1 + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/draft-orders/{id}/line-items/{line_id}: + post: + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item + description: Updates a Line Item for a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + quantity: 1 + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/draft-orders/{id}/pay: + post: + summary: Registers a Payment + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Draft Order id. + schema: + type: string + x-codegen: + method: markPaid + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.markPaid(draft_order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/gift-cards: + get: + operationId: GetGiftCards + summary: List Gift Cards + description: Retrieves a list of Gift Cards. + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: a search term to search by code or display ID + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetGiftCardsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.list() + .then(({ gift_cards, limit, offset, count }) => { + console.log(gift_cards.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/gift-cards' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostGiftCards + summary: Create a Gift Card + description: Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostGiftCardsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.create({ + region_id + }) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/gift-cards' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/gift-cards/{id}: + get: + operationId: GetGiftCardsGiftCard + summary: Get a Gift Card + description: Retrieves a Gift Card. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.retrieve(gift_card_id) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/gift-cards/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostGiftCardsGiftCard + summary: Update a Gift Card + description: Update a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.update(gift_card_id, { + region_id + }) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/gift-cards/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteGiftCardsGiftCard + summary: Delete a Gift Card + description: Deletes a Gift Card + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.delete(gift_card_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/gift-cards/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/inventory-items: + get: + operationId: GetInventoryItems + summary: List inventory items. + description: Lists inventory items. + x-authenticated: true + parameters: + - in: query + name: offset + description: How many inventory items to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of inventory items returned. + schema: + type: integer + default: 20 + - 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 + - in: query + name: q + description: Query used for searching product inventory items and their properties. + schema: + type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string + - in: query + name: id + description: id to search for. + schema: + type: string + - in: query + name: sku + description: sku to search for. + schema: + type: string + - in: query + name: origin_country + description: origin_country to search for. + schema: + type: string + - in: query + name: mid_code + description: mid_code to search for. + schema: + type: string + - in: query + name: material + description: material to search for. + schema: + type: string + - in: query + name: hs_code + description: hs_code to search for. + schema: + type: string + - in: query + name: weight + description: weight to search for. + schema: + type: string + - in: query + name: length + description: length to search for. + schema: + type: string + - in: query + name: height + description: height to search for. + schema: + type: string + - in: query + name: width + description: width to search for. + schema: + type: string + - in: query + name: requires_shipping + description: requires_shipping to search for. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetInventoryItemsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.list() + .then(({ inventory_items }) => { + console.log(inventory_items.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItems + summary: Create an Inventory Item. + description: Creates an Inventory Item. + x-authenticated: true + parameters: + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsReq' + x-codegen: + method: create + queryParams: AdminPostInventoryItemsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.create(inventoryItemId, { + variant_id: 'variant_123', + sku: "sku-123", + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "variant_id": "variant_123", + "sku": "sku-123", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/inventory-items/{id}: + get: + operationId: GetInventoryItemsInventoryItem + summary: Retrive an Inventory Item. + description: Retrives an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetInventoryItemsItemParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.retrieve(inventoryItemId) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItem + summary: Update an Inventory Item. + description: Updates an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsInventoryItemReq' + x-codegen: + method: update + queryParams: AdminPostInventoryItemsInventoryItemParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.update(inventoryItemId, { + origin_country: "US", + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "origin_country": "US" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.delete(inventoryItemId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + /admin/inventory-items/{id}/location-levels: + get: + operationId: GetInventoryItemsInventoryItemLocationLevels + summary: List stock levels of a given location. + description: Lists stock levels of a given location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: offset + description: How many stock locations levels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations levels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: listLocationLevels + queryParams: AdminGetInventoryItemsItemLocationLevelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) + .then(({ inventory_item }) => { + console.log(inventory_item.location_levels); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq' + x-codegen: + method: createLocationLevel + queryParams: AdminPostInventoryItemsItemLocationLevelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { + location_id: 'sloc', + stocked_quantity: 10, + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "location_id": "sloc", + "stocked_quantity": 10 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/inventory-items/{id}/location-levels/{location_id}: + post: + operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel + summary: Update an Inventory Location Level for a given Inventory Item. + description: Updates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq' + x-codegen: + method: updateLocationLevel + queryParams: AdminPostInventoryItemsItemLocationLevelsLevelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, { + stocked_quantity: 15, + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "stocked_quantity": 15 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + x-codegen: + method: deleteLocationLevel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/invites: + get: + operationId: GetInvites + summary: Lists Invites + description: Lists all Invites + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.list() + .then(({ invites }) => { + console.log(invites.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/invites' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invites + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminListInvitesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInvites + summary: Create an Invite + description: Creates an Invite and triggers an 'invite' created event + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInvitesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.create({ + user: "user@example.com", + role: "admin" + }) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "user": "user@example.com", + "role": "admin" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invites + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/invites/accept: + post: + operationId: PostInvitesInviteAccept + summary: Accept an Invite + description: Accepts an Invite and creates a corresponding user + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' + x-codegen: + method: accept + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.accept({ + token, + user: { + first_name: 'Brigitte', + last_name: 'Collier', + password: 'supersecret' + } + }) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites/accept' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "token": "{token}", + "user": { + "first_name": "Brigitte", + "last_name": "Collier", + "password": "supersecret" + } + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invites + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/invites/{invite_id}: + delete: + operationId: DeleteInvitesInvite + summary: Delete an Invite + description: Deletes an Invite + x-authenticated: true + parameters: + - in: path + name: invite_id + required: true + description: The ID of the Invite + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.delete(invite_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/invites/{invite_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invites + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInviteDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/invites/{invite_id}/resend: + post: + operationId: PostInvitesInviteResend + summary: Resend an Invite + description: Resends an Invite by triggering the 'invite' created event again + x-authenticated: true + parameters: + - in: path + name: invite_id + required: true + description: The ID of the Invite + schema: + type: string + x-codegen: + method: resend + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.resend(invite_id) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invites + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/notes: + get: + operationId: GetNotes + summary: List Notes + x-authenticated: true + description: Retrieves a list of notes + parameters: + - in: query + name: limit + description: The number of notes to get + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset at which to get notes + schema: + type: number + default: '0' + - in: query + name: resource_id + description: The ID which the notes belongs to + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetNotesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.list() + .then(({ notes, limit, offset, count }) => { + console.log(notes.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostNotes + summary: Creates a Note + description: Creates a Note which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.create({ + resource_id, + resource_type: 'order', + value: 'We delivered this order' + }) + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/notes' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/notes/{id}: + get: + operationId: GetNotesNote + summary: Get a Note + description: Retrieves a single note using its id + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the note to retrieve. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.retrieve(note_id) + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostNotesNote + summary: Update a Note + x-authenticated: true + description: Updates a Note associated with some resource + parameters: + - in: path + name: id + required: true + description: The ID of the Note to update + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotesNoteReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.update(note_id, { + value: 'We delivered this order' + }) + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/notes/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteNotesNote + summary: Delete a Note + description: Deletes a Note. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Note to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.delete(note_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/notes/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/notifications: + get: + operationId: GetNotifications + summary: List Notifications + description: Retrieves a list of Notifications. + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of notifications to skip before starting to collect the notifications set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of notifications to return + schema: + type: integer + default: 50 + - in: query + name: fields + description: Comma separated fields to include in the result set + schema: + type: string + - in: query + name: expand + description: Comma separated fields to populate + schema: + type: string + - in: query + name: event_name + description: The name of the event that the notification was sent for. + schema: + type: string + - in: query + name: resource_type + description: The type of resource that the Notification refers to. + schema: + type: string + - in: query + name: resource_id + description: The ID of the resource that the Notification refers to. + schema: + type: string + - in: query + name: to + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id + schema: + type: string + - in: query + name: include_resends + description: A boolean indicating whether the result set should include resent notifications or not + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetNotificationsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notifications.list() + .then(({ notifications }) => { + console.log(notifications.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notifications' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notifications + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/notifications/{id}/resend: + post: + operationId: PostNotificationsNotificationResend + summary: Resend Notification + description: Resends a previously sent notifications, with the same data but optionally to a different address + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Notification + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' + x-codegen: + method: resend + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notifications.resend(notification_id) + .then(({ notification }) => { + console.log(notification.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/notifications/{id}/resend' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notifications + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/order-edits: + get: + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: GetOrderEditsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/order-edits' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEdits + summary: Create an OrderEdit + description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsReq' + x-authenticated: true + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.create({ order_id }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/order-edits/{id}: + get: + operationId: GetOrderEditsOrderEdit + summary: Get an OrderEdit + description: Retrieves a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: GetOrderEditsOrderEditParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.retrieve(orderEditId) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsOrderEdit + summary: Update an OrderEdit + description: Updates a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "internal_note": "internal reason XY" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteOrderEditsOrderEdit + summary: Delete an Order Edit + description: Delete an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.delete(order_edit_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditDeleteRes' + '400': + $ref: '#/components/responses/400_error' + /admin/order-edits/{id}/cancel: + post: + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.cancel(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /admin/order-edits/{id}/changes/{change_id}: + delete: + operationId: DeleteOrderEditsOrderEditItemChange + summary: Delete a Line Item Change + description: Deletes an Order Edit Item Change + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + - in: path + name: change_id + required: true + description: The ID of the Order Edit Item Change to delete. + schema: + type: string + x-codegen: + method: deleteItemChange + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditItemChangeDeleteRes' + '400': + $ref: '#/components/responses/400_error' + /admin/order-edits/{id}/confirm: + post: + operationId: PostOrderEditsOrderEditConfirm + summary: Confirms an OrderEdit + description: Confirms an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the order edit. + schema: + type: string + x-codegen: + method: confirm + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.confirm(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /admin/order-edits/{id}/items: + post: + operationId: PostOrderEditsEditLineItems + summary: Add a Line Item + description: Create an OrderEdit LineItem. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' + x-authenticated: true + x-codegen: + method: addLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/order-edits/{id}/items/{item_id}: + post: + operationId: PostOrderEditsEditLineItemsLineItem + summary: Upsert Line Item Change + description: Create or update the order edit change holding the line item changes + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to update. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, { + quantity: 5 + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "quantity": 5 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteOrderEditsOrderEditLineItemsLineItem + summary: Delete a Line Item + description: Delete line items from an order edit and create change item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete from. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to delete from order. + schema: + type: string + x-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/order-edits/{id}/request: + post: + operationId: PostOrderEditsOrderEditRequest + summary: Request Confirmation + description: Request customer confirmation of an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to request confirmation from. + schema: + type: string + x-codegen: + method: requestConfirmation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.requestConfirmation(order_edit_id) + .then({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/request' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders: + get: + operationId: GetOrders + summary: List Orders + description: Retrieves a list of Orders + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching orders by shipping address first name, orders' email, and orders' display ID + schema: + type: string + - in: query + name: id + description: ID of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + enum: + - not_fulfilled + - fulfilled + - partially_fulfilled + - shipped + - partially_shipped + - canceled + - returned + - partially_returned + - requires_action + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + enum: + - captured + - awaiting + - not_paid + - refunded + - partially_refunded + - canceled + - requires_action + - in: query + name: display_id + description: Display ID to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: customer_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Regions to search orders by + schema: + oneOf: + - type: string + description: ID of a Region. + - type: array + items: + type: string + description: ID of a Region. + - in: query + name: currency_code + style: form + explode: false + description: Currency code to search for + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + - in: query + name: tax_rate + description: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting orders were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting orders were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + description: Date comparison for when resulting orders were canceled. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: sales_channel_id + style: form + explode: false + description: Filter by Sales Channels + schema: + type: array + items: + type: string + description: The ID of a Sales Channel + - in: query + name: offset + description: How many orders to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of orders returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each order of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.list() + .then(({ orders, limit, offset, count }) => { + console.log(orders.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}: + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetOrdersOrderParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.retrieve(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrdersOrder + summary: Update an Order + description: Updates and order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderReq' + x-codegen: + method: update + params: AdminPostOrdersOrderParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.update(order_id, { + email: 'user@example.com' + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/adasda' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/archive: + post: + operationId: PostOrdersOrderArchive + summary: Archive Order + description: Archives the order with the given id. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: archive + params: AdminPostOrdersOrderArchiveParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.archive(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/archive' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/cancel: + post: + operationId: PostOrdersOrderCancel + summary: Cancel an Order + description: Registers an Order as canceled. This triggers a flow that will cancel any created Fulfillments and Payments, may fail if the Payment or Fulfillment Provider is unable to cancel the Payment/Fulfillment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancel + params: AdminPostOrdersOrderCancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancel(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/capture: + post: + operationId: PostOrdersOrderCapture + summary: Capture Order's Payment + description: Captures all the Payments associated with an Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: capturePayment + params: AdminPostOrdersOrderCaptureParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.capturePayment(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/capture' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/claims: + post: + operationId: PostOrdersOrderClaims + summary: Create a Claim + description: Creates a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' + x-codegen: + method: createClaim + params: AdminPostOrdersOrderClaimsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createClaim(order_id, { + type: 'refund', + claim_items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "type": "refund", + "claim_items": [ + { + "item_id": "asdsd", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/claims/{claim_id}: + post: + operationId: PostOrdersOrderClaimsClaim + summary: Update a Claim + description: Updates a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' + x-codegen: + method: updateClaim + params: AdminPostOrdersOrderClaimsClaimParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.updateClaim(order_id, claim_id, { + no_notification: true + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "no_notification": true + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/claims/{claim_id}/cancel: + post: + operationId: PostOrdersClaimCancel + summary: Cancel a Claim + description: Cancels a Claim + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelClaim + params: AdminPostOrdersClaimCancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelClaim(order_id, claim_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/claims/{claim_id}/fulfillments: + post: + operationId: PostOrdersOrderClaimsClaimFulfillments + summary: Create Claim Fulfillment + description: Creates a Fulfillment for a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq' + x-codegen: + method: fulfillClaim + params: AdminPostOrdersOrderClaimsClaimFulfillmentsReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.fulfillClaim(order_id, claim_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel: + post: + operationId: PostOrdersClaimFulfillmentsCancel + summary: Cancel Claim Fulfillment + description: Registers a claim's fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Claim relates to. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelClaimFulfillment + params: AdminPostOrdersClaimFulfillmentsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, fulfillment_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/claims/{claim_id}/shipments: + post: + operationId: PostOrdersOrderClaimsClaimShipments + summary: Create Claim Shipment + description: Registers a Claim Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' + x-codegen: + method: createClaimShipment + params: AdminPostOrdersOrderClaimsClaimShipmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createClaimShipment(order_id, claim_id, { + fulfillment_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/complete: + post: + operationId: PostOrdersOrderComplete + summary: Complete an Order + description: Completes an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: complete + params: AdminPostOrdersOrderCompleteParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.complete(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/complete' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/fulfillment: + post: + operationId: PostOrdersOrderFulfillments + summary: Create a Fulfillment + description: Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' + x-codegen: + method: createFulfillment + params: AdminPostOrdersOrderFulfillmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createFulfillment(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel: + post: + operationId: PostOrdersOrderFulfillmentsCancel + summary: Cancels a Fulfilmment + description: Registers a Fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelFulfillment + params: AdminPostOrdersOrderFulfillementsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/line-items/{line_item_id}/reserve: + post: + operationId: PostOrdersOrderLineItemReservations + summary: Create a Reservation for a line item + description: Creates a Reservation for a line item at a specified location, optionally for a partial quantity. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: line_item_id + required: true + description: The ID of the Line item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersOrderLineItemReservationReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createReservation(order_id, line_item_id, { + location_id + }) + .then(({ reservation }) => { + console.log(reservation.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "location_id": "loc_1" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/refund: + post: + operationId: PostOrdersOrderRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' + x-codegen: + method: refundPayment + params: AdminPostOrdersOrderRefundsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.refundPayment(order_id, { + amount: 1000, + reason: 'Do not like it' + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/adasda/refund' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "amount": 1000, + "reason": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/reservations: + get: + operationId: GetOrdersOrderReservations + summary: Get reservations for an Order + description: Retrieves reservations for an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: offset + description: How many reservations to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of reservations returned. + schema: + type: integer + default: 20 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.retrieveReservations(order_id) + .then(({ reservations }) => { + console.log(reservations[0].id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReservationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/return: + post: + operationId: PostOrdersOrderReturns + summary: Request a Return + description: Requests a Return. If applicable a return label will be created and other plugins notified. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' + x-codegen: + method: requestReturn + params: AdminPostOrdersOrderReturnsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.requestReturn(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/return' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/shipment: + post: + operationId: PostOrdersOrderShipment + summary: Create a Shipment + description: Registers a Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' + x-codegen: + method: createShipment + params: AdminPostOrdersOrderShipmentParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createShipment(order_id, { + fulfillment_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipment' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/shipping-methods: + post: + operationId: PostOrdersOrderShippingMethods + summary: Add a Shipping Method + description: Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced. + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShippingMethodsReq' + x-authenticated: true + x-codegen: + method: addShippingMethod + params: AdminPostOrdersOrderShippingMethodsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.addShippingMethod(order_id, { + price: 1000, + option_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "price": 1000, + "option_id": "{option_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/swaps: + post: + operationId: PostOrdersOrderSwaps + summary: Create a Swap + description: Creates a Swap. Swaps are used to handle Return of previously purchased goods and Fulfillment of replacements simultaneously. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded the order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included the order of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' + x-codegen: + method: createSwap + queryParams: AdminPostOrdersOrderSwapsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createSwap(order_id, { + return_items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "return_items": [ + { + "item_id": "asfasf", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/swaps/{swap_id}/cancel: + post: + operationId: PostOrdersSwapCancel + summary: Cancels a Swap + description: Cancels a Swap + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelSwap + params: AdminPostOrdersSwapCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelSwap(order_id, swap_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/swaps/{swap_id}/fulfillments: + post: + operationId: PostOrdersOrderSwapsSwapFulfillments + summary: Create Swap Fulfillment + description: Creates a Fulfillment for a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq' + x-codegen: + method: fulfillSwap + params: AdminPostOrdersOrderSwapsSwapFulfillmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.fulfillSwap(order_id, swap_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel: + post: + operationId: PostOrdersSwapFulfillmentsCancel + summary: Cancel Swap's Fulfilmment + description: Registers a Swap's Fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Swap relates to. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelSwapFulfillment + params: AdminPostOrdersSwapFulfillementsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, fulfillment_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/swaps/{swap_id}/process-payment: + post: + operationId: PostOrdersOrderSwapsSwapProcessPayment + summary: Process Swap Payment + description: When there are differences between the returned and shipped Products in a Swap, the difference must be processed. Either a Refund will be issued or a Payment will be captured. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: processSwapPayment + params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.processSwapPayment(order_id, swap_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/orders/{id}/swaps/{swap_id}/shipments: + post: + operationId: PostOrdersOrderSwapsSwapShipments + summary: Create Swap Shipment + description: Registers a Swap Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' + x-codegen: + method: createSwapShipment + params: AdminPostOrdersOrderSwapsSwapShipmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createSwapShipment(order_id, swap_id, { + fulfillment_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/payment-collections/{id}: + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Get a PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetPaymentCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/payment-collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPaymentCollectionsPaymentCollection + summary: Update PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" + }) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "description": "Description of payCol" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Del a PaymentCollection + description: Deletes a Payment Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + /admin/payment-collections/{id}/authorize: + post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Mark Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codegen: + method: markAsAuthorized + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/payments/{id}: + get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codegen: + method: retrieve + queryParams: GetPaymentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.payments.retrieve(payment_id) + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payments + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/payments/{id}/capture: + post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codegen: + method: capturePayment + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.payments.capturePayment(payment_id) + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payments + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/payments/{id}/refund: + post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPaymentRefundsReq' + x-codegen: + method: refundPayment + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', + }) + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payments/pay_123/refund' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payments + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRefundRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/price-lists: + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to get + schema: + type: number + default: '10' + - in: query + name: offset + description: The offset at which to get items + schema: + type: number + default: '0' + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each item of the result. + schema: + type: string + - in: query + name: order + description: field to order results by. + schema: + type: string + - in: query + name: id + description: ID to search for. + schema: + type: string + - in: query + name: q + description: query to search in price list description, price list name, and customer group name fields. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + enum: + - active + - draft + - in: query + name: name + description: price list name to search for. + schema: + type: string + - in: query + name: customer_groups + style: form + explode: false + description: Customer Group IDs to search for. + schema: + type: array + items: + type: string + - in: query + name: type + style: form + explode: false + description: Type to search for. + schema: + type: array + items: + type: string + enum: + - sale + - override + - in: query + name: created_at + description: Date comparison for when resulting price lists were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting price lists were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting price lists were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetPriceListPaginationParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.list() + .then(({ price_lists, limit, offset, count }) => { + console.log(price_lists.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPriceListsPriceList + summary: Create a Price List + description: Creates a Price List + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + import { PriceListType } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.create({ + name: 'New Price List', + description: 'A new price list', + type: PriceListType.SALE, + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "New Price List", + "description": "A new price list", + "type": "sale", + "prices": [ + { + "amount": 1000, + "variant_id": "afafa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/price-lists/{id}: + get: + operationId: GetPriceListsPriceList + summary: Get a Price List + description: Retrieves a Price List. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.retrieve(price_list_id) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPriceListsPriceListPriceList + summary: Update a Price List + description: Updates a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.update(price_list_id, { + name: 'New Price List' + }) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "New Price List" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: 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 + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.delete(price_list_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/price-lists/{id}/prices/batch: + post: + operationId: PostPriceListsPriceListPricesBatch + summary: Update Prices + description: Batch update prices for a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List to update prices for. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' + x-codegen: + method: addPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.addPrices(price_list_id, { + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "prices": [ + { + "amount": 100, + "variant_id": "afasfa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePriceListsPriceListPricesBatch + summary: Delete Prices + description: Batch delete prices that belong to a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List that the Money Amounts (Prices) that will be deleted belongs to. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' + x-codegen: + method: deletePrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.deletePrices(price_list_id, { + price_ids: [ + price_id + ] + }) + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "price_ids": [ + "adasfa" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteBatchRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/price-lists/{id}/products: + get: + operationId: GetPriceListsPriceListProducts + summary: List Products + description: Retrieves a list of Product that are part of a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the price list. + schema: + type: string + - in: query + name: q + description: Query used for searching product title and description, variant title and sku, and collection title. + schema: + type: string + - in: query + name: id + description: ID of the product to search for. + schema: + type: string + - in: query + name: status + description: Product status to search for + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + description: Collection IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: tags + description: Tag IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: title + description: product title to search for. + schema: + type: string + - in: query + name: description + description: product description to search for. + schema: + type: string + - in: query + name: handle + description: product handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: string + - in: query + name: type + description: to search for. + schema: + type: string + - in: query + name: order + description: field to sort results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting products were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + x-codegen: + method: listProducts + queryParams: AdminGetPriceListsPriceListProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.listProducts(price_list_id) + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}/products' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListsProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/price-lists/{id}/products/{product_id}/prices: + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete Product's Prices + description: Delete all the prices related to a specific product in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List that the Money Amounts that will be deleted belongs to. + schema: + type: string + - in: path + name: product_id + required: true + description: The ID of the product from which the money amount will be deleted. + schema: + type: string + x-codegen: + method: deleteProductPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.deleteProductPrices(price_list_id, product_id) + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteProductPricesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/price-lists/{id}/variants/{variant_id}/prices: + delete: + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete Variant's Prices + description: Delete all the prices related to a specific variant in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List that the Money Amounts that will be deleted belongs to. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the variant from which the money amount will be deleted. + schema: + type: string + x-codegen: + method: deleteVariantPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.deleteVariantPrices(price_list_id, variant_id) + .then(({ ids, object, deleted }) => { + console.log(ids); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteVariantPricesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/product-categories: + get: + operationId: GetProductCategories + summary: List Product Categories + description: Retrieve a list of product categories. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching product category names orhandles. + schema: + type: string + - in: query + name: is_internal + description: Search for only internal categories. + schema: + type: boolean + - in: query + name: is_active + description: Search for only active categories + schema: + type: boolean + - in: query + name: include_descendants_tree + description: Include all nested descendants of category + schema: + type: boolean + - in: query + name: parent_category_id + description: Returns categories scoped by parent + schema: + type: string + - in: query + name: offset + description: How many product categories to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of product categories returned. + schema: + type: integer + default: 100 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the product category. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.list() + .then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductCategories + summary: Create a Product Category + description: Creates a Product Category. + x-authenticated: true + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesReq' + x-codegen: + method: create + queryParams: AdminPostProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.create({ + name: "Skinny Jeans", + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/product-categories' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Skinny Jeans", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/product-categories/{id}: + get: + operationId: GetProductCategoriesCategory + summary: Get a Product Category + description: Retrieves a Product Category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetProductCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductCategoriesCategory + summary: Update a Product Category + description: Updates a Product Category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each product category. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesCategoryReq' + x-codegen: + method: update + queryParams: AdminPostProductCategoriesCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.update(product_category_id, { + name: "Skinny Jeans" + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Skinny Jeans" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductCategoriesCategory + summary: Delete a Product Category + description: Deletes a ProductCategory. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.delete(product_category_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/product-categories/{id}/products/batch: + post: + operationId: PostProductCategoriesCategoryProductsBatch + summary: Add Products to a category + description: Assign a batch of products to a product category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Category fields to be expanded in the response. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Category fields to be retrieved in the response. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq' + x-codegen: + method: addProducts + queryParams: AdminPostProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.addProducts(product_category_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location \ + --request POST 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductCategoriesCategoryProductsBatch + summary: Delete Products + description: Remove a list of products from a product category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Category fields to be expanded in the response. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Category fields to be retrieved in the response. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.removeProducts(product_category_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/product-tags: + get: + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of tags to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetProductTagsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productTags.list() + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-tags' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tags + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductTagsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productTypes.list() + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-types' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductTypesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products: + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Product + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching product title and description, variant title and sku, and collection title. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by product IDs. + schema: + oneOf: + - type: string + description: ID of the product to search for. + - type: array + items: + type: string + description: ID of a product. + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + style: form + explode: false + description: Collection ids to search for. + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: price_list_id + style: form + explode: false + description: Price List IDs to search for + schema: + type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: Sales Channel IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: category_id + style: form + explode: false + description: Category IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id + schema: + type: boolean + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting products were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.list() + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProducts + summary: Create a Product + x-authenticated: true + description: Creates a Product + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.create({ + title: 'Shirt', + is_giftcard: false, + discountable: true + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Shirt" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/tag-usage: + get: + operationId: GetProductsTagUsage + summary: List Tags Usage Number + description: Retrieves a list of Product Tags with how many times each is used. + x-authenticated: true + x-codegen: + method: listTags + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.listTags() + .then(({ tags }) => { + console.log(tags.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/tag-usage' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListTagsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/types: + get: + deprecated: true + operationId: GetProductsTypes + summary: List Product Types + description: Retrieves a list of Product Types. + x-authenticated: true + x-codegen: + method: listTypes + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.listTypes() + .then(({ types }) => { + console.log(types.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/types' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListTypesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/{id}: + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.retrieve(product_id) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProduct + summary: Update a Product + description: Updates a Product + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.update(product_id, { + title: 'Shirt', + images: [] + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsProduct + summary: Delete a Product + description: Deletes a Product and it's associated Product Variants. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.delete(product_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/asfsaf' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/{id}/metadata: + post: + operationId: PostProductsProductMetadata + summary: Set Product Metadata + description: Set metadata key/value pair for Product + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' + x-codegen: + method: setMetadata + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.setMetadata(product_id, { + key: 'test', + value: 'true' + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/metadata' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "key": "test", + "value": "true" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/{id}/options: + post: + operationId: PostProductsProductOptions + summary: Add an Option + x-authenticated: true + description: Adds a Product Option to a Product + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' + x-codegen: + method: addOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.addOption(product_id, { + title: 'Size' + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/{id}/options/{option_id}: + post: + operationId: PostProductsProductOptionsOption + summary: Update a Product Option + description: Updates a Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' + x-codegen: + method: updateOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.updateOption(product_id, option_id, { + title: 'Size' + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsProductOptionsOption + summary: Delete a Product Option + description: Deletes a Product Option. Before a Product Option can be deleted all Option Values for the Product Option must be the same. You may, for example, have to delete some of your variants prior to deleting the Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + x-codegen: + method: deleteOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.deleteOption(product_id, option_id) + .then(({ option_id, object, delete, product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteOptionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/{id}/variants: + get: + operationId: GetProductsProductVariants + summary: List a Product's Variants + description: Retrieves a list of the Product Variants associated with a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the product to search for the variants. + schema: + type: string + - in: query + name: fields + description: Comma separated string of the column to select. + schema: + type: string + - in: query + name: expand + description: Comma separated string of the relations to include. + schema: + type: string + - in: query + name: offset + description: How many items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: integer + default: 100 + x-codegen: + method: listVariants + queryParams: AdminGetProductsVariantsParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/{id}/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProductVariants + summary: Create a Product Variant + description: Creates a Product Variant. Each Product Variant must have a unique combination of Product Option Values. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' + x-codegen: + method: createVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.createVariant(product_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/variants' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ], + "options": [ + { + "option_id": "asdasf", + "value": "S" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/products/{id}/variants/{variant_id}: + post: + operationId: PostProductsProductVariantsVariant + summary: Update a Product Variant + description: Update a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' + x-codegen: + method: updateVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.updateVariant(product_id, variant_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsProductVariantsVariant + summary: Delete a Product Variant + description: Deletes a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + x-codegen: + method: deleteVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.deleteVariant(product_id, variant_id) + .then(({ variant_id, object, deleted, product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteVariantRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/publishable-api-key/{id}: + post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Update PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.update(publishableApiKeyId, { + title: "new title" + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "new title" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/publishable-api-keys: + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: GetPublishableApiKeysParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys, count, limit, offset }) => { + console.log(publishable_api_keys) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPublishableApiKeys + summary: Create PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' + x-authenticated: true + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.create({ + title + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Web API Key" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/publishable-api-keys/{id}: + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a PublishableApiKey + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.retrieve(publishableApiKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.delete(publishableApiKeyId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeyDeleteRes' + '400': + $ref: '#/components/responses/400_error' + /admin/publishable-api-keys/{id}/revoke: + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codegen: + method: revoke + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.revoke(publishableApiKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/publishable-api-keys/{id}/sales-channels: + get: + operationId: GetPublishableApiKeySalesChannels + summary: List SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string + x-codegen: + method: listSalesChannels + queryParams: GetPublishableApiKeySalesChannelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels }) => { + console.log(sales_channels.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysListSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/publishable-api-keys/{id}/sales-channels/batch: + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add SalesChannels + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq' + x-codegen: + method: addSalesChannelsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Delete SalesChannels + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq' + x-codegen: + method: deleteSalesChannelsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions: + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + x-authenticated: true + parameters: + - in: query + name: limit + schema: + type: integer + default: 50 + required: false + description: limit the number of regions in response + - in: query + name: offset + schema: + type: integer + default: 0 + required: false + description: Offset of regions in response (used for pagination) + - in: query + name: created_at + schema: + type: object + required: false + description: Date comparison for when resulting region was created, i.e. less than, greater than etc. + - in: query + name: updated_at + schema: + type: object + required: false + description: Date comparison for when resulting region was updated, i.e. less than, greater than etc. + - in: query + name: deleted_at + schema: + type: object + required: false + description: Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + x-codegen: + method: list + queryParams: AdminGetRegionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.list() + .then(({ regions, limit, offset, count }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostRegions + summary: Create a Region + description: Creates a Region + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.create({ + name: 'Europe', + currency_code: 'eur', + tax_rate: 0, + payment_providers: [ + 'manual' + ], + fulfillment_providers: [ + 'manual' + ], + countries: [ + 'DK' + ] + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Europe", + "currency_code": "eur", + "tax_rate": 0, + "payment_providers": [ + "manual" + ], + "fulfillment_providers": [ + "manual" + ], + "countries": [ + "DK" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}: + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.retrieve(region_id) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostRegionsRegion + summary: Update a Region + description: Updates a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.update(region_id, { + name: 'Europe' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Europe" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteRegionsRegion + summary: Delete a Region + description: Deletes a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.delete(region_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/countries: + post: + operationId: PostRegionsRegionCountries + summary: Add Country + description: Adds a Country to the list of Countries in a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' + x-codegen: + method: addCountry + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.addCountry(region_id, { + country_code: 'dk' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{region_id}/countries' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "country_code": "dk" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/countries/{country_code}: + delete: + operationId: PostRegionsRegionCountriesCountry + summary: Delete Country + x-authenticated: true + description: Removes a Country from the list of Countries in a Region + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: country_code + description: The 2 character ISO code for the Country. + required: true + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: deleteCountry + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.deleteCountry(region_id, 'dk') + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/fulfillment-options: + get: + operationId: GetRegionsRegionFulfillmentOptions + summary: List Fulfillment Options + description: Gathers all the fulfillment options available to in the Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: retrieveFulfillmentOptions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.retrieveFulfillmentOptions(region_id) + .then(({ fulfillment_options }) => { + console.log(fulfillment_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/fulfillment-providers: + post: + operationId: PostRegionsRegionFulfillmentProviders + summary: Add Fulfillment Provider + description: Adds a Fulfillment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq' + x-codegen: + method: addFulfillmentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.addFulfillmentProvider(region_id, { + provider_id: 'manual' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider_id": "manual" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/fulfillment-providers/{provider_id}: + delete: + operationId: PostRegionsRegionFulfillmentProvidersProvider + summary: Del. Fulfillment Provider + description: Removes a Fulfillment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Fulfillment Provider. + schema: + type: string + x-codegen: + method: deleteFulfillmentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/payment-providers: + post: + operationId: PostRegionsRegionPaymentProviders + summary: Add Payment Provider + description: Adds a Payment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' + x-codegen: + method: addPaymentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.addPaymentProvider(region_id, { + provider_id: 'manual' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider_id": "manual" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/regions/{id}/payment-providers/{provider_id}: + delete: + operationId: PostRegionsRegionPaymentProvidersProvider + summary: Delete Payment Provider + description: Removes a Payment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Payment Provider. + schema: + type: string + x-codegen: + method: deletePaymentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/reservations: + get: + operationId: GetReservations + summary: List Reservations + description: Retrieve a list of Reservations. + x-authenticated: true + parameters: + - in: query + name: location_id + style: form + explode: false + description: Location ids to search for. + schema: + type: array + items: + type: string + - in: query + name: inventory_item_id + style: form + explode: false + description: Inventory Item ids to search for. + schema: + type: array + items: + type: string + - in: query + name: line_item_id + style: form + explode: false + description: Line Item ids to search for. + schema: + type: array + items: + type: string + - in: query + name: quantity + description: Filter by reservation quantity + schema: + type: object + properties: + lt: + type: number + description: filter by reservation quantity less than this number + gt: + type: number + description: filter by reservation quantity greater than this number + lte: + type: number + description: filter by reservation quantity less than or equal to this number + gte: + type: number + description: filter by reservation quantity greater than or equal to this number + - in: query + name: offset + description: How many Reservations to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of Reservations returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the product category. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetReservationsParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReservationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReservations + summary: Creates a Reservation + description: Creates a Reservation which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.create({ + }) + .then(({ reservations }) => { + console.log(reservations.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/reservations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReservationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/reservations/{id}: + get: + operationId: GetReservationsReservation + summary: Get a Reservation + description: Retrieves a single reservation using its id + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the reservation to retrieve. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.retrieve(reservation_id) + .then(({ reservation }) => { + console.log(reservation.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReservationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReservationsReservation + summary: Updates a Reservation + description: Updates a Reservation which can be associated with any resource as required. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReservationReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.update(reservation.id, { + quantity: 3 + }) + .then(({ reservations }) => { + console.log(reservations.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/reservations/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 3, + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReservationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteReservationsReservation + summary: Delete a Reservation + description: Deletes a Reservation. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.delete(reservation.id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReservationsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/return-reasons: + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.list() + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/return-reasons' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnReasonsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.create({ + label: 'Damaged', + value: 'damaged' + }) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/return-reasons' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "label": "Damaged", + "value": "damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/return-reasons/{id}: + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.retrieve(return_reason_id) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/return-reasons/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' + }) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/return-reasons/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "label": "Damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the return reason + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.delete(return_reason_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/return-reasons/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/returns: + get: + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-codegen: + method: list + queryParams: AdminGetReturnsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returns.list() + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/returns' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Returns + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/returns/{id}/cancel: + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returns.cancel(return_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Returns + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsCancelRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/returns/{id}/receive: + post: + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: Registers a Return as received. Updates statuses on Orders and Swaps accordingly. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' + x-codegen: + method: receive + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returns.receive(return_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/receive' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "items": [ + { + "item_id": "asafg", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Returns + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/sales-channels: + get: + operationId: GetSalesChannels + summary: List Sales Channels + description: Retrieves a list of sales channels + x-authenticated: true + parameters: + - in: query + name: id + description: ID of the sales channel + schema: + type: string + - in: query + name: name + description: Name of the sales channel + schema: + type: string + - in: query + name: description + description: Description of the sales channel + schema: + type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string + - in: query + name: order + description: The field to order the results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many sales channels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of sales channels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each sales channel of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each sales channel of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetSalesChannelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.list() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/sales-channels' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostSalesChannels + summary: Create a Sales Channel + description: Creates a Sales Channel. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.create({ + name: 'App', + description: 'Mobile app' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/sales-channels/{id}: + get: + operationId: GetSalesChannelsSalesChannel + summary: Get a Sales Channel + description: Retrieves the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.retrieve(sales_channel_id) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/sales-channels/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostSalesChannelsSalesChannel + summary: Update a Sales Channel + description: Updates a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.update(sales_channel_id, { + name: 'App' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsSalesChannel + summary: Delete a Sales Channel + description: Deletes the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.delete(sales_channel_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/sales-channels/{id}/products/batch: + post: + operationId: PostSalesChannelsChannelProductsBatch + summary: Add Products + description: Assign a batch of product to a sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq' + x-codegen: + method: addProducts + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.addProducts(sales_channel_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsChannelProductsBatch + summary: Delete Products + description: Remove a list of products from a sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq' + x-codegen: + method: removeProducts + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.removeProducts(sales_channel_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/sales-channels/{id}/stock-locations: + post: + operationId: PostSalesChannelsSalesChannelStockLocation + summary: Associate a stock location to a Sales Channel + description: Associates a stock location to a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq' + x-codegen: + method: addLocation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.addLocation(sales_channel_id, { + location_id: 'App' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "locaton_id": "stock_location_id" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsSalesChannelStockLocation + summary: Remove a stock location from a Sales Channel + description: Removes a stock location from a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq' + x-codegen: + method: removeLocation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.removeLocation(sales_channel_id, { + location_id: 'App' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "locaton_id": "stock_location_id" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsDeleteLocationRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/shipping-options: + get: + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. + x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return + schema: + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options + x-codegen: + method: list + queryParams: AdminGetShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.list() + .then(({ shipping_options, count }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-options' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingOptions + summary: Create Shipping Option + description: Creates a Shipping Option + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingOptionsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' + }) + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-options' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/shipping-options/{id}: + get: + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.retrieve(option_id) + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-options/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingOptionsOption + summary: Update Shipping Option + description: Updates a Shipping Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.update(option_id, { + name: 'PostFake', + requirements: [ + { + id, + type: 'max_subtotal', + amount: 1000 + } + ] + }) + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-options/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "requirements": [ + { + "type": "max_subtotal", + "amount": 1000 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteShippingOptionsOption + summary: Delete a Shipping Option + description: Deletes a Shipping Option. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.delete(option_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/shipping-options/{option_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/shipping-profiles: + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.list() + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingProfiles + summary: Create a Shipping Profile + description: Creates a Shipping Profile + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingProfilesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/shipping-profiles/{id}: + get: + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.retrieve(profile_id) + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' + }) + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles/{id} \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.delete(profile_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteShippingProfileRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/stock-locations: + get: + operationId: GetStockLocations + summary: List Stock Locations + description: Retrieves a list of stock locations + x-authenticated: true + parameters: + - in: query + name: id + description: ID of the stock location + schema: + type: string + - in: query + name: name + description: Name of the stock location + schema: + type: string + - in: query + name: order + description: The field to order the results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many stock locations to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each stock location of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each stock location of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetStockLocationsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.list() + .then(({ stock_locations, limit, offset, count }) => { + console.log(stock_locations.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/stock-locations' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostStockLocations + summary: Create a Stock Location + description: Creates a Stock Location. + x-authenticated: true + parameters: + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStockLocationsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.create({ + name: 'Main Warehouse', + location_id: 'sloc' + }) + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/stock-locations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/stock-locations/{id}: + get: + operationId: GetStockLocationsStockLocation + summary: Get a Stock Location + description: Retrieves the Stock Location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetStockLocationsLocationParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.retrieve(stock_location_id) + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + post: + operationId: PostStockLocationsStockLocation + summary: Update a Stock Location + description: Updates a Stock Location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStockLocationsLocationReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.update(stock_location_id, { + name: 'App' + }) + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.delete(stock_location_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + /admin/store: + get: + operationId: GetStore + summary: Get Store details + description: Retrieves the Store details + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.retrieve() + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminExtendedStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostStore + summary: Update Store Details + description: Updates the Store details + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStoreReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.update({ + name: 'Medusa Store' + }) + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/store' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Medusa Store" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/store/currencies/{code}: + post: + operationId: PostStoreCurrenciesCode + summary: Add a Currency Code + description: Adds a Currency Code to the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: addCurrency + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.addCurrency('eur') + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/store/currencies/eur' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteStoreCurrenciesCode + summary: Delete a Currency Code + description: Removes a Currency Code from the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: deleteCurrency + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.deleteCurrency('eur') + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/store/currencies/eur' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/store/payment-providers: + get: + operationId: GetStorePaymentProviders + summary: List Payment Providers + description: Retrieves the configured Payment Providers + x-authenticated: true + x-codegen: + method: listPaymentProviders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.listPaymentProviders() + .then(({ payment_providers }) => { + console.log(payment_providers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store/payment-providers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentProvidersList' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/store/tax-providers: + get: + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers + x-authenticated: true + x-codegen: + method: listTaxProviders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.listTaxProviders() + .then(({ tax_providers }) => { + console.log(tax_providers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store/tax-providers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxProvidersList' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/swaps: + get: + operationId: GetSwaps + summary: List Swaps + description: Retrieves a list of Swaps. + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-authenticated: true + x-codegen: + method: list + queryParams: AdminGetSwapsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.swaps.list() + .then(({ swaps }) => { + console.log(swaps.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swaps + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSwapsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/swaps/{id}: + get: + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.swaps.retrieve(swap_id) + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swaps + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/tax-rates: + get: + operationId: GetTaxRates + summary: List Tax Rates + description: Retrieves a list of TaxRates + x-authenticated: true + parameters: + - in: query + name: name + description: Name of tax rate to retrieve + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Filter by Region ID + schema: + oneOf: + - type: string + - type: array + items: + type: string + - in: query + name: code + description: code to search for. + schema: + type: string + - in: query + name: rate + style: form + explode: false + description: Filter by Rate + schema: + oneOf: + - type: number + - type: object + properties: + lt: + type: number + description: filter by rates less than this number + gt: + type: number + description: filter by rates greater than this number + lte: + type: number + description: filter by rates less than or equal to this number + gte: + type: number + description: filter by rates greater than or equal to this number + - in: query + name: offset + description: How many tax rates to skip before retrieving the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of tax rates returned. + schema: + type: integer + default: 50 + - in: query + name: fields + description: Which fields should be included in each item. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved for each item. + style: form + explode: false + schema: + type: array + items: + type: string + x-codegen: + method: list + queryParams: AdminGetTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.list() + .then(({ tax_rates, limit, offset, count }) => { + console.log(tax_rates.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/tax-rates' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostTaxRates + summary: Create a Tax Rate + description: Creates a Tax Rate + parameters: + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesReq' + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.create({ + code: 'TEST', + name: 'New Tax Rate', + region_id + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST", + "name": "New Tax Rate", + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/tax-rates/{id}: + get: + operationId: GetTaxRatesTaxRate + summary: Get a Tax Rate + description: Retrieves a TaxRate + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + x-codegen: + method: retrieve + queryParams: AdminGetTaxRatesTaxRateParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.retrieve(tax_rate_id) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/tax-rates/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostTaxRatesTaxRate + summary: Update a Tax Rate + description: Updates a Tax Rate + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' + x-codegen: + method: update + queryParams: AdminPostTaxRatesTaxRateParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.update(tax_rate_id, { + name: 'New Tax Rate' + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "New Tax Rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRate + summary: Delete a Tax Rate + description: Deletes a Tax Rate + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.delete(tax_rate_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/tax-rates/{id}/product-types/batch: + post: + operationId: PostTaxRatesTaxRateProductTypes + summary: Add to Product Types + description: Associates a Tax Rate with a list of Product Types + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' + x-codegen: + method: addProductTypes + queryParams: AdminPostTaxRatesTaxRateProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.addProductTypes(tax_rate_id, { + product_types: [ + product_type_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_types": [ + "{product_type_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateProductTypes + summary: Delete from Product Types + description: Removes a Tax Rate from a list of Product Types + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' + x-codegen: + method: removeProductTypes + queryParams: AdminDeleteTaxRatesTaxRateProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.removeProductTypes(tax_rate_id, { + product_types: [ + product_type_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_types": [ + "{product_type_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/tax-rates/{id}/products/batch: + post: + operationId: PostTaxRatesTaxRateProducts + summary: Add to Products + description: Associates a Tax Rate with a list of Products + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' + x-codegen: + method: addProducts + queryParams: AdminPostTaxRatesTaxRateProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.addProducts(tax_rate_id, { + products: [ + product_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "products": [ + "{product_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateProducts + summary: Delete from Products + description: Removes a Tax Rate from a list of Products + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteTaxRatesTaxRateProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.removeProducts(tax_rate_id, { + products: [ + product_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "products": [ + "{product_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/tax-rates/{id}/shipping-options/batch: + post: + operationId: PostTaxRatesTaxRateShippingOptions + summary: Add to Shipping Options + description: Associates a Tax Rate with a list of Shipping Options + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: addShippingOptions + queryParams: AdminPostTaxRatesTaxRateShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.addShippingOptions(tax_rate_id, { + shipping_options: [ + shipping_option_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "shipping_options": [ + "{shipping_option_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateShippingOptions + summary: Del. for Shipping Options + description: Removes a Tax Rate from a list of Shipping Options + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: removeShippingOptions + queryParams: AdminDeleteTaxRatesTaxRateShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.removeShippingOptions(tax_rate_id, { + shipping_options: [ + shipping_option_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "shipping_options": [ + "{shipping_option_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/uploads: + post: + operationId: PostUploads + summary: Upload files + description: Uploads at least one file to the specific fileservice that is installed in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.create(file) + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: image/jpeg' \ + --form 'files=@""' \ + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Uploads + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteUploads + summary: Delete an Uploaded File + description: Removes an uploaded file using the installed fileservice + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUploadsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.delete({ + file_key + }) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "file_key": "{file_key}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Uploads + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/uploads/download-url: + post: + operationId: PostUploadsDownloadUrl + summary: Get a File's Download URL + description: Creates a presigned download url for a file + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostUploadsDownloadUrlReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.getPresignedDownloadUrl({ + file_key + }) + .then(({ download_url }) => { + console.log(download_url); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "file_key": "{file_key}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Uploads + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsDownloadUrlRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/uploads/protected: + post: + operationId: PostUploadsProtected + summary: Protected File Upload + description: Uploads at least one file with ACL or a non-public bucket to the specific fileservice that is installed in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.createProtected(file) + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads/protected' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: image/jpeg' \ + --form 'files=@""' \ + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Uploads + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/users: + get: + operationId: GetUsers + summary: List Users + description: Retrieves all users. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.list() + .then(({ users }) => { + console.log(users.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/users' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUsersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostUsers + summary: Create a User + description: Creates a User + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateUserRequest' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.create({ + email: 'user@example.com', + password: 'supersecret' + }) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/users/password-token: + post: + operationId: PostUsersUserPasswordToken + summary: Request Password Reset + description: Generates a password token for a User with a given email. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' + x-codegen: + method: sendResetPasswordToken + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.sendResetPasswordToken({ + email: 'user@example.com' + }) + .then(() => { + // successful + }) + .catch(() => { + // error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/password-token' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/users/reset-password: + post: + operationId: PostUsersUserPassword + summary: Reset Password + description: Sets the password for a User given the correct token. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminResetPasswordRequest' + x-codegen: + method: resetPassword + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.resetPassword({ + token: 'supersecrettoken', + password: 'supersecret' + }) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/reset-password' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "token": "supersecrettoken", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/users/{id}: + get: + operationId: GetUsersUser + summary: Get a User + description: Retrieves a User. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.retrieve(user_id) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/users/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostUsersUser + summary: Update a User + description: Updates a User + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateUserRequest' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.update(user_id, { + first_name: 'Marcellus' + }) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Marcellus" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteUsersUser + summary: Delete a User + description: Deletes a User + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.delete(user_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/users/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/variants: + get: + operationId: GetVariants + summary: List Product Variants + description: Retrieves a list of Product Variants + x-authenticated: true + parameters: + - in: query + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: filter by inventory quantity less than or equal to this number + gte: + type: number + description: filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: AdminGetVariantsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Variants + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminVariantsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/variants/{id}: + get: + operationId: GetVariantsVariant + summary: Get a Product variant + description: Retrieves a Product variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the variant. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded the order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included the order of the result. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetVariantParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.variants.retrieve(product_id) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/variants/{id}/inventory: + get: + operationId: GetVariantsVariantInventory + summary: Get inventory of Variant. + description: Returns the available inventory of a Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Product Variant id to get inventory for. + schema: + type: string + x-codegen: + method: getInventory + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Variants + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variant: + type: object + $ref: '#/components/schemas/AdminGetVariantsVariantInventoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' +components: + responses: + default_error: + description: Default Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + invalid_state_error: + description: Invalid State Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: The request conflicted with another request. You may retry the request with the provided Idempotency-Key. + type: QueryRunnerAlreadyReleasedError + invalid_request_error: + description: Invalid Request Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: invalid_request_error + message: Discount with code TEST already exists. + type: duplicate_error + not_found_error: + description: Not Found Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + message: Entity with id 1 was not found + type: not_found + 400_error: + description: Client Error or Multiple Errors + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' + examples: + not_allowed: + $ref: '#/components/examples/not_allowed_error' + invalid_data: + $ref: '#/components/examples/invalid_data_error' + MultipleErrors: + $ref: '#/components/examples/multiple_errors' + 500_error: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + database: + $ref: '#/components/examples/database_error' + unexpected_state: + $ref: '#/components/examples/unexpected_state_error' + invalid_argument: + $ref: '#/components/examples/invalid_argument_error' + default_error: + $ref: '#/components/examples/default_error' + unauthorized: + description: User is not authorized. Must log in first + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + incorrect_credentials: + description: User does not exist or incorrect credentials + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + examples: + not_allowed_error: + summary: Not Allowed Error + value: + message: Discount must be set to dynamic + type: not_allowed + invalid_data_error: + summary: Invalid Data Error + value: + message: first_name must be a string + type: invalid_data + multiple_errors: + summary: Multiple Errors + value: + message: Provided request body contains errors. Please check the data and retry the request + errors: + - message: first_name must be a string + type: invalid_data + - message: Discount must be set to dynamic + type: not_allowed + database_error: + summary: Database Error + value: + code: api_error + message: An error occured while hashing password + type: database_error + unexpected_state_error: + summary: Unexpected State Error + value: + message: cart.total must be defined + type: unexpected_state + invalid_argument_error: + summary: Invalid Argument Error + value: + message: cart.total must be defined + type: unexpected_state + default_error: + summary: Default Error + value: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + securitySchemes: + api_token: + type: http + x-displayName: API Token + description: | + Use a user's API Token to send authenticated requests. + + ### How to Add API Token to a User + + At the moment, there's no direct way of adding an API Token for a user. The only way it can be done is through directly editing the database. + + If you're using a PostgreSQL database, you can run the following commands in your command line to add API token: + + ```bash + psql -d -U + UPDATE public.user SET api_token='' WHERE email=''; + ``` + + Where: + - `` is the name of the database schema you use for the Medusa server. + - `` is the name of the user that has privileges over the database schema. + - `` is the API token you want to associate with the user. You can use [this tool to generate a random token](https://randomkeygen.com/). + - `` is the email address of the admin user you want to have this API token. + + ### How to Use the API Token + + The API token can be used for Bearer Authentication. It's passed in the `Authorization` header as the following: + + ``` + Authorization: Bearer {api_token} + ``` + + In this API reference, you'll find in the cURL request samples the use of `{api_token}`. This is where you must pass the API token. + + If you're following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client: + + ```ts + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, apiKey: '{api_token}' }) + ``` + + If you're using Medusa React, you can pass the `apiKey` prop to `MedusaProvider`: + + ```tsx + + ``` + scheme: bearer + cookie_auth: + type: apiKey + in: cookie + name: connect.sid + x-displayName: Cookie Session ID + description: | + Use a cookie session to send authenticated requests. + + ### How to Obtain the Cookie Session + + If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the admin user is logged in. + + If you're sending requests using cURL, you must set the Session ID in the cookie manually. + + To do that, send a request to [authenticate the user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + + ```bash + curl -v --location --request POST 'https://medusa-url.com/admin/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + ``` + + The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this: + + ```bash + Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; + ``` + + Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following: + + ```bash + curl --location --request GET 'https://medusa-url.com/admin/products' \ + --header 'Cookie: connect.sid={sid}' + ``` + + Where `{sid}` is the value of `connect.sid` that you copied. + schemas: + Address: + title: Address + description: An address. + type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at + properties: + id: + type: string + description: ID of the address + example: addr_01G8ZC9VS1XVE149MGH2J7QSSH + customer_id: + description: ID of the customer this address belongs to + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: Available if the relation `customer` is expanded. + nullable: true + type: object + company: + description: Company name + nullable: true + type: string + example: Acme + first_name: + description: First name + nullable: true + type: string + example: Arno + last_name: + description: Last name + nullable: true + type: string + example: Willms + address_1: + description: Address line 1 + nullable: true + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + nullable: true + type: string + example: Suite 369 + city: + description: City + nullable: true + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + nullable: true + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + country: + description: A country object. Available if the relation `country` is expanded. + nullable: true + $ref: '#/components/schemas/Country' + province: + description: Province + nullable: true + type: string + example: Kentucky + postal_code: + description: Postal Code + nullable: true + type: string + example: 72093 + phone: + description: Phone Number + nullable: true + type: string + example: 16128234334802 + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + AddressCreatePayload: + type: object + description: Address fields used when creating an address. + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code + properties: + first_name: + description: First name + type: string + example: Arno + last_name: + description: Last name + type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: + description: Address line 1 + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + type: string + example: Suite 369 + city: + description: City + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + description: Province + type: string + example: Kentucky + postal_code: + description: Postal Code + type: string + example: 72093 + metadata: + type: object + example: + car: white + description: An optional key-value map with additional details + AddressPayload: + type: object + description: Address fields used when creating/updating an address. + properties: + first_name: + description: First name + type: string + example: Arno + last_name: + description: Last name + type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: + description: Address line 1 + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + type: string + example: Suite 369 + city: + description: City + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + description: Province + type: string + example: Kentucky + postal_code: + description: Postal Code + type: string + example: 72093 + metadata: + type: object + example: + car: white + description: An optional key-value map with additional details + AdminAppsListRes: + type: object + required: + - apps + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + AdminAppsRes: + type: object + required: + - apps + properties: + apps: + $ref: '#/components/schemas/OAuth' + AdminAuthRes: + type: object + required: + - user + properties: + user: + $ref: '#/components/schemas/User' + AdminBatchJobListRes: + type: object + required: + - batch_jobs + - count + - offset + - limit + properties: + batch_jobs: + type: array + items: + $ref: '#/components/schemas/BatchJob' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminBatchJobRes: + type: object + required: + - batch_job + properties: + batch_job: + $ref: '#/components/schemas/BatchJob' + AdminCollectionsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Collection + object: + type: string + description: The type of the object that was deleted. + default: product-collection + deleted: + type: boolean + description: Whether the collection was deleted successfully or not. + default: true + AdminCollectionsListRes: + type: object + required: + - collections + - count + - offset + - limit + properties: + collections: + type: array + items: + $ref: '#/components/schemas/ProductCollection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminCollectionsRes: + type: object + x-expanded-relations: + field: collection + relations: + - products + required: + - collection + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + AdminCreateUserRequest: + type: object + required: + - email + - password + properties: + email: + description: The Users email. + type: string + format: email + first_name: + description: The name of the User. + type: string + last_name: + description: The name of the User. + type: string + role: + description: Userrole assigned to the user. + type: string + enum: + - admin + - member + - developer + password: + description: The Users password. + type: string + format: password + AdminCurrenciesListRes: + type: object + required: + - currencies + - count + - offset + - limit + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/Currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminCurrenciesRes: + type: object + required: + - currency + properties: + currency: + $ref: '#/components/schemas/Currency' + AdminCustomerGroupsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted customer group. + object: + type: string + description: The type of the object that was deleted. + default: customer_group + deleted: + type: boolean + description: Whether the customer group was deleted successfully or not. + default: true + AdminCustomerGroupsListRes: + type: object + required: + - customer_groups + - count + - offset + - limit + properties: + customer_groups: + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminCustomerGroupsRes: + type: object + required: + - customer_group + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + AdminCustomersListRes: + type: object + required: + - customers + - count + - offset + - limit + properties: + customers: + type: array + items: + $ref: '#/components/schemas/Customer' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminCustomersRes: + type: object + x-expanded-relations: + field: customer + relations: + - orders + - shipping_addresses + required: + - customer + properties: + customer: + $ref: '#/components/schemas/Customer' + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + type: object + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + type: object + required: + - id + properties: + id: + description: The id of the item + type: string + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + AdminDeleteProductCategoriesCategoryProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to delete from the Product Category. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string + AdminDeleteProductsFromCollectionReq: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to remove from the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminDeleteProductsFromCollectionRes: + type: object + required: + - id + - object + - removed_products + properties: + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminDeletePublishableApiKeySalesChannelsBatchReq: + type: object + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to delete from the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + AdminDeleteSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to delete from the Sales Channel. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string + AdminDeleteSalesChannelsChannelStockLocationsReq: + type: object + required: + - location_id + properties: + location_id: + description: The ID of the stock location + type: string + AdminDeleteShippingProfileRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminDeleteTaxRatesTaxRateProductTypesReq: + type: object + required: + - product_types + properties: + product_types: + type: array + description: The IDs of the types of products to remove association with this tax rate + items: + type: string + AdminDeleteTaxRatesTaxRateProductsReq: + type: object + required: + - products + properties: + products: + type: array + description: The IDs of the products to remove association with this tax rate + items: + type: string + AdminDeleteTaxRatesTaxRateShippingOptionsReq: + type: object + required: + - shipping_options + properties: + shipping_options: + type: array + description: The IDs of the shipping options to remove association with this tax rate + items: + type: string + AdminDeleteUploadsReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to delete + type: string + AdminDeleteUploadsRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The file key of the upload deleted + object: + type: string + description: The type of the object that was deleted. + default: file + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminDeleteUserRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted user. + object: + type: string + description: The type of the object that was deleted. + default: user + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminDiscountConditionsDeleteRes: + type: object + required: + - id + - object + - deleted + - discount + properties: + id: + type: string + description: The ID of the deleted DiscountCondition + object: + type: string + description: The type of the object that was deleted. + default: discount-condition + deleted: + type: boolean + description: Whether the discount condition was deleted successfully or not. + default: true + discount: + description: The Discount to which the condition used to belong + $ref: '#/components/schemas/Discount' + AdminDiscountConditionsRes: + type: object + x-expanded-relations: + field: discount_condition + relations: + - discount_rule + required: + - discount_condition + properties: + discount_condition: + $ref: '#/components/schemas/DiscountCondition' + AdminDiscountsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Discount + object: + type: string + description: The type of the object that was deleted. + default: discount + deleted: + type: boolean + description: Whether the discount was deleted successfully or not. + default: true + AdminDiscountsListRes: + type: object + x-expanded-relations: + field: discounts + relations: + - parent_discount + - regions + - rule + - rule.conditions + required: + - discounts + - count + - offset + - limit + properties: + discounts: + type: array + items: + $ref: '#/components/schemas/Discount' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminDiscountsRes: + type: object + x-expanded-relations: + field: discount + relations: + - parent_discount + - regions + - rule + - rule.conditions + eager: + - regions.fulfillment_providers + - regions.payment_providers + required: + - discount + properties: + discount: + $ref: '#/components/schemas/Discount' + AdminDraftOrdersDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Draft Order. + object: + type: string + description: The type of the object that was deleted. + default: draft-order + deleted: + type: boolean + description: Whether the draft order was deleted successfully or not. + default: true + AdminDraftOrdersListRes: + type: object + x-expanded-relations: + field: draft_orders + relations: + - order + - cart + - cart.items + - cart.items.adjustments + required: + - draft_orders + - count + - offset + - limit + properties: + draft_orders: + type: array + items: + $ref: '#/components/schemas/DraftOrder' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminDraftOrdersRes: + type: object + x-expanded-relations: + field: draft_order + relations: + - order + - cart + - cart.items + - cart.items.adjustments + - cart.billing_address + - cart.customer + - cart.discounts + - cart.discounts.rule + - cart.items + - cart.items.adjustments + - cart.payment + - cart.payment_sessions + - cart.region + - cart.region.payment_providers + - cart.shipping_address + - cart.shipping_methods + - cart.shipping_methods.shipping_option + eager: + - cart.region.fulfillment_providers + - cart.region.payment_providers + - cart.shipping_methods.shipping_option + implicit: + - cart.discounts + - cart.discounts.rule + - cart.gift_cards + - cart.items + - cart.items.adjustments + - cart.items.tax_lines + - cart.items.variant + - cart.items.variant.product + - cart.region + - cart.region.tax_rates + - cart.shipping_address + - cart.shipping_methods + - cart.shipping_methods.tax_lines + totals: + - cart.discount_total + - cart.gift_card_tax_total + - cart.gift_card_total + - cart.item_tax_total + - cart.refundable_amount + - cart.refunded_total + - cart.shipping_tax_total + - cart.shipping_total + - cart.subtotal + - cart.tax_total + - cart.total + - cart.items.discount_total + - cart.items.gift_card_total + - cart.items.original_tax_total + - cart.items.original_total + - cart.items.refundable + - cart.items.subtotal + - cart.items.tax_total + - cart.items.total + required: + - draft_order + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + AdminExtendedStoresRes: + type: object + x-expanded-relations: + field: store + relations: + - currencies + - default_currency + required: + - store + properties: + store: + $ref: '#/components/schemas/ExtendedStoreDTO' + AdminGetRegionsRegionFulfillmentOptionsRes: + type: object + required: + - fulfillment_options + properties: + fulfillment_options: + type: array + items: + type: object + required: + - provider_id + - options + properties: + provider_id: + description: ID of the fulfillment provider + type: string + options: + description: fulfillment provider options + type: array + items: + type: object + example: + - id: manual-fulfillment + - id: manual-fulfillment-return + is_return: true + AdminGetVariantsVariantInventoryRes: + type: object + properties: + variant: + type: object + $ref: '#/components/schemas/VariantInventory' + AdminGiftCardsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Gift Card + object: + type: string + description: The type of the object that was deleted. + default: gift-card + deleted: + type: boolean + description: Whether the gift card was deleted successfully or not. + default: true + AdminGiftCardsListRes: + type: object + x-expanded-relations: + field: gift_cards + relations: + - order + - region + eager: + - region.fulfillment_providers + - region.payment_providers + required: + - gift_cards + - count + - offset + - limit + properties: + gift_cards: + type: array + items: + $ref: '#/components/schemas/GiftCard' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminGiftCardsRes: + type: object + x-expanded-relations: + field: gift_card + relations: + - order + - region + eager: + - region.fulfillment_providers + - region.payment_providers + required: + - gift_card + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + AdminInventoryItemsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Inventory Item. + object: + type: string + description: The type of the object that was deleted. + format: inventory_item + deleted: + type: boolean + description: Whether or not the Inventory Item was deleted. + default: true + AdminInventoryItemsListRes: + type: object + required: + - inventory_items + - count + - offset + - limit + properties: + inventory_items: + type: array + items: + $ref: '#/components/schemas/InventoryItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsListWithVariantsAndLocationLevelsRes: + type: object + required: + - inventory_items + - count + - offset + - limit + properties: + inventory_items: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryItemDTO' + - type: object + properties: + location_levels: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryLevelDTO' + variants: + type: array + items: + allOf: + - $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsLocationLevelsRes: + type: object + required: + - inventory_item + properties: + inventory_item: + type: object + required: + - id + - location_levels + properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: '#/components/schemas/InventoryLevelDTO' + AdminInventoryItemsRes: + type: object + required: + - inventory_item + properties: + inventory_item: + $ref: '#/components/schemas/InventoryItemDTO' + AdminInviteDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Invite. + object: + type: string + description: The type of the object that was deleted. + default: invite + deleted: + type: boolean + description: Whether or not the Invite was deleted. + default: true + AdminListInvitesRes: + type: object + required: + - invites + properties: + invites: + type: array + items: + $ref: '#/components/schemas/Invite' + AdminNotesDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Note. + object: + type: string + description: The type of the object that was deleted. + default: note + deleted: + type: boolean + description: Whether or not the Note was deleted. + default: true + AdminNotesListRes: + type: object + required: + - notes + - count + - offset + - limit + properties: + notes: + type: array + items: + $ref: '#/components/schemas/Note' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminNotesRes: + type: object + required: + - note + properties: + note: + $ref: '#/components/schemas/Note' + AdminNotificationsListRes: + type: object + x-expanded-relations: + field: notifications + relations: + - resends + required: + - notifications + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/Notification' + AdminNotificationsRes: + type: object + x-expanded-relations: + field: notification + relations: + - resends + required: + - notification + properties: + notification: + $ref: '#/components/schemas/Notification' + AdminOrderEditDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Order Edit. + object: + type: string + description: The type of the object that was deleted. + default: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true + AdminOrderEditItemChangeDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Order Edit Item Change. + object: + type: string + description: The type of the object that was deleted. + default: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true + AdminOrderEditsListRes: + type: object + x-expanded-relations: + field: order_edits + relations: + - changes + - changes.line_item + - changes.line_item.variant + - changes.original_line_item + - changes.original_line_item.variant + - items + - items.adjustments + - items.tax_lines + - items.variant + - payment_collection + implicit: + - items + - items.tax_lines + - items.adjustments + - items.variant + totals: + - difference_due + - discount_total + - gift_card_tax_total + - gift_card_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + required: + - order_edits + - count + - offset + - limit + properties: + order_edits: + type: array + items: + $ref: '#/components/schemas/OrderEdit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminOrderEditsRes: + type: object + x-expanded-relations: + field: order_edit + relations: + - changes + - changes.line_item + - changes.line_item.variant + - changes.original_line_item + - changes.original_line_item.variant + - items + - items.adjustments + - items.tax_lines + - items.variant + - payment_collection + implicit: + - items + - items.tax_lines + - items.adjustments + - items.variant + totals: + - difference_due + - discount_total + - gift_card_tax_total + - gift_card_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + required: + - order_edit + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + AdminOrdersListRes: + type: object + x-expanded-relations: + field: orders + relations: + - billing_address + - claims + - claims.additional_items + - claims.additional_items.variant + - claims.claim_items + - claims.claim_items.images + - claims.claim_items.item + - claims.fulfillments + - claims.fulfillments.tracking_links + - claims.return_order + - claims.return_order.shipping_method + - claims.return_order.shipping_method.tax_lines + - claims.shipping_address + - claims.shipping_methods + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.items + - fulfillments.tracking_links + - gift_card_transactions + - gift_cards + - items + - payments + - refunds + - region + - returns + - returns.items + - returns.items.reason + - returns.shipping_method + - returns.shipping_method.tax_lines + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - region.fulfillment_providers + - region.payment_providers + - returns.items + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total + required: + - orders + - count + - offset + - limit + properties: + orders: + type: array + items: + $ref: '#/components/schemas/Order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminOrdersOrderLineItemReservationReq: + type: object + required: + - location_id + properties: + location_id: + description: The id of the location of the reservation + type: string + quantity: + description: The quantity to reserve + type: number + AdminOrdersRes: + type: object + x-expanded-relations: + field: order + relations: + - billing_address + - claims + - claims.additional_items + - claims.additional_items.variant + - claims.claim_items + - claims.claim_items.images + - claims.claim_items.item + - claims.fulfillments + - claims.fulfillments.tracking_links + - claims.return_order + - claims.return_order.shipping_method + - claims.return_order.shipping_method.tax_lines + - claims.shipping_address + - claims.shipping_methods + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.items + - fulfillments.tracking_links + - gift_card_transactions + - gift_cards + - items + - payments + - refunds + - region + - returns + - returns.items + - returns.items.reason + - returns.shipping_method + - returns.shipping_method.tax_lines + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - region.fulfillment_providers + - region.payment_providers + - returns.items + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total + required: + - order + properties: + order: + $ref: '#/components/schemas/Order' + AdminPaymentCollectionDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + default: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + AdminPaymentCollectionsRes: + type: object + x-expanded-relations: + field: payment_collection + relations: + - payment_sessions + - payments + - region + eager: + - region.fulfillment_providers + - region.payment_providers + required: + - payment_collection + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + AdminPaymentProvidersList: + type: object + required: + - payment_providers + properties: + payment_providers: + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + AdminPaymentRes: + type: object + required: + - payment + properties: + payment: + $ref: '#/components/schemas/Payment' + AdminPostAppsReq: + type: object + required: + - application_name + - state + - code + properties: + application_name: + type: string + description: Name of the application for the token to be generated for. + state: + type: string + description: State of the application. + code: + type: string + description: The code for the generated token. + AdminPostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The User's email. + format: email + password: + type: string + description: The User's password. + format: password + AdminPostBatchesReq: + type: object + required: + - type + - context + properties: + type: + type: string + description: The type of batch job to start. + example: product-export + context: + type: object + description: Additional infomration regarding the batch to be used for processing. + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + type: boolean + description: Set a batch job in dry_run mode to get some information on what will be done without applying any modifications. + default: false + AdminPostCollectionsCollectionReq: + type: object + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCollectionsReq: + type: object + required: + - title + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + type: object + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + AdminPostCustomerGroupsReq: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. + AdminPostCustomersCustomerReq: + type: object + properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostDiscountsDiscountConditions: + type: object + required: + - operator + properties: + operator: + description: Operator of the condition + type: string + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: list of product type IDs if the condition is applied on product types. + items: + type: string + product_collections: + type: array + description: list of product collection IDs if the condition is applied on product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: list of customer group IDs if the condition is applied on customer groups. + items: + type: string + AdminPostDiscountsDiscountConditionsCondition: + type: object + properties: + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: list of product type IDs if the condition is applied on product types. + items: + type: string + product_collections: + type: array + description: list of product collection IDs if the condition is applied on product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: list of customer group IDs if the condition is applied on customer groups. + items: + type: string + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + type: object + required: + - id + properties: + id: + description: The id of the item + type: string + AdminPostDiscountsDiscountDynamicCodesReq: + type: object + required: + - code + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + usage_limit: + type: number + description: Maximum times the discount can be used + default: 1 + metadata: + type: object + description: An optional set of key-value pairs to hold additional information. + AdminPostDiscountsDiscountReq: + type: object + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - id + properties: + id: + type: string + description: The ID of the Rule + description: + type: string + description: A short description of the discount + value: + type: number + description: The value that the discount represents; this will depend on the type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + items: + type: object + required: + - operator + properties: + id: + type: string + description: The ID of the Rule + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: list of product type IDs if the condition is applied on product types. + items: + type: string + product_collections: + type: array + description: list of product collection IDs if the condition is applied on product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: list of customer group IDs if the condition is applied on customer groups. + items: + type: string + is_disabled: + type: boolean + description: Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + usage_limit: + type: number + description: Maximum times the discount can be used + regions: + description: A list of Region ids representing the Regions in which the Discount can be used. + type: array + items: + type: string + metadata: + description: An object containing metadata of the discount + type: object + AdminPostDiscountsReq: + type: object + required: + - code + - rule + - regions + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: boolean + description: Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules. + default: false + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - type + - value + - allocation + properties: + description: + type: string + description: A short description of the discount + type: + type: string + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + enum: + - fixed + - percentage + - free_shipping + value: + type: number + description: The value that the discount represents; this will depend on the type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + items: + type: object + required: + - operator + properties: + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: list of product type IDs if the condition is applied on product types. + items: + type: string + product_collections: + type: array + description: list of product collection IDs if the condition is applied on product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: list of customer group IDs if the condition is applied on customer groups. + items: + type: string + is_disabled: + type: boolean + description: Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. + default: false + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + regions: + description: A list of Region ids representing the Regions in which the Discount can be used. + type: array + items: + type: string + usage_limit: + type: number + description: Maximum times the discount can be used + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostDraftOrdersDraftOrderLineItemsItemReq: + type: object + properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: The optional key-value map with additional details about the Line Item. + type: object + AdminPostDraftOrdersDraftOrderLineItemsReq: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + default: Custom item + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: The optional key-value map with additional details about the Line Item. + type: object + AdminPostDraftOrdersDraftOrderRegisterPaymentRes: + type: object + required: + - order + properties: + order: + $ref: '#/components/schemas/Order' + AdminPostDraftOrdersDraftOrderReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Draft Order in. + country_code: + type: string + description: The 2 character ISO code for the Country. + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Draft Order. + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + - type: string + discounts: + description: An array of Discount codes to add to the Draft Order. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: + description: An optional flag passed to the resulting order to determine use of notifications. + type: boolean + customer_id: + description: The ID of the Customer to associate the Draft Order with. + type: string + AdminPostDraftOrdersReq: + type: object + required: + - email + - region_id + - shipping_methods + properties: + status: + description: The status of the draft order + type: string + enum: + - open + - completed + email: + description: The email of the customer of the draft order + type: string + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + - type: string + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: The optional key-value map with additional details about the Line Item. + type: object + region_id: + description: The ID of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order + type: array + items: + type: object + required: + - code + properties: + code: + description: The code of the discount to apply + type: string + customer_id: + description: The ID of the customer to add on the draft order + type: string + no_notification_order: + description: An optional flag passed to the resulting order to determine use of notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + type: object + required: + - option_id + properties: + option_id: + description: The ID of the shipping option in use + type: string + data: + description: The optional additional data needed for the shipping method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: The optional key-value map with additional details about the Draft Order. + type: object + AdminPostGiftCardsGiftCardReq: + type: object + properties: + balance: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostGiftCardsReq: + type: object + required: + - region_id + properties: + value: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostInventoryItemsInventoryItemReq: + type: object + properties: + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + AdminPostInventoryItemsItemLocationLevelsLevelReq: + type: object + properties: + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + AdminPostInventoryItemsItemLocationLevelsReq: + type: object + required: + - location_id + - stocked_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + AdminPostInventoryItemsReq: + type: object + properties: + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + default: true + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostInvitesInviteAcceptReq: + type: object + required: + - token + - user + properties: + token: + description: The invite token provided by the admin. + type: string + user: + description: The User to create. + type: object + required: + - first_name + - last_name + - password + properties: + first_name: + type: string + description: the first name of the User + last_name: + type: string + description: the last name of the User + password: + description: The desired password for the User + type: string + format: password + AdminPostInvitesReq: + type: object + required: + - user + - role + properties: + user: + description: The email for the user to be created. + type: string + format: email + role: + description: The role of the user to be created. + type: string + enum: + - admin + - member + - developer + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminPostNotesReq: + type: object + required: + - resource_id + - resource_type + - value + properties: + resource_id: + type: string + description: The ID of the resource which the Note relates to. + resource_type: + type: string + description: The type of resource which the Note relates to. + value: + type: string + description: The content of the Note to create. + AdminPostNotificationsNotificationResendReq: + type: object + properties: + to: + description: A new address or user identifier that the Notification should be sent to + type: string + AdminPostOrderEditsEditLineItemsLineItemReq: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number + AdminPostOrderEditsEditLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrderEditsOrderEditReq: + type: object + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string + AdminPostOrderEditsReq: + type: object + required: + - order_id + properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string + AdminPostOrdersOrderClaimsClaimFulfillmentsReq: + type: object + properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + type: object + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + type: object + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderClaimsClaimShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + AdminPostOrdersOrderClaimsReq: + type: object + required: + - type + - claim_items + properties: + type: + description: 'The type of the Claim. This will determine how the Claim is treated: `replace` Claims will result in a Fulfillment with new items being created, while a `refund` Claim will refund the amount paid for the claimed items.' + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: Optional details for the Return Shipping Method, if the items are to be sent back. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer when the Claim type is Replace. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + type: object + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object + shipping_address: + description: An optional shipping address to send the claim to. Defaults to the parent order's shipping address + $ref: '#/components/schemas/AddressPayload' + refund_amount: + description: The amount to refund the Customer when the Claim type is `refund`. + type: integer + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderFulfillmentsReq: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + no_notification: + description: If set to true no notification will be send related to this Refund. + type: boolean + AdminPostOrdersOrderReq: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + $ref: '#/components/schemas/AddressPayload' + shipping_address: + description: Shipping address + $ref: '#/components/schemas/AddressPayload' + items: + description: The Line Items for the order + type: array + items: + $ref: '#/components/schemas/LineItem' + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: '#/components/schemas/Discount' + customer_id: + description: ID of the customer + type: string + payment_method: + description: payment method chosen for the order + type: object + properties: + provider_id: + type: string + description: ID of the payment provider + data: + description: Data relevant for the given payment method + type: object + shipping_method: + description: The Shipping Method used for shipping the order. + type: object + properties: + provider_id: + type: string + description: The ID of the shipping provider. + profile_id: + type: string + description: The ID of the shipping profile. + price: + type: integer + description: The price of the shipping. + data: + type: object + description: Data relevant to the specific shipping method. + items: + type: array + items: + $ref: '#/components/schemas/LineItem' + description: Items to ship + no_notification: + description: A flag to indicate if no notifications should be emitted related to the updated order. + type: boolean + AdminPostOrdersOrderReturnsReq: + type: object + required: + - items + properties: + items: + description: The Line Items that will be returned. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: A flag to indicate if the Return should be registerd as received immediately. + type: boolean + default: false + no_notification: + description: A flag to indicate if no notifications should be emitted related to the requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer + AdminPostOrdersOrderShipmentReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: If set to true no notification will be send related to this Shipment. + type: boolean + AdminPostOrdersOrderShippingMethodsReq: + type: object + required: + - price + - option_id + properties: + price: + type: number + description: The price (excluding VAT) that should be charged for the Shipping Method + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + date: + type: object + description: The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. + AdminPostOrdersOrderSwapsReq: + type: object + required: + - return_items + properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: The custom shipping options to potentially create a Shipping Method from. + type: array + items: + type: object + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: true + AdminPostOrdersOrderSwapsSwapFulfillmentsReq: + type: object + properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + AdminPostOrdersOrderSwapsSwapShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: If set to true no notification will be sent related to this Claim. + type: boolean + AdminPostPaymentRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + AdminPostPriceListPricesPricesReq: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: If true the prices will replace all existing prices associated with the Price List. + type: boolean + AdminPostPriceListsPriceListPriceListReq: + type: object + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostPriceListsPriceListReq: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + region_id: + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostProductCategoriesCategoryProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Product Category + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostProductCategoriesCategoryReq: + type: object + properties: + name: + type: string + description: The name to identify the Product Category by. + handle: + type: string + description: A handle to be used in slugs. + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + parent_category_id: + type: string + description: The ID of the parent product category + rank: + type: number + description: The rank of the category in the tree node (starting from 0) + AdminPostProductCategoriesReq: + type: object + required: + - name + properties: + name: + type: string + description: The name to identify the Product Category by. + handle: + type: string + description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + parent_category_id: + type: string + description: The ID of the parent product category + AdminPostProductsProductMetadataReq: + type: object + required: + - key + - value + properties: + key: + description: The metadata key + type: string + value: + description: The metadata value + type: string + AdminPostProductsProductOptionsOption: + type: object + required: + - title + properties: + title: + description: The title of the Product Option + type: string + AdminPostProductsProductOptionsReq: + type: object + required: + - title + properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + type: string + AdminPostProductsProductReq: + type: object + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + discountable: + description: A flag to indicate if discounts can be applied to the LineItems generated from this Product + type: boolean + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + type: object + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + type: object + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: The value to give for the Product Option at the same index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsReq: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + default: true + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminPostProductsProductVariantsVariantReq: + type: object + required: + - prices + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminPostProductsReq: + type: object + required: + - title + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + is_giftcard: + description: A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created. + type: boolean + default: false + discountable: + description: A flag to indicate if discounts can be applied to the LineItems generated from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + type: object + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + options: + description: The Options that the Product should have. These define on which properties the Product's Product Variants will differ. + type: array + items: + type: object + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + type: object + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - value + properties: + value: + description: The value to give for the Product Option at the same index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsToCollectionReq: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminPostPublishableApiKeySalesChannelsBatchReq: + type: object + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to add to the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + AdminPostPublishableApiKeysPublishableApiKeyReq: + type: object + properties: + title: + description: A title to update for the key. + type: string + AdminPostPublishableApiKeysReq: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + AdminPostRegionsRegionCountriesReq: + type: object + required: + - country_code + properties: + country_code: + description: The 2 character ISO code for the Country. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + AdminPostRegionsRegionFulfillmentProvidersReq: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Fulfillment Provider to add. + type: string + AdminPostRegionsRegionPaymentProvidersReq: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Payment Provider to add. + type: string + AdminPostRegionsRegionReq: + type: object + properties: + name: + description: The name of the Region + type: string + currency_code: + description: The 3 character ISO currency code to use for the Region. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + automatic_taxes: + description: If true Medusa will automatically calculate taxes for carts in this region. If false you have to manually call POST /carts/:id/taxes. + type: boolean + gift_cards_taxable: + description: Whether gift cards in this region should be applied sales tax when purchasing a gift card + type: boolean + tax_provider_id: + description: The ID of the tax provider to use; if null the system tax provider is used + type: string + tax_code: + description: An optional tax code the Region. + type: string + tax_rate: + description: The tax rate to use on Orders in the Region. + type: number + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + payment_providers: + description: A list of Payment Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: A list of Fulfillment Provider IDs that should be enabled for the Region + type: array + items: + type: string + countries: + description: A list of countries' 2 ISO Characters that should be included in the Region. + type: array + items: + type: string + AdminPostRegionsReq: + type: object + required: + - name + - currency_code + - tax_rate + - payment_providers + - fulfillment_providers + - countries + properties: + name: + description: The name of the Region + type: string + currency_code: + description: The 3 character ISO currency code to use for the Region. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + tax_code: + description: An optional tax code the Region. + type: string + tax_rate: + description: The tax rate to use on Orders in the Region. + type: number + payment_providers: + description: A list of Payment Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: A list of Fulfillment Provider IDs that should be enabled for the Region + type: array + items: + type: string + countries: + description: A list of countries' 2 ISO Characters that should be included in the Region. + example: + - US + type: array + items: + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + AdminPostReservationsReq: + type: object + required: + - location_id + - inventory_item_id + - quantity + properties: + line_item_id: + description: The id of the location of the reservation + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReservationsReservationReq: + type: object + properties: + location_id: + description: The id of the location of the reservation + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnReasonsReasonReq: + type: object + properties: + label: + description: The label to display to the Customer. + type: string + value: + description: The value that the Return Reason will be identified by. Must be unique. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnReasonsReq: + type: object + required: + - label + - value + properties: + label: + description: The label to display to the Customer. + type: string + value: + description: The value that the Return Reason will be identified by. Must be unique. + type: string + parent_return_reason_id: + description: The ID of the parent return reason. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + AdminPostSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Sales Channel + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostSalesChannelsChannelStockLocationsReq: + type: object + required: + - location_id + properties: + location_id: + description: The ID of the stock location + type: string + AdminPostSalesChannelsReq: + type: object + required: + - name + properties: + name: + description: The name of the Sales Channel + type: string + description: + description: The description of the Sales Channel + type: string + is_disabled: + description: Whether the Sales Channel is disabled or not. + type: boolean + AdminPostSalesChannelsSalesChannelReq: + type: object + properties: + name: + type: string + description: Name of the sales channel. + description: + type: string + description: Sales Channel description. + is_disabled: + type: boolean + description: Indication of if the sales channel is active. + AdminPostShippingOptionsOptionReq: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: If true, the option can be used for draft orders + type: boolean + metadata: + description: An optional set of key-value pairs with additional information. + type: object + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available. + type: array + items: + type: object + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingOptionsReq: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: The data needed for the Fulfillment Provider to handle shipping with this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available. + type: array + items: + type: object + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: If true, the option can be used for draft orders + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + products: + description: An optional array of product ids to associate with the Shipping Profile + type: array + shipping_options: + description: An optional array of shipping option ids to associate with the Shipping Profile + type: array + AdminPostShippingProfilesReq: + type: object + required: + - name + - type + properties: + name: + description: The name of the Shipping Profile + type: string + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + AdminPostStockLocationsLocationReq: + type: object + properties: + name: + description: the name of the stock location + type: string + address_id: + description: the stock location address ID + type: string + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + address: + $ref: '#/components/schemas/StockLocationAddressInput' + AdminPostStockLocationsReq: + type: object + required: + - name + properties: + name: + description: the name of the stock location + type: string + address_id: + description: the stock location address ID + type: string + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + address: + $ref: '#/components/schemas/StockLocationAddressInput' + AdminPostStoreReq: + type: object + properties: + name: + description: The name of the Store + type: string + swap_link_template: + description: A template for Swap links - use `{{cart_id}}` to insert the Swap Cart id + type: string + payment_link_template: + description: A template for payment links links - use `{{cart_id}}` to insert the Cart id + type: string + invite_link_template: + description: A template for invite links - use `{{invite_token}}` to insert the invite token + type: string + default_currency_code: + description: The default currency code for the Store. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currencies: + description: Array of currencies in 2 character ISO code format. + type: array + items: + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostTaxRatesReq: + type: object + required: + - code + - name + - region_id + properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateProductTypesReq: + type: object + required: + - product_types + properties: + product_types: + type: array + description: The IDs of the types of products to associate with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateProductsReq: + type: object + required: + - products + properties: + products: + type: array + description: The IDs of the products to associate with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateReq: + type: object + properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateShippingOptionsReq: + type: object + required: + - shipping_options + properties: + shipping_options: + type: array + description: The IDs of the shipping options to associate with this tax rate + items: + type: string + AdminPostUploadsDownloadUrlReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to obtain the download link for + type: string + AdminPriceListDeleteBatchRes: + type: object + required: + - ids + - object + - deleted + properties: + ids: + type: array + items: + type: string + description: The IDs of the deleted Money Amounts (Prices). + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteProductPricesRes: + type: object + required: + - ids + - object + - deleted + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + default: price-list + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteVariantPricesRes: + type: object + required: + - ids + - object + - deleted + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListRes: + type: object + x-expanded-relations: + field: price_list + relations: + - customer_groups + - prices + required: + - price_list + properties: + price_list: + $ref: '#/components/schemas/PriceList' + AdminPriceListsListRes: + type: object + required: + - price_lists + - count + - offset + - limit + properties: + price_lists: + type: array + items: + $ref: '#/components/schemas/PriceList' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPriceListsProductsListRes: + type: object + x-expanded-relations: + field: products + relations: + - categories + - collection + - images + - options + - tags + - type + - variants + - variants.options + required: + - products + - count + - offset + - limit + properties: + products: + type: array + items: + $ref: '#/components/schemas/Product' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductCategoriesCategoryDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted product category + object: + type: string + description: The type of the object that was deleted. + default: product-category + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminProductCategoriesCategoryRes: + type: object + x-expanded-relations: + field: product_category + relations: + - category_children + - parent_category + required: + - product_category + properties: + product_category: + $ref: '#/components/schemas/ProductCategory' + AdminProductCategoriesListRes: + type: object + x-expanded-relations: + field: product_categories + relations: + - category_children + - parent_category + required: + - product_categories + - count + - offset + - limit + properties: + product_categories: + type: array + items: + $ref: '#/components/schemas/ProductCategory' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductTagsListRes: + type: object + required: + - product_tags + - count + - offset + - limit + properties: + product_tags: + type: array + items: + $ref: '#/components/schemas/ProductTag' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductTypesListRes: + type: object + required: + - product_types + - count + - offset + - limit + properties: + product_types: + type: array + items: + $ref: '#/components/schemas/ProductType' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsDeleteOptionRes: + type: object + x-expanded-relations: + field: product + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices + required: + - option_id + - object + - deleted + - product + properties: + option_id: + type: string + description: The ID of the deleted Product Option + object: + type: string + description: The type of the object that was deleted. + default: option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/PricedProduct' + AdminProductsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Product. + object: + type: string + description: The type of the object that was deleted. + default: product + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminProductsDeleteVariantRes: + type: object + x-expanded-relations: + field: product + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices + required: + - variant_id + - object + - deleted + - product + properties: + variant_id: + type: string + description: The ID of the deleted Product Variant. + object: + type: string + description: The type of the object that was deleted. + default: product-variant + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/PricedProduct' + AdminProductsListRes: + type: object + x-expanded-relations: + field: products + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices + required: + - products + - count + - offset + - limit + properties: + products: + type: array + items: + $ref: '#/components/schemas/PricedProduct' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsListTagsRes: + type: object + required: + - tags + properties: + tags: + type: array + items: + type: object + required: + - id + - usage_count + - value + properties: + id: + description: The ID of the tag. + type: string + usage_count: + description: The number of products that use this tag. + type: string + value: + description: The value of the tag. + type: string + AdminProductsListTypesRes: + type: object + required: + - types + properties: + types: + type: array + items: + $ref: '#/components/schemas/ProductType' + AdminProductsListVariantsRes: + type: object + required: + - variants + - count + - offset + - limit + properties: + variants: + type: array + items: + $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsRes: + type: object + x-expanded-relations: + field: product + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices + required: + - product + properties: + product: + $ref: '#/components/schemas/PricedProduct' + AdminPublishableApiKeyDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + default: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + AdminPublishableApiKeysListRes: + type: object + required: + - publishable_api_keys + - count + - offset + - limit + properties: + publishable_api_keys: + type: array + items: + $ref: '#/components/schemas/PublishableApiKey' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPublishableApiKeysListSalesChannelsRes: + type: object + required: + - sales_channels + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/SalesChannel' + AdminPublishableApiKeysRes: + type: object + required: + - publishable_api_key + properties: + publishable_api_key: + $ref: '#/components/schemas/PublishableApiKey' + AdminRefundRes: + type: object + required: + - refund + properties: + refund: + $ref: '#/components/schemas/Refund' + AdminRegionsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Region. + object: + type: string + description: The type of the object that was deleted. + default: region + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminRegionsListRes: + type: object + x-expanded-relations: + field: regions + relations: + - countries + - fulfillment_providers + - payment_providers + eager: + - fulfillment_providers + - payment_providers + required: + - regions + - count + - offset + - limit + properties: + regions: + type: array + items: + $ref: '#/components/schemas/Region' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminRegionsRes: + type: object + x-expanded-relations: + field: region + relations: + - countries + - fulfillment_providers + - payment_providers + eager: + - fulfillment_providers + - payment_providers + required: + - region + properties: + region: + $ref: '#/components/schemas/Region' + AdminReservationsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Reservation. + object: + type: string + description: The type of the object that was deleted. + default: reservation + deleted: + type: boolean + description: Whether or not the Reservation was deleted. + default: true + AdminReservationsListRes: + type: object + required: + - reservations + - count + - offset + - limit + properties: + reservations: + type: array + items: + $ref: '#/components/schemas/ReservationItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminReservationsRes: + type: object + required: + - reservation + properties: + reservation: + $ref: '#/components/schemas/ReservationItemDTO' + AdminResetPasswordRequest: + type: object + required: + - token + - password + properties: + email: + description: The Users email. + type: string + format: email + token: + description: The token generated from the 'password-token' endpoint. + type: string + password: + description: The Users new password. + type: string + format: password + AdminResetPasswordTokenRequest: + type: object + required: + - email + properties: + email: + description: The Users email. + type: string + format: email + AdminReturnReasonsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted return reason + object: + type: string + description: The type of the object that was deleted. + default: return_reason + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminReturnReasonsListRes: + type: object + x-expanded-relations: + field: return_reasons + relations: + - parent_return_reason + - return_reason_children + required: + - return_reasons + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/ReturnReason' + AdminReturnReasonsRes: + type: object + x-expanded-relations: + field: return_reason + relations: + - parent_return_reason + - return_reason_children + required: + - return_reason + properties: + return_reason: + $ref: '#/components/schemas/ReturnReason' + AdminReturnsCancelRes: + type: object + x-expanded-relations: + field: order + relations: + - billing_address + - claims + - claims.additional_items + - claims.additional_items.variant + - claims.claim_items + - claims.claim_items.images + - claims.claim_items.item + - claims.fulfillments + - claims.fulfillments.tracking_links + - claims.return_order + - claims.return_order.shipping_method + - claims.return_order.shipping_method.tax_lines + - claims.shipping_address + - claims.shipping_methods + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.items + - fulfillments.tracking_links + - gift_card_transactions + - gift_cards + - items + - payments + - refunds + - region + - returns + - returns.items + - returns.items.reason + - returns.shipping_method + - returns.shipping_method.tax_lines + - shipping_address + - shipping_methods + - swaps + - swaps.additional_items + - swaps.additional_items.variant + - swaps.fulfillments + - swaps.fulfillments.tracking_links + - swaps.payment + - swaps.return_order + - swaps.return_order.shipping_method + - swaps.return_order.shipping_method.tax_lines + - swaps.shipping_address + - swaps.shipping_methods + - swaps.shipping_methods.tax_lines + required: + - order + properties: + order: + $ref: '#/components/schemas/Order' + AdminReturnsListRes: + type: object + x-expanded-relation: + field: returns + relations: + - order + - swap + required: + - returns + - count + - offset + - limit + properties: + returns: + type: array + items: + $ref: '#/components/schemas/Return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminReturnsRes: + type: object + x-expanded-relation: + field: return + relations: + - swap + required: + - return + properties: + return: + $ref: '#/components/schemas/Return' + AdminSalesChannelsDeleteLocationRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the removed stock location from a sales channel + object: + type: string + description: The type of the object that was removed. + default: stock-location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminSalesChannelsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted sales channel + object: + type: string + description: The type of the object that was deleted. + default: sales-channel + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminSalesChannelsListRes: + type: object + required: + - sales_channels + - count + - offset + - limit + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/SalesChannel' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminSalesChannelsRes: + type: object + required: + - sales_channel + properties: + sales_channel: + $ref: '#/components/schemas/SalesChannel' + AdminShippingOptionsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Shipping Option. + object: + type: string + description: The type of the object that was deleted. + default: shipping-option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminShippingOptionsListRes: + type: object + x-expanded-relations: + field: shipping_options + relations: + - profile + - region + - requirements + eager: + - region.fulfillment_providers + - region.payment_providers + required: + - shipping_options + - count + - offset + - limit + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/ShippingOption' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminShippingOptionsRes: + type: object + x-expanded-relations: + field: shipping_option + relations: + - profile + - region + - requirements + eager: + - region.fulfillment_providers + - region.payment_providers + required: + - shipping_option + properties: + shipping_option: + $ref: '#/components/schemas/ShippingOption' + AdminShippingProfilesListRes: + type: object + required: + - shipping_profiles + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/ShippingProfile' + AdminShippingProfilesRes: + type: object + x-expanded-relations: + field: shipping_profile + relations: + - products + - shipping_options + required: + - shipping_profile + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + AdminStockLocationsDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + default: stock_location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminStockLocationsListRes: + type: object + required: + - stock_locations + - count + - offset + - limit + properties: + stock_locations: + type: array + items: + $ref: '#/components/schemas/StockLocationExpandedDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminStockLocationsRes: + type: object + required: + - stock_location + properties: + stock_location: + $ref: '#/components/schemas/StockLocationExpandedDTO' + AdminStoresRes: + type: object + required: + - store + properties: + store: + $ref: '#/components/schemas/Store' + AdminSwapsListRes: + type: object + required: + - swaps + - count + - offset + - limit + properties: + swaps: + type: array + items: + $ref: '#/components/schemas/Swap' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminSwapsRes: + type: object + x-expanded-relations: + field: swap + relations: + - additional_items + - additional_items.adjustments + - cart + - cart.items + - cart.items.adjustments + - cart.items.variant + - fulfillments + - order + - payment + - return_order + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - shipping_methods.shipping_option + required: + - swap + properties: + swap: + $ref: '#/components/schemas/Swap' + AdminTaxProvidersList: + type: object + required: + - tax_providers + properties: + tax_providers: + type: array + items: + $ref: '#/components/schemas/TaxProvider' + AdminTaxRatesDeleteRes: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the deleted Shipping Option. + object: + type: string + description: The type of the object that was deleted. + default: tax-rate + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminTaxRatesListRes: + type: object + required: + - tax_rates + - count + - offset + - limit + properties: + tax_rates: + type: array + items: + $ref: '#/components/schemas/TaxRate' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminTaxRatesRes: + type: object + required: + - tax_rate + properties: + tax_rate: + $ref: '#/components/schemas/TaxRate' + AdminUpdatePaymentCollectionsReq: + type: object + properties: + description: + description: An optional description to create or update the payment collection. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminUpdateUserRequest: + type: object + properties: + first_name: + description: The name of the User. + type: string + last_name: + description: The name of the User. + type: string + role: + description: Userrole assigned to the user. + type: string + enum: + - admin + - member + - developer + api_token: + description: The api token of the User. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminUploadsDownloadUrlRes: + type: object + required: + - download_url + properties: + download_url: + description: The Download URL of the file + type: string + AdminUploadsRes: + type: object + required: + - uploads + properties: + uploads: + type: array + items: + type: object + required: + - url + properties: + url: + description: The URL of the uploaded file. + type: string + format: uri + AdminUserRes: + type: object + required: + - user + properties: + user: + $ref: '#/components/schemas/User' + AdminUsersListRes: + type: object + required: + - users + properties: + users: + type: array + items: + $ref: '#/components/schemas/User' + AdminVariantsListRes: + type: object + x-expanded-relations: + field: variants + relations: + - options + - prices + - product + required: + - variants + - count + - offset + - limit + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminVariantsRes: + type: object + x-expanded-relations: + field: variant + relations: + - options + - prices + - product + required: + - variant + properties: + variant: + $ref: '#/components/schemas/PricedVariant' + BatchJob: + title: Batch Job + description: A Batch Job. + type: object + required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status + - type + - updated_at + properties: + id: + description: The unique identifier for the batch job. + type: string + example: batch_01G8T782965PYFG0751G0Z38B4 + 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 + - confirmed + - processing + - completed + - canceled + - failed + default: created + created_by: + description: The unique identifier of the user that created the batch job. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + nullable: true + $ref: '#/components/schemas/User' + context: + description: The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + nullable: true + allOf: + - type: object + example: {} + - type: object + properties: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: + type: string + file_size: + type: number + example: + errors: + - err: [] + code: unknown + message: Method not implemented. + stat_descriptors: + - key: product-export-count + name: Product count to export + message: There will be 8 products exported by this action + pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true + type: string + format: date-time + processing_at: + description: The date the job is processing at. + nullable: true + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + nullable: true + type: string + format: date-time + completed_at: + description: The date of the completion. + nullable: true + type: string + format: date-time + canceled_at: + description: The date of the concellation. + nullable: true + type: string + format: date-time + failed_at: + description: The date when the job failed. + nullable: true + 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. + nullable: true + type: string + format: date-time + Cart: + title: Cart + description: Represents a user cart + type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at + properties: + id: + description: The cart's ID + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + email: + description: The email associated with the cart + nullable: true + type: string + format: email + billing_address_id: + description: The billing address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The shipping address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + discounts: + description: Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + customer_id: + description: The customer's ID + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + payment_session: + description: The selected payment session in the cart. + nullable: true + type: object + payment_sessions: + description: The payment sessions created on the cart. + type: array + items: + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + shipping_methods: + description: The shipping methods added to the cart. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + type: + description: The cart's type. + type: string + enum: + - default + - swap + - draft_order + - payment_link + - claim + default: default + completed_at: + description: The date with timezone at which the cart was completed. + nullable: true + type: string + format: date-time + payment_authorized_at: + description: The date with timezone at which the payment was authorized. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + context: + description: The context of the cart which can include info like IP or user agent. + nullable: true + type: object + example: + ip: '::1' + user_agent: PostmanRuntime/7.29.2 + sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + shipping_total: + description: The total of shipping + type: integer + example: 1000 + discount_total: + description: The total of discount rounded + type: integer + example: 800 + raw_discount_total: + description: The total of discount + type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order associated with this cart is returned. + type: integer + example: 0 + total: + description: The total amount of the cart + type: integer + example: 8200 + subtotal: + description: The subtotal of the cart + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + ClaimImage: + title: Claim Image + description: Represents photo documentation of a claim. + type: object + required: + - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + description: The claim image's ID + type: string + example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 + claim_item_id: + description: The ID of the claim item associated with the image + type: string + claim_item: + description: A claim item object. Available if the relation `claim_item` is expanded. + nullable: true + type: object + url: + description: The URL of the image + type: string + format: uri + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimItem: + title: Claim Item + description: Represents a claimed item along with information about the reasons for the claim. + type: object + required: + - claim_order_id + - created_at + - deleted_at + - id + - item_id + - metadata + - note + - quantity + - reason + - updated_at + - variant_id + properties: + id: + description: The claim item's ID + type: string + example: citm_01G8ZH853Y6TFXWPG5EYE81X63 + images: + description: Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimImage' + claim_order_id: + description: The ID of the claim this item is associated with. + type: string + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + item_id: + description: The ID of the line item that the claim item refers to. + type: string + example: item_01G8ZM25TN49YV9EQBE2NC27KC + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + variant_id: + description: The ID of the product variant that is claimed. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A variant object. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + reason: + description: The reason for the claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + note: + description: An optional note about the claim, for additional information + nullable: true + type: string + example: I don't like it. + quantity: + description: The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order. + type: integer + example: 1 + tags: + description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimTag' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimOrder: + title: Claim Order + description: Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. + type: object + required: + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at + properties: + id: + description: The claim's ID + type: string + example: claim_01G8ZH853Y6TFXWPG5EYE81X63 + type: + description: The claim's type + type: string + enum: + - refund + - replace + payment_status: + description: The status of the claim's payment + type: string + enum: + - na + - not_refunded + - refunded + default: na + fulfillment_status: + description: The claim's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + claim_items: + description: The items that have been claimed + type: array + items: + $ref: '#/components/schemas/ClaimItem' + 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/LineItem' + order_id: + description: The ID of the order that the claim comes from. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + return_order: + description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true + type: object + shipping_address_id: + description: The ID of the address that the new items should be shipped to + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The shipping methods that the claim order will be shipped with. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + fulfillments: + description: The fulfillments of the new items to be shipped + type: array + items: + type: object + refund_amount: + description: The amount that will be refunded in conjunction with the claim + nullable: true + type: integer + example: 1000 + canceled_at: + description: The date with timezone at which the claim was canceled. + nullable: true + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + ClaimTag: + title: Claim Tag + description: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The claim tag's ID + type: string + example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 + value: + description: The value that the claim tag holds + type: string + example: Damaged + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Country: + title: Country + description: Country details + type: object + required: + - display_name + - id + - iso_2 + - iso_3 + - name + - num_code + - region_id + properties: + id: + description: The country's ID + type: string + example: 109 + iso_2: + description: The 2 character ISO code of the country in lower case + type: string + example: it + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + iso_3: + description: The 2 character ISO code of the country in lower case + type: string + example: ita + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + description: See a list of codes. + num_code: + description: The numerical ISO code for the country. + type: string + example: 380 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + description: See a list of codes. + name: + description: The normalized country name in upper case. + type: string + example: ITALY + display_name: + description: The country name appropriate for display. + type: string + example: Italy + region_id: + description: The region ID this country is associated with. + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + CreateStockLocationInput: + title: Create Stock Location Input + description: Represents the Input to create a Stock Location + type: object + required: + - name + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + Currency: + title: Currency + description: Currency + type: object + required: + - code + - name + - symbol + - symbol_native + properties: + code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + symbol: + description: The symbol used to indicate the currency. + type: string + example: $ + symbol_native: + description: The native symbol used to indicate the currency. + type: string + example: $ + name: + description: The written name of the currency + type: string + example: US Dollar + includes_tax: + description: '[EXPERIMENTAL] Does the currency prices include tax' + type: boolean + default: false + CustomShippingOption: + title: Custom Shipping Option + description: Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option + type: object + required: + - cart_id + - created_at + - deleted_at + - id + - metadata + - price + - shipping_option_id + - updated_at + properties: + id: + description: The custom shipping option's ID + type: string + example: cso_01G8X99XNB77DMFBJFWX6DN9V9 + price: + description: The custom price set that will override the shipping option's original price + type: integer + example: 1000 + shipping_option_id: + description: The ID of the Shipping Option that the custom shipping option overrides + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: A shipping option object. Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + cart_id: + description: The ID of the Cart that the custom shipping option is attached to + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Customer: + title: Customer + description: Represents a customer + type: object + required: + - billing_address_id + - created_at + - deleted_at + - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at + properties: + id: + description: The customer's ID + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + email: + description: The customer's email + type: string + format: email + first_name: + description: The customer's first name + nullable: true + type: string + example: Arno + last_name: + description: The customer's last name + nullable: true + type: string + example: Willms + billing_address_id: + description: The customer's billing address ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_addresses: + description: Available if the relation `shipping_addresses` is expanded. + type: array + items: + $ref: '#/components/schemas/Address' + phone: + description: The customer's phone number + nullable: true + type: string + example: 16128234334802 + has_account: + description: Whether the customer has an account or not + type: boolean + default: false + orders: + description: Available if the relation `orders` is expanded. + type: array + items: + type: object + groups: + description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + CustomerGroup: + title: Customer Group + description: Represents a customer group + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - updated_at + properties: + id: + description: The customer group's ID + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + name: + description: The name of the customer group + type: string + example: VIP + customers: + description: The customers that belong to the customer group. Available if the relation `customers` is expanded. + type: array + items: + type: object + price_lists: + description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Discount: + title: Discount + description: Represents a discount that can be applied to a cart for promotional purposes. + type: object + required: + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration + properties: + id: + description: The discount's ID + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + code: + description: A unique code for the discount - this will be used by the customer to apply the discount + type: string + example: 10DISC + is_dynamic: + description: A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts + type: boolean + example: false + rule_id: + description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + rule: + description: Available if the relation `rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + is_disabled: + description: Whether the Discount has been disabled. Disabled discounts cannot be applied to carts + type: boolean + example: false + parent_discount_id: + description: The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string + example: disc_01G8ZH853YPY9B94857DY91YGW + parent_discount: + description: Available if the relation `parent_discount` is expanded. + nullable: true + type: object + starts_at: + description: The time at which the discount can be used. + type: string + format: date-time + ends_at: + description: The time at which the discount can no longer be used. + nullable: true + type: string + format: date-time + valid_duration: + description: Duration the discount runs between + nullable: true + type: string + example: P3Y6M4DT12H30M5S + regions: + description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. + type: array + items: + $ref: '#/components/schemas/Region' + usage_limit: + description: The maximum number of times that a discount can be used. + nullable: true + type: integer + example: 100 + usage_count: + description: The number of times a discount has been used. + type: integer + example: 50 + default: 0 + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountCondition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + type: object + required: + - created_at + - deleted_at + - discount_rule_id + - id + - metadata + - operator + - type + - updated_at + properties: + id: + description: The discount condition's ID + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + operator: + description: The operator of the Condition + type: string + enum: + - in + - not_in + discount_rule_id: + description: The ID of the discount rule associated with the condition + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + discount_rule: + description: Available if the relation `discount_rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + products: + description: products associated with this condition if type = products. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + product_tags: + description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + product_collections: + description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductCollection' + customer_groups: + description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionCustomerGroup: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + type: object + required: + - condition_id + - created_at + - customer_group_id + - metadata + - updated_at + properties: + customer_group_id: + description: The ID of the Product Tag + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + customer_group: + description: Available if the relation `customer_group` is expanded. + nullable: true + $ref: '#/components/schemas/CustomerGroup' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProduct: + title: Product Discount Condition + description: Associates a discount condition with a product + type: object + required: + - condition_id + - created_at + - metadata + - product_id + - updated_at + properties: + product_id: + description: The ID of the Product Tag + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductCollection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + type: object + required: + - condition_id + - created_at + - metadata + - product_collection_id + - updated_at + properties: + product_collection_id: + description: The ID of the Product Collection + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_collection: + description: Available if the relation `product_collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductTag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + type: object + required: + - condition_id + - created_at + - metadata + - product_tag_id + - updated_at + properties: + product_tag_id: + description: The ID of the Product Tag + type: string + example: ptag_01F0YESHPZYY3H4SJ3A5918SBN + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_tag: + description: Available if the relation `product_tag` is expanded. + nullable: true + $ref: '#/components/schemas/ProductTag' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductType: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + type: object + required: + - condition_id + - created_at + - metadata + - product_type_id + - updated_at + properties: + product_type_id: + description: The ID of the Product Tag + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountRule: + title: Discount Rule + description: Holds the rules that governs how a Discount is calculated when applied to a Cart. + type: object + required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata + - type + - updated_at + - value + properties: + id: + description: The discount rule's ID + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + type: + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + type: string + enum: + - fixed + - percentage + - free_shipping + example: percentage + description: + description: A short description of the discount + nullable: true + type: string + example: 10 Percent + value: + description: The value that the discount represents; this will depend on the type of the discount + type: integer + example: 10 + allocation: + description: The scope that the discount should apply to. + nullable: true + type: string + enum: + - total + - item + example: total + conditions: + description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DraftOrder: + title: DraftOrder + description: Represents a draft order + type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at + properties: + id: + description: The draft order's ID + type: string + example: dorder_01G8TJFKBG38YYFQ035MSVG03C + status: + description: The status of the draft order + type: string + enum: + - open + - completed + default: open + display_id: + description: The draft order's display ID + type: string + example: 2 + cart_id: + description: The ID of the cart associated with the draft order. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the order associated with the draft order. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + canceled_at: + description: The date the draft order was canceled at. + nullable: true + type: string + format: date-time + completed_at: + description: The date the draft order was completed at. + nullable: true + type: string + format: date-time + no_notification_order: + description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Error: + title: Response Error + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + message: + type: string + description: Description of the error that occurred. + type: + type: string + description: A slug indicating the type of the error. + ExtendedStoreDTO: + allOf: + - $ref: '#/components/schemas/Store' + - type: object + required: + - payment_providers + - fulfillment_providers + - feature_flags + - modules + properties: + payment_providers: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + $ref: '#/components/schemas/FulfillmentProvider' + feature_flags: + $ref: '#/components/schemas/FeatureFlagsResponse' + modules: + $ref: '#/components/schemas/ModulesResponse' + FeatureFlagsResponse: + type: array + items: + type: object + required: + - key + - value + properties: + key: + description: The key of the feature flag. + type: string + value: + description: The value of the feature flag. + type: boolean + Fulfillment: + title: Fulfillment + description: Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. + type: object + required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at + properties: + id: + description: The fulfillment's ID + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + claim_order_id: + description: The id of the Claim that the Fulfillment belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Fulfillment belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + order_id: + description: The id of the Order that the Fulfillment belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + provider_id: + description: The id of the Fulfillment Provider responsible for handling the fulfillment + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + items: + description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentItem' + tracking_links: + description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded. + type: array + items: + $ref: '#/components/schemas/TrackingLink' + tracking_numbers: + description: The tracking numbers that can be used to track the status of the fulfillment. + deprecated: true + type: array + items: + type: string + data: + description: This contains all the data necessary for the Fulfillment provider to handle the fulfillment. + type: object + example: {} + shipped_at: + description: The date with timezone at which the Fulfillment was shipped. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be sent. + nullable: true + type: boolean + example: false + canceled_at: + description: The date with timezone at which the Fulfillment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of the fulfillment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + FulfillmentItem: + title: Fulfillment Item + description: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. + type: object + required: + - fulfillment_id + - item_id + - quantity + properties: + fulfillment_id: + description: The id of the Fulfillment that the Fulfillment Item belongs to. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + item_id: + description: The id of the Line Item that the Fulfillment Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + fulfillment: + description: A fulfillment object. Available if the relation `fulfillment` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Fulfillment. + type: integer + example: 1 + FulfillmentProvider: + title: Fulfillment Provider + description: Represents a fulfillment provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the fulfillment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + GiftCard: + title: Gift Card + description: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. + type: object + required: + - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id + - region_id + - tax_rate + - updated_at + - value + properties: + id: + description: The gift card's ID + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + code: + description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card. + type: string + example: 3RFT-MH2C-Y4YZ-XMN4 + value: + description: The value that the Gift Card represents. + type: integer + example: 10 + balance: + description: The remaining value on the Gift Card. + type: integer + example: 10 + region_id: + description: The id of the Region in which the Gift Card is available. + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + order_id: + description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + is_disabled: + description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. + type: boolean + default: false + ends_at: + description: The time at which the Gift Card can no longer be used. + nullable: true + type: string + format: date-time + tax_rate: + description: The gift card's tax rate that will be applied on calculating totals + nullable: true + type: number + example: 0 + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + GiftCardTransaction: + title: Gift Card Transaction + description: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order + type: object + required: + - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate + properties: + id: + description: The gift card transaction's ID + type: string + example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A + gift_card_id: + description: The ID of the Gift Card that was used in the transaction. + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + gift_card: + description: A gift card object. Available if the relation `gift_card` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Gift Card was used to pay for. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that was used from the Gift Card. + type: integer + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + is_taxable: + description: Whether the transaction is taxable or not. + nullable: true + type: boolean + example: false + tax_rate: + description: The tax rate of the transaction + nullable: true + type: number + example: 0 + IdempotencyKey: + title: Idempotency Key + description: Idempotency Key is used to continue a process in case of any failure that might occur. + type: object + required: + - created_at + - id + - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path + properties: + id: + description: The idempotency key's ID + type: string + example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A + idempotency_key: + description: The unique randomly generated key used to determine the state of a process. + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: Date which the idempotency key was locked. + type: string + format: date-time + locked_at: + description: Date which the idempotency key was locked. + nullable: true + type: string + format: date-time + request_method: + description: The method of the request + nullable: true + type: string + example: POST + request_params: + description: The parameters passed to the request + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + request_path: + description: The request's path + nullable: true + type: string + example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete + response_code: + description: The response's code. + nullable: true + type: string + example: 200 + response_body: + description: The response's body + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + recovery_point: + description: Where to continue from. + type: string + default: started + Image: + title: Image + description: Images holds a reference to a URL at which the image file can be found. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + type: string + description: The image's ID + example: img_01G749BFYR6T8JTVW6SGW3K3E6 + url: + description: The URL at which the image file can be found. + type: string + format: uri + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + Invite: + title: Invite + description: Represents an invite + type: object + required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at + - user_email + properties: + id: + type: string + description: The invite's ID + example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 + user_email: + description: The email of the user being invited. + type: string + format: email + role: + description: The user's role. + nullable: true + type: string + enum: + - admin + - member + - developer + default: member + accepted: + description: Whether the invite was accepted or not. + type: boolean + default: false + token: + description: The token used to accept the invite. + type: string + expires_at: + description: The date the invite expires at. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItem: + title: Line Item + description: Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. + type: object + required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail + - title + - unit_price + - updated_at + - variant_id + properties: + id: + description: The line item's ID + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + cart_id: + description: The ID of the Cart that the Line Item belongs to. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Line Item belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Line Item belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Line Item belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemTaxLine' + adjustments: + description: Available if the relation `adjustments` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemAdjustment' + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: The order edit joined. Available if the relation `order_edit` is expanded. + nullable: true + type: object + title: + description: The title of the Line Item, this should be easily identifiable by the Customer. + type: string + example: Medusa Coffee Mug + description: + description: A more detailed description of the contents of the Line Item. + nullable: true + type: string + example: One Size + thumbnail: + description: A URL string to a small image of the contents of the Line Item. + nullable: true + type: string + format: uri + example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + is_return: + description: Is the item being returned + type: boolean + default: false + is_giftcard: + description: Flag to indicate if the Line Item is a Gift Card. + type: boolean + default: false + should_merge: + description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. + type: boolean + default: true + allow_discounts: + description: Flag to indicate if the Line Item should be included when doing discount calculations. + type: boolean + default: true + has_shipping: + description: Flag to indicate if the Line Item has fulfillment associated with it. + nullable: true + type: boolean + example: false + unit_price: + description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. + type: integer + example: 8000 + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + quantity: + description: The quantity of the content in the Line Item. + type: integer + example: 1 + fulfilled_quantity: + description: The quantity of the Line Item that has been fulfilled. + nullable: true + type: integer + example: 0 + returned_quantity: + description: The quantity of the Line Item that has been returned. + nullable: true + type: integer + example: 0 + shipped_quantity: + description: The quantity of the Line Item that has been shipped. + nullable: true + type: integer + example: 0 + refundable: + description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration. + type: integer + example: 0 + subtotal: + description: The subtotal of the line item + type: integer + example: 8000 + tax_total: + description: The total of tax of the line item + type: integer + example: 0 + total: + description: The total amount of the line item + type: integer + example: 8000 + original_total: + description: The original total amount of the line item + type: integer + example: 8000 + original_tax_total: + description: The original tax total amount of the line item + type: integer + example: 0 + discount_total: + description: The total of discount of the line item rounded + type: integer + example: 0 + raw_discount_total: + description: The total of discount of the line item + type: integer + example: 0 + gift_card_total: + description: The total of the gift card of the line item + type: integer + example: 0 + includes_tax: + description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemAdjustment: + title: Line Item Adjustment + description: Represents a Line Item Adjustment + type: object + required: + - amount + - description + - discount_id + - id + - item_id + - metadata + properties: + id: + description: The Line Item Adjustment's ID + type: string + example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + description: + description: The line item's adjustment description + type: string + example: Adjusted item's price. + discount_id: + description: The ID of the discount associated with the adjustment + nullable: true + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + discount: + description: Available if the relation `discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + amount: + description: The adjustment amount + type: number + example: 1000 + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemTaxLine: + title: Line Item Tax Line + description: Represents a Line Item Tax Line + type: object + required: + - code + - created_at + - id + - item_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ModulesResponse: + type: array + items: + type: object + required: + - module + - resolution + properties: + module: + description: The key of the module. + type: string + resolution: + description: The resolution path of the module or false if module is not installed. + type: string + MoneyAmount: + title: Money Amount + description: Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. + type: object + required: + - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id + properties: + id: + description: The money amount's ID + type: string + example: ma_01F0YESHRFQNH5S8Q0PK84YYZN + currency_code: + description: The 3 character currency code that the Money Amount is given in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount: + description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. + type: integer + example: 100 + 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. + nullable: true + type: integer + example: 1 + 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. + nullable: true + type: integer + example: 1 + price_list_id: + description: The ID of the price list associated with the money amount + nullable: true + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + price_list: + description: Available if the relation `price_list` is expanded. + nullable: true + type: object + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + type: object + region_id: + description: The region's ID + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + MultipleErrors: + title: Multiple Errors + type: object + properties: + errors: + type: array + description: Array of errors + items: + $ref: '#/components/schemas/Error' + message: + type: string + default: Provided request body contains errors. Please check the data and retry the request + Note: + title: Note + description: Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. + type: object + required: + - author_id + - created_at + - deleted_at + - id + - metadata + - resource_id + - resource_type + - updated_at + - value + properties: + id: + description: The note's ID + type: string + example: note_01G8TM8ENBMC7R90XRR1G6H26Q + resource_type: + description: The type of resource that the Note refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Note refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + value: + description: The contents of the note. + type: string + example: This order must be fulfilled on Monday + author_id: + description: The ID of the author (user) + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + author: + description: Available if the relation `author` is expanded. + nullable: true + $ref: '#/components/schemas/User' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Notification: + title: Notification + description: Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. + type: object + required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id + - resource_type + - resource_id + - to + - updated_at + properties: + id: + description: The notification's ID + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + event_name: + description: The name of the event that the notification was sent for. + nullable: true + type: string + example: order.placed + resource_type: + description: The type of resource that the Notification refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Notification refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + customer_id: + description: The ID of the Customer that the Notification was sent to. + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + to: + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id + type: string + example: user@example.com + data: + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. + type: object + example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + type: object + resends: + description: The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. + type: array + items: + type: object + provider_id: + description: The id of the Notification Provider that handles the Notification. + nullable: true + type: string + example: sengrid + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/NotificationProvider' + 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 updated. + type: string + format: date-time + NotificationProvider: + title: Notification Provider + description: Represents a notification provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the notification provider as given by the plugin. + type: string + example: sendgrid + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + OAuth: + title: OAuth + description: Represent an OAuth app + type: object + required: + - application_name + - data + - display_name + - id + - install_url + - uninstall_url + properties: + id: + description: The app's ID + type: string + example: example_app + display_name: + description: The app's display name + type: string + example: Example app + application_name: + description: The app's name + type: string + example: example + install_url: + description: The URL to install the app + nullable: true + type: string + format: uri + uninstall_url: + description: The URL to uninstall the app + nullable: true + type: string + format: uri + data: + description: Any data necessary to the app. + nullable: true + type: object + example: {} + Order: + title: Order + description: Represents an order + type: object + required: + - billing_address_id + - canceled_at + - cart_id + - created_at + - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at + properties: + id: + description: The order's ID + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + status: + description: The order's status + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + default: pending + fulfillment_status: + description: The order's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + payment_status: + description: The order's payment status + type: string + enum: + - not_paid + - awaiting + - captured + - partially_refunded + - refunded + - canceled + - requires_action + default: not_paid + display_id: + description: The order's display ID + type: integer + example: 2 + cart_id: + description: The ID of the cart associated with the order + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + customer_id: + description: The ID of the customer associated with the order + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + email: + description: The email associated with the order + type: string + format: email + billing_address_id: + description: The ID of the billing address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The ID of the shipping address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character currency code that is used in the order + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The order's tax rate + nullable: true + type: number + example: 0 + discounts: + description: The discounts used in the order. Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + shipping_methods: + description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + payments: + description: The payments used in the order. Available if the relation `payments` is expanded. + type: array + items: + type: object + fulfillments: + description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + returns: + description: The returns associated with the order. Available if the relation `returns` is expanded. + type: array + items: + type: object + claims: + description: The claims associated with the order. Available if the relation `claims` is expanded. + type: array + items: + type: object + refunds: + description: The refunds associated with the order. Available if the relation `refunds` is expanded. + type: array + items: + type: object + swaps: + description: The swaps associated with the order. Available if the relation `swaps` is expanded. + type: array + items: + type: object + draft_order_id: + description: The ID of the draft order this order is associated with. + nullable: true + type: string + example: null + draft_order: + description: A draft order object. Available if the relation `draft_order` is expanded. + nullable: true + type: object + items: + description: The line items that belong to the order. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + edits: + description: Order edits done on the order. Available if the relation `edits` is expanded. + type: array + items: + type: object + gift_card_transactions: + description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCardTransaction' + canceled_at: + description: The date the order was canceled on. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the processing of the order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + external_id: + description: The ID of an external order. + nullable: true + type: string + example: null + sales_channel_id: + description: The ID of the sales channel this order is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + shipping_total: + type: integer + description: The total of shipping + example: 1000 + raw_discount_total: + description: The total of discount + type: integer + example: 800 + discount_total: + description: The total of discount rounded + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order is returned. + type: integer + example: 0 + total: + description: The total amount of the order + type: integer + example: 8200 + subtotal: + description: The subtotal of the order + type: integer + example: 8000 + paid_total: + description: The total amount paid + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + returnable_items: + description: The items that are returnable as part of the order, order swaps or order claims + type: array + items: + $ref: '#/components/schemas/LineItem' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + OrderEdit: + title: Order Edit + description: Order edit keeps track of order items changes. + type: object + required: + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at + - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at + properties: + id: + description: The order edit's ID + type: string + example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK + order_id: + description: The ID of the order that is edited + type: string + example: order_01G2SG30J8C85S4A5CHM2S1NS2 + order: + description: Available if the relation `order` is expanded. + nullable: true + type: object + changes: + description: Available if the relation `changes` is expanded. + type: array + items: + $ref: '#/components/schemas/OrderItemChange' + internal_note: + description: An optional note with additional details about the order edit. + nullable: true + type: string + example: Included two more items B to the order. + created_by: + description: The unique identifier of the user or customer who created the order edit. + type: string + requested_by: + description: The unique identifier of the user or customer who requested the order edit. + nullable: true + type: string + requested_at: + description: The date with timezone at which the edit was requested. + nullable: true + type: string + format: date-time + confirmed_by: + description: The unique identifier of the user or customer who confirmed the order edit. + nullable: true + type: string + confirmed_at: + description: The date with timezone at which the edit was confirmed. + nullable: true + type: string + format: date-time + declined_by: + description: The unique identifier of the user or customer who declined the order edit. + nullable: true + type: string + declined_at: + description: The date with timezone at which the edit was declined. + nullable: true + type: string + format: date-time + declined_reason: + description: An optional note why the order edit is declined. + nullable: true + type: string + canceled_by: + description: The unique identifier of the user or customer who cancelled the order edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time + subtotal: + description: The total of subtotal + type: integer + example: 8000 + discount_total: + description: The total of discount + type: integer + example: 800 + shipping_total: + description: The total of the shipping amount + type: integer + example: 800 + gift_card_total: + description: The total of the gift card amount + type: integer + example: 800 + gift_card_tax_total: + description: The total of the gift card tax amount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + total: + description: The total amount of the edited order. + type: integer + example: 8200 + difference_due: + description: The difference between the total amount of the order and total amount of edited order. + type: integer + example: 8200 + status: + description: The status of the order edit. + type: string + enum: + - confirmed + - declined + - requested + - created + - canceled + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + payment_collection_id: + description: The ID of the payment collection + nullable: true + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + nullable: true + $ref: '#/components/schemas/PaymentCollection' + 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 updated. + type: string + format: date-time + OrderItemChange: + title: Order Item Change + description: Represents an order edit item change + type: object + required: + - created_at + - deleted_at + - id + - line_item_id + - order_edit_id + - original_line_item_id + - type + - updated_at + properties: + id: + description: The order item change's ID + type: string + example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The order item change's status + type: string + enum: + - item_add + - item_remove + - item_update + order_edit_id: + description: The ID of the order edit + type: string + example: oe_01G2SG30J8C85S4A5CHM2S1NS2 + order_edit: + description: Available if the relation `order_edit` is expanded. + nullable: true + type: object + original_line_item_id: + description: The ID of the original line item in the order + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + original_line_item: + description: Available if the relation `original_line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + line_item_id: + description: The ID of the cloned line item. + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + line_item: + description: Available if the relation `line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Payment: + title: Payment + description: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. + type: object + required: + - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at + - currency_code + - data + - id + - idempotency_key + - metadata + - order_id + - provider_id + - swap_id + - updated_at + properties: + id: + description: The payment's ID + type: string + example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE + swap_id: + description: The ID of the Swap that the Payment is used for. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Payment is used for. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that the Payment has been authorized for. + type: integer + example: 100 + currency_code: + description: The 3 character ISO currency code that the Payment is completed in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount_refunded: + description: The amount of the original Payment amount that has been refunded back to the Customer. + type: integer + default: 0 + example: 0 + provider_id: + description: The id of the Payment Provider that is responsible for the Payment + type: string + example: manual + data: + description: The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + captured_at: + description: The date with timezone at which the Payment was captured. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Payment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a payment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentCollection: + title: Payment Collection + description: Payment Collection + type: object + required: + - amount + - authorized_amount + - created_at + - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at + properties: + id: + description: The payment collection's ID + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The type of the payment collection + type: string + enum: + - order_edit + status: + description: The type of the payment collection + type: string + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - canceled + description: + description: Description of the payment collection + nullable: true + type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + payment_sessions: + description: Available if the relation `payment_sessions` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payments: + description: Available if the relation `payments` is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + created_by: + description: The ID of the user that created the payment collection. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentProvider: + title: Payment Provider + description: Represents a Payment Provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the payment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + PaymentSession: + title: Payment Session + description: Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. + type: object + required: + - amount + - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at + - provider_id + - status + - updated_at + properties: + id: + description: The payment session's ID + type: string + example: ps_01G901XNSRM2YS3ASN9H5KG3FZ + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + provider_id: + description: The id of the Payment Provider that is responsible for the Payment Session + type: string + example: manual + is_selected: + description: A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. + nullable: true + type: boolean + example: true + is_initiated: + description: A flag to indicate if a communication with the third party provider has been initiated. + type: boolean + default: false + example: true + status: + description: Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer. + type: string + enum: + - authorized + - pending + - requires_more + - error + - canceled + example: pending + data: + description: The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true + 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 updated. + type: string + format: date-time + PriceList: + title: Price List + description: Price Lists represents a set of prices that overrides the default price for one or more product variants. + type: object + required: + - created_at + - deleted_at + - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at + properties: + id: + description: The price list's ID + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + name: + description: The price list's name + type: string + example: VIP Prices + description: + description: The price list's description + type: string + example: Prices for VIP customers + type: + description: The type of Price List. This can be one of either `sale` or `override`. + type: string + enum: + - sale + - override + default: sale + status: + description: The status of the Price List + type: string + enum: + - active + - draft + default: draft + starts_at: + description: The date with timezone that the Price List starts being valid. + nullable: true + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + nullable: true + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + prices: + description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + includes_tax: + description: '[EXPERIMENTAL] Does the price list prices include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + PricedProduct: + title: Priced Product + type: object + allOf: + - $ref: '#/components/schemas/Product' + - type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + PricedShippingOption: + title: Priced Shipping Option + type: object + allOf: + - $ref: '#/components/schemas/ShippingOption' + - type: object + properties: + price_incl_tax: + type: number + description: Price including taxes + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + tax_amount: + type: number + description: The taxes applied. + PricedVariant: + title: Priced Product Variant + type: object + allOf: + - $ref: '#/components/schemas/ProductVariant' + - type: object + properties: + original_price: + type: number + description: The original price of the variant without any discounted prices applied. + calculated_price: + type: number + description: The calculated price of the variant. Can be a discounted price. + original_price_incl_tax: + type: number + description: The original price of the variant including taxes. + calculated_price_incl_tax: + type: number + description: The calculated price of the variant including taxes. + original_tax: + type: number + description: The taxes applied on the original price. + calculated_tax: + type: number + description: The taxes applied on the calculated price. + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + Product: + title: Product + description: Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. + type: object + required: + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country + - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width + properties: + id: + description: The product's ID + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + title: + description: A title that can be displayed for easy identification of the Product. + type: string + example: Medusa Coffee Mug + subtitle: + description: An optional subtitle that can be used to further specify the Product. + nullable: true + type: string + description: + description: A short description of the Product. + nullable: true + type: string + example: Every programmer's best friend. + handle: + description: A unique identifier for the Product (e.g. for slug structure). + nullable: true + type: string + example: coffee-mug + is_giftcard: + description: Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. + type: boolean + default: false + status: + description: The status of the product + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + images: + description: Images of the Product. Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/Image' + thumbnail: + description: A URL to an image file that can be used to identify the Product. + nullable: true + type: string + format: uri + options: + description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOption' + variants: + description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariant' + categories: + description: The product's associated categories. Available if the relation `categories` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + profile_id: + description: The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + collection_id: + description: The Product Collection that the Product belongs to + nullable: true + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + collection: + description: A product collection object. Available if the relation `collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + type_id: + description: The Product type that the Product belongs to + nullable: true + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: Available if the relation `type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + tags: + description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + discountable: + description: Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. + type: boolean + default: true + external_id: + description: The external ID of the product + nullable: true + type: string + example: null + sales_channels: + description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannel' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductCategory: + title: ProductCategory + description: Represents a product category + x-resourceId: ProductCategory + type: object + required: + - category_children + - created_at + - handle + - id + - is_active + - is_internal + - mpath + - name + - parent_category_id + - updated_at + properties: + id: + description: The product category's ID + type: string + example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 + name: + description: The product category's name + type: string + example: Regular Fit + handle: + description: A unique string that identifies the Product Category - can for example be used in slug structures. + type: string + example: regular-fit + mpath: + description: A string for Materialized Paths - used for finding ancestors and descendents + nullable: true + type: string + example: pcat_id1.pcat_id2.pcat_id3 + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + default: false + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + default: false + rank: + type: integer + description: An integer that depicts the rank of category in a tree node + default: 0 + category_children: + description: Available if the relation `category_children` are expanded. + type: array + items: + type: object + parent_category_id: + description: The ID of the parent category. + nullable: true + type: string + default: null + parent_category: + description: A product category object. Available if the relation `parent_category` is expanded. + nullable: true + type: object + products: + description: Products associated with category. Available if the relation `products` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + ProductCollection: + title: Product Collection + description: Product Collections represents a group of Products that are related. + type: object + required: + - created_at + - deleted_at + - handle + - id + - metadata + - title + - updated_at + properties: + id: + description: The product collection's ID + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + title: + description: The title that the Product Collection is identified by. + type: string + example: Summer Collection + handle: + description: A unique string that identifies the Product Collection - can for example be used in slug structures. + nullable: true + type: string + example: summer-collection + products: + description: The Products contained in the Product Collection. Available if the relation `products` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOption: + title: Product Option + description: Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - product_id + - title + - updated_at + properties: + id: + description: The product option's ID + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + title: + description: The title that the Product Option is defined by (e.g. `Size`). + type: string + example: Size + values: + description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + product_id: + description: The ID of the Product that the Product Option is defined for. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOptionValue: + title: Product Option Value + description: A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - option_id + - updated_at + - value + - variant_id + properties: + id: + description: The product option value's ID + type: string + example: optval_01F0YESHR7S6ECD03RF6W12DSJ + value: + description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`). + type: string + example: large + option_id: + description: The ID of the Product Option that the Product Option Value is defined for. + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + option: + description: Available if the relation `option` is expanded. + nullable: true + type: object + variant_id: + description: The ID of the Product Variant that the Product Option Value is defined for. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: Available if the relation `variant` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTag: + title: Product Tag + description: Product Tags can be added to Products for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product tag's ID + type: string + example: ptag_01G8K2MTMG9168F2B70S1TAVK3 + value: + description: The value that the Product Tag represents + type: string + example: Pants + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTaxRate: + title: Product Tax Rate + description: Associates a tax rate with a product to indicate that the product is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_id + - rate_id + - updated_at + properties: + product_id: + description: The ID of the Product + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductType: + title: Product Type + description: Product Type can be added to Products for filtering and reporting purposes. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product type's ID + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + value: + description: The value that the Product Type represents. + type: string + example: Clothing + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTypeTaxRate: + title: Product Type Tax Rate + description: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_type_id + - rate_id + - updated_at + properties: + product_type_id: + description: The ID of the Product type + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + rate_id: + description: The id of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariant: + title: Product Variant + description: Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. + type: object + required: + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id + - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width + properties: + id: + description: The product variant's ID + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + title: + description: A title that can be displayed for easy identification of the Product Variant. + type: string + example: Small + product_id: + description: The ID of the Product that the Product Variant belongs to. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + prices: + description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + sku: + description: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. + nullable: true + type: string + example: shirt-123 + barcode: + description: A generic field for a GTIN number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + ean: + description: An EAN barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + upc: + description: A UPC barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + variant_rank: + description: The ranking of this variant + nullable: true + type: number + default: 0 + inventory_quantity: + description: The current quantity of the item that is stocked. + type: integer + example: 100 + allow_backorder: + description: Whether the Product Variant should be purchasable when `inventory_quantity` is 0. + type: boolean + default: false + manage_inventory: + description: Whether Medusa should manage inventory for the Product Variant. + type: boolean + default: true + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + options: + description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + inventory_items: + description: The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariantInventoryItem' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariantInventoryItem: + title: Product Variant Inventory Item + description: Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. + type: object + required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id + properties: + id: + description: The product variant inventory item's ID + type: string + example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A + inventory_item_id: + description: The id of the inventory item + type: string + variant_id: + description: The id of the variant. + type: string + variant: + description: A ProductVariant object. Available if the relation `variant` is expanded. + nullable: true + type: object + required_quantity: + description: The quantity of an inventory item required for one quantity of the variant. + type: integer + default: 1 + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + PublishableApiKey: + title: Publishable API key + description: Publishable API key defines scopes (i.e. resources) that are available within a request. + type: object + required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at + properties: + id: + description: The key's ID + type: string + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + description: The unique identifier of the user that created the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by: + description: The unique identifier of the user that revoked the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: + description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + 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 updated. + type: string + format: date-time + PublishableApiKeySalesChannel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + type: object + required: + - publishable_key_id + - sales_channel_id + properties: + sales_channel_id: + description: The sales channel's ID + type: string + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + description: The publishable API key's ID + type: string + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + Refund: + title: Refund + description: Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. + type: object + required: + - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at + properties: + id: + description: The refund's ID + type: string + example: ref_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Refund is related to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + amount: + description: The amount that has be refunded to the Customer. + type: integer + example: 1000 + note: + description: An optional note explaining why the amount was refunded. + nullable: true + type: string + example: I didn't like it + reason: + description: The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return. + type: string + enum: + - discount + - return + - swap + - claim + - other + example: return + idempotency_key: + description: Randomly generated key used to continue the completion of the refund in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Region: + title: Region + description: Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. + type: object + required: + - automatic_taxes + - created_at + - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id + - tax_rate + - updated_at + properties: + id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + name: + description: The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name. + type: string + example: EU + currency_code: + description: The 3 character currency code that the Region uses. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The tax rate that should be charged on purchases in the Region. + type: number + example: 0 + tax_rates: + description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. + type: array + items: + $ref: '#/components/schemas/TaxRate' + tax_code: + description: The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. + nullable: true + type: string + example: null + gift_cards_taxable: + description: Whether the gift cards are taxable or not in this region. + type: boolean + default: true + automatic_taxes: + description: Whether taxes should be automated in this region. + type: boolean + default: true + countries: + description: The countries that are included in the Region. Available if the relation `countries` is expanded. + type: array + items: + $ref: '#/components/schemas/Country' + tax_provider_id: + description: The ID of the tax provider used in this region + nullable: true + type: string + example: null + tax_provider: + description: Available if the relation `tax_provider` is expanded. + nullable: true + $ref: '#/components/schemas/TaxProvider' + payment_providers: + description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentProvider' + includes_tax: + description: '[EXPERIMENTAL] Does the prices for the region include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReservationItemDTO: + title: Reservation item + description: Represents a reservation of an inventory item at a stock location + type: object + required: + - id + - location_id + - inventory_item_id + - quantity + properties: + id: + description: The id of the reservation item + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + ResponseInventoryItem: + allOf: + - $ref: '#/components/schemas/InventoryItemDTO' + - type: object + required: + - available_quantity + properties: + available_quantity: + type: number + Return: + title: Return + description: Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. + type: object + required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at + - refund_amount + - shipping_data + - status + - swap_id + - updated_at + properties: + id: + description: The return's ID + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + status: + description: Status of the Return. + type: string + enum: + - requested + - received + - requires_action + - canceled + default: requested + items: + description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/ReturnItem' + swap_id: + description: The ID of the Swap that the Return is a part of. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The ID of the Claim that the Return is a part of. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + shipping_method: + description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + shipping_data: + description: Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. + nullable: true + type: object + example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + refund_amount: + description: The amount that should be refunded as a result of the return. + type: integer + example: 1000 + no_notification: + description: When set to true, no notification will be sent related to this return. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the return in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + received_at: + description: The date with timezone at which the return was received. + nullable: true + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnItem: + title: Return Item + description: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. + type: object + required: + - is_requested + - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id + properties: + return_id: + description: The id of the Return that the Return Item belongs to. + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + item_id: + description: The id of the Line Item that the Return Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Return. + type: integer + example: 1 + is_requested: + description: Whether the Return Item was requested initially or received unexpectedly in the warehouse. + type: boolean + default: true + requested_quantity: + description: The quantity that was originally requested to be returned. + nullable: true + type: integer + example: 1 + received_quantity: + description: The quantity that was received in the warehouse. + nullable: true + type: integer + example: 1 + reason_id: + description: The ID of the reason for returning the item. + nullable: true + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + reason: + description: Available if the relation `reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + note: + description: An optional note with additional details about the Return. + nullable: true + type: string + example: I didn't like it. + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnReason: + title: Return Reason + description: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. + type: object + required: + - created_at + - deleted_at + - description + - id + - label + - metadata + - parent_return_reason_id + - updated_at + - value + properties: + id: + description: The return reason's ID + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + value: + description: The value to identify the reason by. + type: string + example: damaged + label: + description: A text that can be displayed to the Customer as a reason. + type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: + description: The ID of the parent reason. + nullable: true + type: string + example: null + parent_return_reason: + description: Available if the relation `parent_return_reason` is expanded. + nullable: true + type: object + return_reason_children: + description: Available if the relation `return_reason_children` is expanded. + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + SalesChannel: + title: Sales Channel + description: A Sales Channel + type: object + required: + - created_at + - deleted_at + - description + - id + - is_disabled + - name + - updated_at + properties: + id: + description: The sales channel's ID + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + name: + description: The name of the sales channel. + type: string + example: Market + description: + description: The description of the sales channel. + nullable: true + type: string + example: Multi-vendor market + is_disabled: + description: Specify if the sales channel is enabled or disabled. + type: boolean + default: false + locations: + description: The Stock Locations related to the sales channel. Available if the relation `locations` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannelLocation' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + SalesChannelLocation: + title: Sales Channel Stock Location + description: Sales Channel Stock Location link sales channels with stock locations. + type: object + required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at + properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingMethod: + title: Shipping Method + description: Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. + type: object + required: + - cart_id + - claim_order_id + - data + - id + - order_id + - price + - return_id + - shipping_option_id + - swap_id + properties: + id: + description: The shipping method's ID + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_option_id: + description: The id of the Shipping Option that the Shipping Method is built from. + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Shipping Method is used on. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Shipping Method is used on. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: A return object. Available if the relation `return_order` is expanded. + nullable: true + type: object + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethodTaxLine' + price: + description: The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of. + type: integer + example: 200 + data: + description: Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' + type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 + ShippingMethodTaxLine: + title: Shipping Method Tax Line + description: Shipping Method Tax Line + type: object + required: + - code + - created_at + - id + - shipping_method_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + shipping_method_id: + description: The ID of the line item + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingOption: + title: Shipping Option + description: Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. + type: object + required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata + - name + - price_type + - profile_id + - provider_id + - region_id + - updated_at + properties: + id: + description: The shipping option's ID + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + name: + description: The name given to the Shipping Option - this may be displayed to the Customer. + type: string + example: PostFake Standard + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + profile_id: + description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + provider_id: + description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + price_type: + description: The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations. + type: string + enum: + - flat_rate + - calculated + example: flat_rate + amount: + description: The amount to charge for shipping when the Shipping Option price type is `flat_rate`. + nullable: true + type: integer + example: 200 + is_return: + description: Flag to indicate if the Shipping Option can be used for Return shipments. + type: boolean + default: false + admin_only: + description: Flag to indicate if the Shipping Option usage is restricted to admin users. + type: boolean + default: false + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOptionRequirement' + data: + description: The data needed for the Fulfillment Provider to identify the Shipping Option. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Does the shipping option price include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingOptionRequirement: + title: Shipping Option Requirement + description: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. + type: object + required: + - amount + - deleted_at + - id + - shipping_option_id + - type + properties: + id: + description: The shipping option requirement's ID + type: string + example: sor_01G1G5V29AB4CTNDRFSRWSRKWD + shipping_option_id: + description: The id of the Shipping Option that the hipping option requirement belongs to + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + type: object + type: + description: The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available. + type: string + enum: + - min_subtotal + - max_subtotal + example: min_subtotal + amount: + description: The amount to compare the Cart subtotal to. + type: integer + example: 100 + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingProfile: + title: Shipping Profile + description: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - type + - updated_at + properties: + id: + description: The shipping profile's ID + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + name: + description: The name given to the Shipping profile - this may be displayed to the Customer. + type: string + example: Default Shipping Profile + type: + description: The type of the Shipping Profile, may be `default`, `gift_card` or `custom`. + type: string + enum: + - default + - gift_card + - custom + example: default + products: + description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. + type: array + items: + type: object + shipping_options: + description: The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingTaxRate: + title: Shipping Tax Rate + description: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way + type: object + required: + - created_at + - metadata + - rate_id + - shipping_option_id + - updated_at + properties: + shipping_option_id: + description: The ID of the Shipping Option + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StagedJob: + title: Staged Job + description: A staged job resource + type: object + required: + - data + - event_name + - id + - options + properties: + id: + description: The staged job's ID + type: string + example: job_01F0YET7BZTARY9MKN1SJ7AAXF + event_name: + description: The name of the event + type: string + example: order.placed + data: + description: Data necessary for the job + type: object + example: {} + option: + description: The staged job's option + type: object + example: {} + StockLocationAddressDTO: + title: Stock Location Address + description: Represents a Stock Location Address + type: object + required: + - address_1 + - country_code + - created_at + - updated_at + properties: + id: + type: string + description: The stock location address' ID + example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42 + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationAddressInput: + title: Stock Location Address Input + description: Represents a Stock Location Address Input + type: object + required: + - address_1 + - country_code + properties: + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationDTO: + title: Stock Location + description: Represents a Stock Location + type: object + required: + - id + - name + - address_id + - created_at + - updated_at + properties: + id: + type: string + description: The stock location's ID + example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42 + address_id: + type: string + description: Stock location address' ID + example: laddr_05B2ZE853Y6FTXWPW85NJ81A44 + name: + type: string + description: The name of the stock location + example: Main Warehouse + address: + description: The Address of the Stock Location + allOf: + - $ref: '#/components/schemas/StockLocationAddressDTO' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + StockLocationExpandedDTO: + allOf: + - $ref: '#/components/schemas/StockLocationDTO' + - type: object + properties: + sales_channels: + $ref: '#/components/schemas/SalesChannel' + Store: + title: Store + description: Holds settings for the Store, such as name, currencies, etc. + type: object + required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at + properties: + id: + description: The store's ID + type: string + example: store_01G1G5V21KADXNGH29BJMAJ4B4 + name: + description: The name of the Store - this may be displayed to the Customer. + type: string + example: Medusa Store + default_currency_code: + description: The 3 character currency code that is the default of the store. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + default_currency: + description: Available if the relation `default_currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + currencies: + description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. + type: array + items: + $ref: '#/components/schemas/Currency' + swap_link_template: + description: A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. + nullable: true + type: string + example: null + payment_link_template: + description: A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. + nullable: true + type: string + example: null + invite_link_template: + description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true + type: string + example: null + default_sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + default_sales_channel: + description: A sales channel object. Available if the relation `default_sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Swap: + title: Swap + description: Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. + type: object + required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - shipping_address_id + - updated_at + properties: + id: + description: The swap's ID + type: string + example: swap_01F0YET86Y9G92D3YDR9Y6V676 + fulfillment_status: + description: The status of the Fulfillment of the Swap. + type: string + enum: + - not_fulfilled + - fulfilled + - shipped + - partially_shipped + - canceled + - requires_action + example: not_fulfilled + payment_status: + description: The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount. + type: string + enum: + - not_paid + - awaiting + - captured + - confirmed + - canceled + - difference_refunded + - partially_refunded + - refunded + - requires_action + example: not_paid + order_id: + description: The ID of the Order where the Line Items to be returned where purchased. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + additional_items: + description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + return_order: + description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + nullable: true + type: object + fulfillments: + description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + payment: + description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + nullable: true + type: object + difference_due: + description: The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. + nullable: true + type: integer + example: 0 + shipping_address_id: + description: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + cart_id: + description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + confirmed_at: + description: The date with timezone at which the Swap was confirmed by the Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: If set to true, no notification will be sent related to this swap + nullable: true + type: boolean + example: false + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: false + idempotency_key: + description: Randomly generated key used to continue the completion of the swap in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxLine: + title: Tax Line + description: Line item that specifies an amount of tax to add to a line item. + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The tax line's ID + type: string + example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxProvider: + title: Tax Provider + description: The tax service used to calculate taxes + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the tax provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + TaxRate: + title: Tax Rate + description: A Tax Rate can be used to associate a certain rate to charge on products within a given Region + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - region_id + - updated_at + properties: + id: + description: The tax rate's ID + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + rate: + description: The numeric rate to charge + nullable: true + type: number + example: 10 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + region_id: + description: The id of the Region that the rate belongs to + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + products: + description: The products that belong to this tax rate. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + shipping_options: + type: array + description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. + items: + $ref: '#/components/schemas/ShippingOption' + product_count: + description: The count of products + type: integer + example: 10 + product_type_count: + description: The count of product types + type: integer + example: 2 + shipping_option_count: + description: The count of shipping options + type: integer + example: 1 + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TrackingLink: + title: Tracking Link + description: Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. + type: object + required: + - created_at + - deleted_at + - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url + properties: + id: + description: The tracking link's ID + type: string + example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 + url: + description: The URL at which the status of the shipment can be tracked. + nullable: true + type: string + format: uri + tracking_number: + description: The tracking number given by the shipping carrier. + type: string + format: RH370168054CN + fulfillment_id: + description: The id of the Fulfillment that the Tracking Link references. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + fulfillment: + description: Available if the relation `fulfillment` is expanded. + nullable: true + type: object + idempotency_key: + description: Randomly generated key used to continue the completion of a process in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + UpdateStockLocationInput: + title: Update Stock Location Input + description: Represents the Input to update a Stock Location + type: object + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + User: + title: User + description: Represents a User who can manage store settings. + type: object + required: + - api_token + - created_at + - deleted_at + - email + - first_name + - id + - last_name + - metadata + - role + - updated_at + properties: + id: + description: The user's ID + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member + email: + description: The email of the User + type: string + format: email + first_name: + description: The first name of the User + nullable: true + type: string + example: Levi + last_name: + description: The last name of the User + nullable: true + type: string + example: Bogan + api_token: + description: An API token associated with the user. + nullable: true + type: string + example: null + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + VariantInventory: + type: object + properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + $ref: '#/components/schemas/ResponseInventoryItem' + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number diff --git a/docs/api/admin/code_samples/JavaScript/auth/delete.js b/docs/api/admin/code_samples/JavaScript/admin_auth/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/auth/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_auth/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/auth/get.js b/docs/api/admin/code_samples/JavaScript/admin_auth/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/auth/get.js rename to docs/api/admin/code_samples/JavaScript/admin_auth/get.js diff --git a/docs/api/admin/code_samples/JavaScript/auth/post.js b/docs/api/admin/code_samples/JavaScript/admin_auth/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/auth/post.js rename to docs/api/admin/code_samples/JavaScript/admin_auth/post.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs/get.js b/docs/api/admin/code_samples/JavaScript/admin_batch-jobs/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs/get.js rename to docs/api/admin/code_samples/JavaScript/admin_batch-jobs/get.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs/post.js b/docs/api/admin/code_samples/JavaScript/admin_batch-jobs/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs/post.js rename to docs/api/admin/code_samples/JavaScript/admin_batch-jobs/post.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_batch-jobs_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_batch-jobs_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_batch-jobs_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_batch-jobs_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_confirm/post.js b/docs/api/admin/code_samples/JavaScript/admin_batch-jobs_{id}_confirm/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_confirm/post.js rename to docs/api/admin/code_samples/JavaScript/admin_batch-jobs_{id}_confirm/post.js diff --git a/docs/api/admin/code_samples/JavaScript/collections/get.js b/docs/api/admin/code_samples/JavaScript/admin_collections/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections/get.js rename to docs/api/admin/code_samples/JavaScript/admin_collections/get.js diff --git a/docs/api/admin/code_samples/JavaScript/collections/post.js b/docs/api/admin/code_samples/JavaScript/admin_collections/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections/post.js rename to docs/api/admin/code_samples/JavaScript/admin_collections/post.js diff --git a/docs/api/admin/code_samples/JavaScript/collections_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_collections_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_collections_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/collections_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_collections_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_collections_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/collections_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_collections_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_collections_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/currencies/get.js b/docs/api/admin/code_samples/JavaScript/admin_currencies/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/currencies/get.js rename to docs/api/admin/code_samples/JavaScript/admin_currencies/get.js diff --git a/docs/api/admin/code_samples/JavaScript/currencies_{code}/post.js b/docs/api/admin/code_samples/JavaScript/admin_currencies_{code}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/currencies_{code}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_currencies_{code}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups/get.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups/get.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups/post.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups/post.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers/get.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers/get.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customers/get.js b/docs/api/admin/code_samples/JavaScript/admin_customers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers/get.js rename to docs/api/admin/code_samples/JavaScript/admin_customers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customers/post.js b/docs/api/admin/code_samples/JavaScript/admin_customers/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers/post.js rename to docs/api/admin/code_samples/JavaScript/admin_customers/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customers_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_customers_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_customers_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customers_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_customers_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_customers_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts/get.js b/docs/api/admin/code_samples/JavaScript/admin_discounts/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts/get.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_code_{code}/get.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_code_{code}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_code_{code}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_code_{code}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_dynamic-codes/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_dynamic-codes/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_dynamic-codes_{code}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_dynamic-codes_{code}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders/get.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders/get.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders/get.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders/post.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders/post.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items/post.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_line-items/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items/post.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_line-items/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_pay/post.js b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_pay/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_pay/post.js rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}_pay/post.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards/get.js b/docs/api/admin/code_samples/JavaScript/admin_gift-cards/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards/get.js rename to docs/api/admin/code_samples/JavaScript/admin_gift-cards/get.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards/post.js b/docs/api/admin/code_samples/JavaScript/admin_gift-cards/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards/post.js rename to docs/api/admin/code_samples/JavaScript/admin_gift-cards/post.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_gift-cards_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_gift-cards_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_gift-cards_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_gift-cards_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_gift-cards_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_gift-cards_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items/get.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items/get.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items/get.js diff --git a/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js new file mode 100644 index 0000000000..9140b639da --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js @@ -0,0 +1,10 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.create(inventoryItemId, { + variant_id: 'variant_123', + sku: "sku-123", +}) +.then(({ inventory_item }) => { + console.log(inventory_item.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/get.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/get.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/post.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/post.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/invites/get.js b/docs/api/admin/code_samples/JavaScript/admin_invites/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites/get.js rename to docs/api/admin/code_samples/JavaScript/admin_invites/get.js diff --git a/docs/api/admin/code_samples/JavaScript/invites/post.js b/docs/api/admin/code_samples/JavaScript/admin_invites/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites/post.js rename to docs/api/admin/code_samples/JavaScript/admin_invites/post.js diff --git a/docs/api/admin/code_samples/JavaScript/invites_accept/post.js b/docs/api/admin/code_samples/JavaScript/admin_invites_accept/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites_accept/post.js rename to docs/api/admin/code_samples/JavaScript/admin_invites_accept/post.js diff --git a/docs/api/admin/code_samples/JavaScript/invites_{invite_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_invites_{invite_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites_{invite_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_invites_{invite_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/invites_{invite_id}_resend/post.js b/docs/api/admin/code_samples/JavaScript/admin_invites_{invite_id}_resend/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites_{invite_id}_resend/post.js rename to docs/api/admin/code_samples/JavaScript/admin_invites_{invite_id}_resend/post.js diff --git a/docs/api/admin/code_samples/JavaScript/notes/get.js b/docs/api/admin/code_samples/JavaScript/admin_notes/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes/get.js rename to docs/api/admin/code_samples/JavaScript/admin_notes/get.js diff --git a/docs/api/admin/code_samples/JavaScript/notes/post.js b/docs/api/admin/code_samples/JavaScript/admin_notes/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes/post.js rename to docs/api/admin/code_samples/JavaScript/admin_notes/post.js diff --git a/docs/api/admin/code_samples/JavaScript/notes_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_notes_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_notes_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/notes_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_notes_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_notes_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/notes_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_notes_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_notes_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/notifications/get.js b/docs/api/admin/code_samples/JavaScript/admin_notifications/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notifications/get.js rename to docs/api/admin/code_samples/JavaScript/admin_notifications/get.js diff --git a/docs/api/admin/code_samples/JavaScript/notifications_{id}_resend/post.js b/docs/api/admin/code_samples/JavaScript/admin_notifications_{id}_resend/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notifications_{id}_resend/post.js rename to docs/api/admin/code_samples/JavaScript/admin_notifications_{id}_resend/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits/get.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits/get.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits/get.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_changes_{change_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_changes_{change_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_changes_{change_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_changes_{change_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_items/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_items/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/post.js b/docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_request/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/post.js rename to docs/api/admin/code_samples/JavaScript/admin_order-edits_{id}_request/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders/get.js b/docs/api/admin/code_samples/JavaScript/admin_orders/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders/get.js rename to docs/api/admin/code_samples/JavaScript/admin_orders/get.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_archive/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_archive/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_archive/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_archive/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_capture/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_capture/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_capture/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_capture/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order_{id}_claims/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order_{id}_claims/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order_{id}_claims_{claim_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order_{id}_claims_{claim_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_shipments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_shipments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_complete/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_complete/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_complete/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_complete/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillment/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_fulfillment/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillment/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_fulfillment/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_refund/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_refund/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_refund/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_refund/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_reservations/get.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_reservations/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_reservations/get.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_reservations/get.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_return/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_return/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_return/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_return/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_shipment/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_shipment/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_shipment/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_shipment/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_shipping-methods/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_shipping-methods/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_shipping-methods/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_shipping-methods/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order_{id}_swaps/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order_{id}_swaps/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_process-payment/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_process-payment/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_shipments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/post.js rename to docs/api/admin/code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_shipments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/post.js b/docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}_authorize/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/post.js rename to docs/api/admin/code_samples/JavaScript/admin_payment-collections_{id}_authorize/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_payments_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payments_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_payments_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/post.js b/docs/api/admin/code_samples/JavaScript/admin_payments_{id}_capture/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payments_{id}_capture/post.js rename to docs/api/admin/code_samples/JavaScript/admin_payments_{id}_capture/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/post.js b/docs/api/admin/code_samples/JavaScript/admin_payments_{id}_refund/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payments_{id}_refund/post.js rename to docs/api/admin/code_samples/JavaScript/admin_payments_{id}_refund/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists/get.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists/get.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists/get.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists/post.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists/post.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_products/get.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_products/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_products/get.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_products/get.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/delete.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_products_{product_id}_prices/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_products_{product_id}_prices/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/delete.js b/docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_variants_{variant_id}_prices/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_price-lists_{id}_variants_{variant_id}_prices/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories/get.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories/get.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories/get.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories/post.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories/post.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories/post.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/product-tags/get.js b/docs/api/admin/code_samples/JavaScript/admin_product-tags/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-tags/get.js rename to docs/api/admin/code_samples/JavaScript/admin_product-tags/get.js diff --git a/docs/api/admin/code_samples/JavaScript/product-types/get.js b/docs/api/admin/code_samples/JavaScript/admin_product-types/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-types/get.js rename to docs/api/admin/code_samples/JavaScript/admin_product-types/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products/get.js b/docs/api/admin/code_samples/JavaScript/admin_products/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products/get.js rename to docs/api/admin/code_samples/JavaScript/admin_products/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products/post.js b/docs/api/admin/code_samples/JavaScript/admin_products/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_tag-usage/get.js b/docs/api/admin/code_samples/JavaScript/admin_products_tag-usage/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_tag-usage/get.js rename to docs/api/admin/code_samples/JavaScript/admin_products_tag-usage/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products_types/get.js b/docs/api/admin/code_samples/JavaScript/admin_products_types/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_types/get.js rename to docs/api/admin/code_samples/JavaScript/admin_products_types/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_metadata/post.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_metadata/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_metadata/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_metadata/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_options/post.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_options/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_options/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_options/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_variants/post.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_variants/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_variants/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_variants/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-key_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-key_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/get.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys/get.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys/get.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/post.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys/post.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/post.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_revoke/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/post.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_revoke/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/get.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/get.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels/get.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions/get.js b/docs/api/admin/code_samples/JavaScript/admin_regions/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions/get.js rename to docs/api/admin/code_samples/JavaScript/admin_regions/get.js diff --git a/docs/api/admin/code_samples/JavaScript/regions/post.js b/docs/api/admin/code_samples/JavaScript/admin_regions/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions/post.js rename to docs/api/admin/code_samples/JavaScript/admin_regions/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_countries/post.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_countries/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_countries/post.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_countries/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_countries_{country_code}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_countries_{country_code}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_countries_{country_code}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_countries_{country_code}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-options/get.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_fulfillment-options/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-options/get.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_fulfillment-options/get.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers/post.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_fulfillment-providers/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers/post.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_fulfillment-providers/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_fulfillment-providers_{provider_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_fulfillment-providers_{provider_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers/post.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_payment-providers/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers/post.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_payment-providers/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_regions_{id}_payment-providers_{provider_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_regions_{id}_payment-providers_{provider_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations/post.js b/docs/api/admin/code_samples/JavaScript/admin_reservations/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations/post.js rename to docs/api/admin/code_samples/JavaScript/admin_reservations/post.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons/get.js b/docs/api/admin/code_samples/JavaScript/admin_return-reasons/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons/get.js rename to docs/api/admin/code_samples/JavaScript/admin_return-reasons/get.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons/post.js b/docs/api/admin/code_samples/JavaScript/admin_return-reasons/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons/post.js rename to docs/api/admin/code_samples/JavaScript/admin_return-reasons/post.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_return-reasons_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_return-reasons_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_return-reasons_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_return-reasons_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_return-reasons_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_return-reasons_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/returns/get.js b/docs/api/admin/code_samples/JavaScript/admin_returns/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/returns/get.js rename to docs/api/admin/code_samples/JavaScript/admin_returns/get.js diff --git a/docs/api/admin/code_samples/JavaScript/returns_{id}_cancel/post.js b/docs/api/admin/code_samples/JavaScript/admin_returns_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/returns_{id}_cancel/post.js rename to docs/api/admin/code_samples/JavaScript/admin_returns_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/post.js b/docs/api/admin/code_samples/JavaScript/admin_returns_{id}_receive/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/returns_{id}_receive/post.js rename to docs/api/admin/code_samples/JavaScript/admin_returns_{id}_receive/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels/get.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels/get.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels/get.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels/post.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels/post.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_products_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_products_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_products_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_products_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/delete.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/post.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/post.js rename to docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options/get.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-options/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options/get.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-options/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options/post.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-options/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options/post.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-options/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-options_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-options_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-options_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-options_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-options_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-options_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles/get.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-profiles/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles/get.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-profiles/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles/post.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-profiles/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles/post.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-profiles/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations/get.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations/get.js rename to docs/api/admin/code_samples/JavaScript/admin_stock-locations/get.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations/post.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations/post.js rename to docs/api/admin/code_samples/JavaScript/admin_stock-locations/post.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/store/get.js b/docs/api/admin/code_samples/JavaScript/admin_store/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store/get.js rename to docs/api/admin/code_samples/JavaScript/admin_store/get.js diff --git a/docs/api/admin/code_samples/JavaScript/store/post.js b/docs/api/admin/code_samples/JavaScript/admin_store/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store/post.js rename to docs/api/admin/code_samples/JavaScript/admin_store/post.js diff --git a/docs/api/admin/code_samples/JavaScript/store_currencies_{code}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_store_currencies_{code}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_currencies_{code}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_store_currencies_{code}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/store_currencies_{code}/post.js b/docs/api/admin/code_samples/JavaScript/admin_store_currencies_{code}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_currencies_{code}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_store_currencies_{code}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/store_payment-providers/get.js b/docs/api/admin/code_samples/JavaScript/admin_store_payment-providers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_payment-providers/get.js rename to docs/api/admin/code_samples/JavaScript/admin_store_payment-providers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/store_tax-providers/get.js b/docs/api/admin/code_samples/JavaScript/admin_store_tax-providers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_tax-providers/get.js rename to docs/api/admin/code_samples/JavaScript/admin_store_tax-providers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/swaps/get.js b/docs/api/admin/code_samples/JavaScript/admin_swaps/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/swaps/get.js rename to docs/api/admin/code_samples/JavaScript/admin_swaps/get.js diff --git a/docs/api/admin/code_samples/JavaScript/swaps_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_swaps_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/swaps_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_swaps_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates/get.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates/get.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates/get.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates/post.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates/post.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_product-types_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_product-types_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_product-types_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_product-types_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_products_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_products_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_products_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_products_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_shipping-options_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_shipping-options_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_shipping-options_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/post.js rename to docs/api/admin/code_samples/JavaScript/admin_tax-rates_{id}_shipping-options_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads/delete.js b/docs/api/admin/code_samples/JavaScript/admin_uploads/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_uploads/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads/post.js b/docs/api/admin/code_samples/JavaScript/admin_uploads/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads/post.js rename to docs/api/admin/code_samples/JavaScript/admin_uploads/post.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads_download-url/post.js b/docs/api/admin/code_samples/JavaScript/admin_uploads_download-url/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads_download-url/post.js rename to docs/api/admin/code_samples/JavaScript/admin_uploads_download-url/post.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads_protected/post.js b/docs/api/admin/code_samples/JavaScript/admin_uploads_protected/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads_protected/post.js rename to docs/api/admin/code_samples/JavaScript/admin_uploads_protected/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users/get.js b/docs/api/admin/code_samples/JavaScript/admin_users/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users/get.js rename to docs/api/admin/code_samples/JavaScript/admin_users/get.js diff --git a/docs/api/admin/code_samples/JavaScript/users/post.js b/docs/api/admin/code_samples/JavaScript/admin_users/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users/post.js rename to docs/api/admin/code_samples/JavaScript/admin_users/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users_password-token/post.js b/docs/api/admin/code_samples/JavaScript/admin_users_password-token/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_password-token/post.js rename to docs/api/admin/code_samples/JavaScript/admin_users_password-token/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users_reset-password/post.js b/docs/api/admin/code_samples/JavaScript/admin_users_reset-password/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_reset-password/post.js rename to docs/api/admin/code_samples/JavaScript/admin_users_reset-password/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_users_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_{id}/delete.js rename to docs/api/admin/code_samples/JavaScript/admin_users_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/users_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_users_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_{id}/get.js rename to docs/api/admin/code_samples/JavaScript/admin_users_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/users_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_users_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_{id}/post.js rename to docs/api/admin/code_samples/JavaScript/admin_users_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/variants/get.js b/docs/api/admin/code_samples/JavaScript/admin_variants/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/variants/get.js rename to docs/api/admin/code_samples/JavaScript/admin_variants/get.js diff --git a/docs/api/admin/code_samples/JavaScript/admin_variants_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_variants_{id}/get.js new file mode 100644 index 0000000000..dac4466183 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/admin_variants_{id}/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.variants.retrieve(product_id) +.then(({ product }) => { + console.log(product.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/variants_{id}_inventory/get.js b/docs/api/admin/code_samples/JavaScript/admin_variants_{id}_inventory/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/variants_{id}_inventory/get.js rename to docs/api/admin/code_samples/JavaScript/admin_variants_{id}_inventory/get.js diff --git a/docs/api/admin/code_samples/Shell/apps/get.sh b/docs/api/admin/code_samples/Shell/admin_apps/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/apps/get.sh rename to docs/api/admin/code_samples/Shell/admin_apps/get.sh diff --git a/docs/api/admin/code_samples/Shell/apps_authorizations/post.sh b/docs/api/admin/code_samples/Shell/admin_apps_authorizations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/apps_authorizations/post.sh rename to docs/api/admin/code_samples/Shell/admin_apps_authorizations/post.sh diff --git a/docs/api/admin/code_samples/Shell/auth/delete.sh b/docs/api/admin/code_samples/Shell/admin_auth/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/auth/delete.sh rename to docs/api/admin/code_samples/Shell/admin_auth/delete.sh diff --git a/docs/api/admin/code_samples/Shell/auth/get.sh b/docs/api/admin/code_samples/Shell/admin_auth/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/auth/get.sh rename to docs/api/admin/code_samples/Shell/admin_auth/get.sh diff --git a/docs/api/admin/code_samples/Shell/auth/post.sh b/docs/api/admin/code_samples/Shell/admin_auth/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/auth/post.sh rename to docs/api/admin/code_samples/Shell/admin_auth/post.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs/get.sh b/docs/api/admin/code_samples/Shell/admin_batch-jobs/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs/get.sh rename to docs/api/admin/code_samples/Shell/admin_batch-jobs/get.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs/post.sh b/docs/api/admin/code_samples/Shell/admin_batch-jobs/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs/post.sh rename to docs/api/admin/code_samples/Shell/admin_batch-jobs/post.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_batch-jobs_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_batch-jobs_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs_{id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_batch-jobs_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs_{id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_batch-jobs_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs_{id}_confirm/post.sh b/docs/api/admin/code_samples/Shell/admin_batch-jobs_{id}_confirm/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs_{id}_confirm/post.sh rename to docs/api/admin/code_samples/Shell/admin_batch-jobs_{id}_confirm/post.sh diff --git a/docs/api/admin/code_samples/Shell/collections/get.sh b/docs/api/admin/code_samples/Shell/admin_collections/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections/get.sh rename to docs/api/admin/code_samples/Shell/admin_collections/get.sh diff --git a/docs/api/admin/code_samples/Shell/collections/post.sh b/docs/api/admin/code_samples/Shell/admin_collections/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections/post.sh rename to docs/api/admin/code_samples/Shell/admin_collections/post.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_collections_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_collections_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_collections_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_collections_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_collections_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_collections_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}_products_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_collections_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}_products_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_collections_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}_products_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_collections_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}_products_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_collections_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/currencies/get.sh b/docs/api/admin/code_samples/Shell/admin_currencies/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/currencies/get.sh rename to docs/api/admin/code_samples/Shell/admin_currencies/get.sh diff --git a/docs/api/admin/code_samples/Shell/currencies_{code}/post.sh b/docs/api/admin/code_samples/Shell/admin_currencies_{code}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/currencies_{code}/post.sh rename to docs/api/admin/code_samples/Shell/admin_currencies_{code}/post.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups/get.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups/get.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups/get.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups/post.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups/post.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups/post.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers/get.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups_{id}_customers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}_customers/get.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups_{id}_customers/get.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups_{id}_customers_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups_{id}_customers_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_customer-groups_{id}_customers_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_customer-groups_{id}_customers_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/customers/get.sh b/docs/api/admin/code_samples/Shell/admin_customers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers/get.sh rename to docs/api/admin/code_samples/Shell/admin_customers/get.sh diff --git a/docs/api/admin/code_samples/Shell/customers/post.sh b/docs/api/admin/code_samples/Shell/admin_customers/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers/post.sh rename to docs/api/admin/code_samples/Shell/admin_customers/post.sh diff --git a/docs/api/admin/code_samples/Shell/customers_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_customers_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_customers_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/customers_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_customers_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_customers_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts/get.sh b/docs/api/admin/code_samples/Shell/admin_discounts/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts/get.sh rename to docs/api/admin/code_samples/Shell/admin_discounts/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_code_{code}/get.sh b/docs/api/admin/code_samples/Shell/admin_discounts_code_{code}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_code_{code}/get.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_code_{code}/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/get.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}_dynamic-codes/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}_dynamic-codes/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes_{code}/delete.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}_dynamic-codes_{code}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes_{code}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}_dynamic-codes_{code}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}_regions_{region_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}_regions_{region_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_discounts_{id}_regions_{region_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_discounts_{id}_regions_{region_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders/get.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders/get.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders/get.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders/post.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders/post.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items/post.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_line-items/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items/post.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_line-items/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_pay/post.sh b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_pay/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_pay/post.sh rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}_pay/post.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards/get.sh b/docs/api/admin/code_samples/Shell/admin_gift-cards/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards/get.sh rename to docs/api/admin/code_samples/Shell/admin_gift-cards/get.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards/post.sh b/docs/api/admin/code_samples/Shell/admin_gift-cards/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards/post.sh rename to docs/api/admin/code_samples/Shell/admin_gift-cards/post.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_gift-cards_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_gift-cards_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_gift-cards_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_gift-cards_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_gift-cards_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_gift-cards_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items/get.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items/get.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items/get.sh diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh new file mode 100644 index 0000000000..ec74487c85 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh @@ -0,0 +1,7 @@ +curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "variant_id": "variant_123", + "sku": "sku-123", +}' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/get.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/get.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/post.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/post.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/invites/get.sh b/docs/api/admin/code_samples/Shell/admin_invites/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites/get.sh rename to docs/api/admin/code_samples/Shell/admin_invites/get.sh diff --git a/docs/api/admin/code_samples/Shell/invites/post.sh b/docs/api/admin/code_samples/Shell/admin_invites/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites/post.sh rename to docs/api/admin/code_samples/Shell/admin_invites/post.sh diff --git a/docs/api/admin/code_samples/Shell/invites_accept/post.sh b/docs/api/admin/code_samples/Shell/admin_invites_accept/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites_accept/post.sh rename to docs/api/admin/code_samples/Shell/admin_invites_accept/post.sh diff --git a/docs/api/admin/code_samples/Shell/invites_{invite_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_invites_{invite_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites_{invite_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_invites_{invite_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/invites_{invite_id}_resend/post.sh b/docs/api/admin/code_samples/Shell/admin_invites_{invite_id}_resend/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites_{invite_id}_resend/post.sh rename to docs/api/admin/code_samples/Shell/admin_invites_{invite_id}_resend/post.sh diff --git a/docs/api/admin/code_samples/Shell/notes/get.sh b/docs/api/admin/code_samples/Shell/admin_notes/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes/get.sh rename to docs/api/admin/code_samples/Shell/admin_notes/get.sh diff --git a/docs/api/admin/code_samples/Shell/notes/post.sh b/docs/api/admin/code_samples/Shell/admin_notes/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes/post.sh rename to docs/api/admin/code_samples/Shell/admin_notes/post.sh diff --git a/docs/api/admin/code_samples/Shell/notes_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_notes_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_notes_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/notes_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_notes_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_notes_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/notes_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_notes_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_notes_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/notifications/get.sh b/docs/api/admin/code_samples/Shell/admin_notifications/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notifications/get.sh rename to docs/api/admin/code_samples/Shell/admin_notifications/get.sh diff --git a/docs/api/admin/code_samples/Shell/notifications_{id}_resend/post.sh b/docs/api/admin/code_samples/Shell/admin_notifications_{id}_resend/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notifications_{id}_resend/post.sh rename to docs/api/admin/code_samples/Shell/admin_notifications_{id}_resend/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits/get.sh b/docs/api/admin/code_samples/Shell/admin_order-edits/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits/get.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits/get.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_changes_{change_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_changes_{change_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_changes_{change_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_changes_{change_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_confirm/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_confirm/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_items/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_items/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_items/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_items/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_items_{item_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_items_{item_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_items_{item_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_items_{item_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_request/post.sh b/docs/api/admin/code_samples/Shell/admin_order-edits_{id}_request/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_request/post.sh rename to docs/api/admin/code_samples/Shell/admin_order-edits_{id}_request/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders/get.sh b/docs/api/admin/code_samples/Shell/admin_orders/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders/get.sh rename to docs/api/admin/code_samples/Shell/admin_orders/get.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_archive/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_archive/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_archive/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_archive/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_capture/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_capture/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_capture/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_capture/post.sh diff --git a/docs/api/admin/code_samples/Shell/order_{id}_claims/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_claims/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order_{id}_claims/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_claims/post.sh diff --git a/docs/api/admin/code_samples/Shell/order_{id}_claims_{claim_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order_{id}_claims_{claim_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_shipments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_claims_{claim_id}_shipments/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_complete/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_complete/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_complete/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_complete/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_fulfillment/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_fulfillment/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_fulfillment/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_fulfillment/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_refund/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_refund/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_refund/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_refund/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_reservations/get.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_reservations/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_reservations/get.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_reservations/get.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_return/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_return/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_return/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_return/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_shipment/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_shipment/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_shipment/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_shipment/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_shipping-methods/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_shipping-methods/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_shipping-methods/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_shipping-methods/post.sh diff --git a/docs/api/admin/code_samples/Shell/order_{id}_swaps/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order_{id}_swaps/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_process-payment/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_process-payment/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_shipments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/post.sh rename to docs/api/admin/code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_shipments/post.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_payment-collections_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_payment-collections_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_payment-collections_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_payment-collections_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_payment-collections_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_payment-collections_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/post.sh b/docs/api/admin/code_samples/Shell/admin_payment-collections_{id}_authorize/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/post.sh rename to docs/api/admin/code_samples/Shell/admin_payment-collections_{id}_authorize/post.sh diff --git a/docs/api/admin/code_samples/Shell/payments_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_payments_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payments_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_payments_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_capture/post.sh b/docs/api/admin/code_samples/Shell/admin_payments_{id}_capture/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payments_{id}_capture/post.sh rename to docs/api/admin/code_samples/Shell/admin_payments_{id}_capture/post.sh diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_refund/post.sh b/docs/api/admin/code_samples/Shell/admin_payments_{id}_refund/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payments_{id}_refund/post.sh rename to docs/api/admin/code_samples/Shell/admin_payments_{id}_refund/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists/get.sh b/docs/api/admin/code_samples/Shell/admin_price-lists/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists/get.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists/get.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists/post.sh b/docs/api/admin/code_samples/Shell/admin_price-lists/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists/post.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}_prices_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}_prices_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}_prices_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}_prices_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_products/get.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}_products/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_products/get.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}_products/get.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_products_{product_id}_prices/delete.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}_products_{product_id}_prices/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_products_{product_id}_prices/delete.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}_products_{product_id}_prices/delete.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/delete.sh b/docs/api/admin/code_samples/Shell/admin_price-lists_{id}_variants_{variant_id}_prices/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/delete.sh rename to docs/api/admin/code_samples/Shell/admin_price-lists_{id}_variants_{variant_id}_prices/delete.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories/get.sh b/docs/api/admin/code_samples/Shell/admin_product-categories/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories/get.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories/get.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories/post.sh b/docs/api/admin/code_samples/Shell/admin_product-categories/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories/post.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories/post.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/product-tags/get.sh b/docs/api/admin/code_samples/Shell/admin_product-tags/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-tags/get.sh rename to docs/api/admin/code_samples/Shell/admin_product-tags/get.sh diff --git a/docs/api/admin/code_samples/Shell/product-types/get.sh b/docs/api/admin/code_samples/Shell/admin_product-types/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-types/get.sh rename to docs/api/admin/code_samples/Shell/admin_product-types/get.sh diff --git a/docs/api/admin/code_samples/Shell/products/get.sh b/docs/api/admin/code_samples/Shell/admin_products/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products/get.sh rename to docs/api/admin/code_samples/Shell/admin_products/get.sh diff --git a/docs/api/admin/code_samples/Shell/products/post.sh b/docs/api/admin/code_samples/Shell/admin_products/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products/post.sh rename to docs/api/admin/code_samples/Shell/admin_products/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_tag-usage/get.sh b/docs/api/admin/code_samples/Shell/admin_products_tag-usage/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_tag-usage/get.sh rename to docs/api/admin/code_samples/Shell/admin_products_tag-usage/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_types/get.sh b/docs/api/admin/code_samples/Shell/admin_products_types/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_types/get.sh rename to docs/api/admin/code_samples/Shell/admin_products_types/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_metadata/post.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_metadata/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_metadata/post.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_metadata/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_options/post.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_options/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_options/post.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_options/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_options_{option_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_options_{option_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_options_{option_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_options_{option_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants/get.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_variants/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants/get.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_variants/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants/post.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_variants/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants/post.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_variants/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_variants_{variant_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_variants_{variant_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/post.sh b/docs/api/admin/code_samples/Shell/admin_products_{id}_variants_{variant_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_products_{id}_variants_{variant_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-key_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-key_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-key_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/get.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys/get.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys/get.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/post.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys/post.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/post.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_revoke/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/post.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_revoke/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/get.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/get.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels/get.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions/get.sh b/docs/api/admin/code_samples/Shell/admin_regions/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions/get.sh rename to docs/api/admin/code_samples/Shell/admin_regions/get.sh diff --git a/docs/api/admin/code_samples/Shell/regions/post.sh b/docs/api/admin/code_samples/Shell/admin_regions/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions/post.sh rename to docs/api/admin/code_samples/Shell/admin_regions/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_countries/post.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_countries/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_countries/post.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_countries/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_countries_{country_code}/delete.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_countries_{country_code}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_countries_{country_code}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_countries_{country_code}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-options/get.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_fulfillment-options/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-options/get.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_fulfillment-options/get.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers/post.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_fulfillment-providers/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers/post.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_fulfillment-providers/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_fulfillment-providers_{provider_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_fulfillment-providers_{provider_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_payment-providers/post.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_payment-providers/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_payment-providers/post.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_payment-providers/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_payment-providers_{provider_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_regions_{id}_payment-providers_{provider_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_payment-providers_{provider_id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_regions_{id}_payment-providers_{provider_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/reservations/get.sh b/docs/api/admin/code_samples/Shell/admin_reservations/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations/get.sh rename to docs/api/admin/code_samples/Shell/admin_reservations/get.sh diff --git a/docs/api/admin/code_samples/Shell/reservations/post.sh b/docs/api/admin/code_samples/Shell/admin_reservations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations/post.sh rename to docs/api/admin/code_samples/Shell/admin_reservations/post.sh diff --git a/docs/api/admin/code_samples/Shell/reservations_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_reservations_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_reservations_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/reservations_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_reservations_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_reservations_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/reservations_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_reservations_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_reservations_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons/get.sh b/docs/api/admin/code_samples/Shell/admin_return-reasons/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons/get.sh rename to docs/api/admin/code_samples/Shell/admin_return-reasons/get.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons/post.sh b/docs/api/admin/code_samples/Shell/admin_return-reasons/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons/post.sh rename to docs/api/admin/code_samples/Shell/admin_return-reasons/post.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_return-reasons_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_return-reasons_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_return-reasons_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_return-reasons_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_return-reasons_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_return-reasons_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/returns/get.sh b/docs/api/admin/code_samples/Shell/admin_returns/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/returns/get.sh rename to docs/api/admin/code_samples/Shell/admin_returns/get.sh diff --git a/docs/api/admin/code_samples/Shell/returns_{id}_cancel/post.sh b/docs/api/admin/code_samples/Shell/admin_returns_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/returns_{id}_cancel/post.sh rename to docs/api/admin/code_samples/Shell/admin_returns_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/returns_{id}_receive/post.sh b/docs/api/admin/code_samples/Shell/admin_returns_{id}_receive/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/returns_{id}_receive/post.sh rename to docs/api/admin/code_samples/Shell/admin_returns_{id}_receive/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels/get.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels/get.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels/get.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels/post.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels/post.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/delete.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/delete.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/post.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/post.sh rename to docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options/get.sh b/docs/api/admin/code_samples/Shell/admin_shipping-options/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options/get.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-options/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options/post.sh b/docs/api/admin/code_samples/Shell/admin_shipping-options/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options/post.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-options/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_shipping-options_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-options_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_shipping-options_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-options_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_shipping-options_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-options_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles/get.sh b/docs/api/admin/code_samples/Shell/admin_shipping-profiles/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles/get.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-profiles/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles/post.sh b/docs/api/admin/code_samples/Shell/admin_shipping-profiles/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles/post.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-profiles/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_shipping-profiles_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-profiles_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_shipping-profiles_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-profiles_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_shipping-profiles_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_shipping-profiles_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations/get.sh b/docs/api/admin/code_samples/Shell/admin_stock-locations/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations/get.sh rename to docs/api/admin/code_samples/Shell/admin_stock-locations/get.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations/post.sh b/docs/api/admin/code_samples/Shell/admin_stock-locations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations/post.sh rename to docs/api/admin/code_samples/Shell/admin_stock-locations/post.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/store/get.sh b/docs/api/admin/code_samples/Shell/admin_store/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store/get.sh rename to docs/api/admin/code_samples/Shell/admin_store/get.sh diff --git a/docs/api/admin/code_samples/Shell/store/post.sh b/docs/api/admin/code_samples/Shell/admin_store/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store/post.sh rename to docs/api/admin/code_samples/Shell/admin_store/post.sh diff --git a/docs/api/admin/code_samples/Shell/store_currencies_{code}/delete.sh b/docs/api/admin/code_samples/Shell/admin_store_currencies_{code}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_currencies_{code}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_store_currencies_{code}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/store_currencies_{code}/post.sh b/docs/api/admin/code_samples/Shell/admin_store_currencies_{code}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_currencies_{code}/post.sh rename to docs/api/admin/code_samples/Shell/admin_store_currencies_{code}/post.sh diff --git a/docs/api/admin/code_samples/Shell/store_payment-providers/get.sh b/docs/api/admin/code_samples/Shell/admin_store_payment-providers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_payment-providers/get.sh rename to docs/api/admin/code_samples/Shell/admin_store_payment-providers/get.sh diff --git a/docs/api/admin/code_samples/Shell/store_tax-providers/get.sh b/docs/api/admin/code_samples/Shell/admin_store_tax-providers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_tax-providers/get.sh rename to docs/api/admin/code_samples/Shell/admin_store_tax-providers/get.sh diff --git a/docs/api/admin/code_samples/Shell/swaps/get.sh b/docs/api/admin/code_samples/Shell/admin_swaps/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/swaps/get.sh rename to docs/api/admin/code_samples/Shell/admin_swaps/get.sh diff --git a/docs/api/admin/code_samples/Shell/swaps_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_swaps_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/swaps_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_swaps_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates/get.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates/get.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates/get.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates/post.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates/post.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_product-types_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_product-types_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_product-types_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_product-types_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/delete.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_shipping-options_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/delete.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_shipping-options_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_shipping-options_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/post.sh rename to docs/api/admin/code_samples/Shell/admin_tax-rates_{id}_shipping-options_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/uploads/delete.sh b/docs/api/admin/code_samples/Shell/admin_uploads/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads/delete.sh rename to docs/api/admin/code_samples/Shell/admin_uploads/delete.sh diff --git a/docs/api/admin/code_samples/Shell/uploads/post.sh b/docs/api/admin/code_samples/Shell/admin_uploads/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads/post.sh rename to docs/api/admin/code_samples/Shell/admin_uploads/post.sh diff --git a/docs/api/admin/code_samples/Shell/uploads_download-url/post.sh b/docs/api/admin/code_samples/Shell/admin_uploads_download-url/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads_download-url/post.sh rename to docs/api/admin/code_samples/Shell/admin_uploads_download-url/post.sh diff --git a/docs/api/admin/code_samples/Shell/uploads_protected/post.sh b/docs/api/admin/code_samples/Shell/admin_uploads_protected/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads_protected/post.sh rename to docs/api/admin/code_samples/Shell/admin_uploads_protected/post.sh diff --git a/docs/api/admin/code_samples/Shell/users/get.sh b/docs/api/admin/code_samples/Shell/admin_users/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users/get.sh rename to docs/api/admin/code_samples/Shell/admin_users/get.sh diff --git a/docs/api/admin/code_samples/Shell/users/post.sh b/docs/api/admin/code_samples/Shell/admin_users/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users/post.sh rename to docs/api/admin/code_samples/Shell/admin_users/post.sh diff --git a/docs/api/admin/code_samples/Shell/users_password-token/post.sh b/docs/api/admin/code_samples/Shell/admin_users_password-token/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_password-token/post.sh rename to docs/api/admin/code_samples/Shell/admin_users_password-token/post.sh diff --git a/docs/api/admin/code_samples/Shell/users_reset-password/post.sh b/docs/api/admin/code_samples/Shell/admin_users_reset-password/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_reset-password/post.sh rename to docs/api/admin/code_samples/Shell/admin_users_reset-password/post.sh diff --git a/docs/api/admin/code_samples/Shell/users_{id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_users_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_{id}/delete.sh rename to docs/api/admin/code_samples/Shell/admin_users_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/users_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_users_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_{id}/get.sh rename to docs/api/admin/code_samples/Shell/admin_users_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/users_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_users_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_{id}/post.sh rename to docs/api/admin/code_samples/Shell/admin_users_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/variants/get.sh b/docs/api/admin/code_samples/Shell/admin_variants/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/variants/get.sh rename to docs/api/admin/code_samples/Shell/admin_variants/get.sh diff --git a/docs/api/admin/code_samples/Shell/admin_variants_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_variants_{id}/get.sh new file mode 100644 index 0000000000..940e778c5c --- /dev/null +++ b/docs/api/admin/code_samples/Shell/admin_variants_{id}/get.sh @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/variants/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/variants_{id}_inventory/get.sh b/docs/api/admin/code_samples/Shell/admin_variants_{id}_inventory/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/variants_{id}_inventory/get.sh rename to docs/api/admin/code_samples/Shell/admin_variants_{id}_inventory/get.sh diff --git a/docs/api/admin/components/schemas/AddressCreatePayload.yaml b/docs/api/admin/components/schemas/AddressCreatePayload.yaml new file mode 100644 index 0000000000..1094c0f176 --- /dev/null +++ b/docs/api/admin/components/schemas/AddressCreatePayload.yaml @@ -0,0 +1,57 @@ +type: object +description: Address fields used when creating an address. +required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code +properties: + first_name: + description: First name + type: string + example: Arno + last_name: + description: Last name + type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: + description: Address line 1 + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + type: string + example: Suite 369 + city: + description: City + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + description: Province + type: string + example: Kentucky + postal_code: + description: Postal Code + type: string + example: 72093 + metadata: + type: object + example: + car: white + description: An optional key-value map with additional details diff --git a/docs/api/admin/components/schemas/AddressFields.yaml b/docs/api/admin/components/schemas/AddressPayload.yaml similarity index 94% rename from docs/api/admin/components/schemas/AddressFields.yaml rename to docs/api/admin/components/schemas/AddressPayload.yaml index 6e4c4d6358..89fa9ff576 100644 --- a/docs/api/admin/components/schemas/AddressFields.yaml +++ b/docs/api/admin/components/schemas/AddressPayload.yaml @@ -1,53 +1,50 @@ -title: Address Fields -description: Address fields used when creating/updating an address. type: object +description: Address fields used when creating/updating an address. properties: - company: - type: string - description: Company name - example: Acme first_name: - type: string description: First name + type: string example: Arno last_name: - type: string description: Last name - example: Willms - address_1: type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: description: Address line 1 + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + type: string example: Suite 369 city: - type: string description: City + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + type: string externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. example: st province: - type: string description: Province + type: string example: Kentucky postal_code: - type: string description: Postal Code - example: 72093 - phone: type: string - description: Phone Number - example: 16128234334802 + example: 72093 metadata: type: object - description: An optional key-value map with additional details example: car: white + description: An optional key-value map with additional details diff --git a/docs/api/admin/components/schemas/AdminAppsListRes.yaml b/docs/api/admin/components/schemas/AdminAppsListRes.yaml index a9759828fe..f145982e38 100644 --- a/docs/api/admin/components/schemas/AdminAppsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminAppsListRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - apps properties: apps: type: array diff --git a/docs/api/admin/components/schemas/AdminAppsRes.yaml b/docs/api/admin/components/schemas/AdminAppsRes.yaml index 2212cbec78..9ccc85746f 100644 --- a/docs/api/admin/components/schemas/AdminAppsRes.yaml +++ b/docs/api/admin/components/schemas/AdminAppsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - apps properties: apps: $ref: ./OAuth.yaml diff --git a/docs/api/admin/components/schemas/AdminAuthRes.yaml b/docs/api/admin/components/schemas/AdminAuthRes.yaml index 34a02f7ad2..1b473f3131 100644 --- a/docs/api/admin/components/schemas/AdminAuthRes.yaml +++ b/docs/api/admin/components/schemas/AdminAuthRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - user properties: user: $ref: ./User.yaml diff --git a/docs/api/admin/components/schemas/AdminBatchJobListRes.yaml b/docs/api/admin/components/schemas/AdminBatchJobListRes.yaml index c947b772d2..81194ab56b 100644 --- a/docs/api/admin/components/schemas/AdminBatchJobListRes.yaml +++ b/docs/api/admin/components/schemas/AdminBatchJobListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - batch_jobs + - count + - offset + - limit properties: batch_jobs: type: array diff --git a/docs/api/admin/components/schemas/AdminBatchJobRes.yaml b/docs/api/admin/components/schemas/AdminBatchJobRes.yaml index 1d742c861a..5148d7f665 100644 --- a/docs/api/admin/components/schemas/AdminBatchJobRes.yaml +++ b/docs/api/admin/components/schemas/AdminBatchJobRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - batch_job properties: batch_job: $ref: ./BatchJob.yaml diff --git a/docs/api/admin/components/schemas/AdminCollectionsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminCollectionsDeleteRes.yaml index 45db8c312b..d739f50061 100644 --- a/docs/api/admin/components/schemas/AdminCollectionsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminCollectionsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminCollectionsListRes.yaml b/docs/api/admin/components/schemas/AdminCollectionsListRes.yaml index 252256786c..32822ecdb6 100644 --- a/docs/api/admin/components/schemas/AdminCollectionsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminCollectionsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - collections + - count + - offset + - limit properties: collections: type: array diff --git a/docs/api/admin/components/schemas/AdminCollectionsRes.yaml b/docs/api/admin/components/schemas/AdminCollectionsRes.yaml index 7802152206..c5b626189c 100644 --- a/docs/api/admin/components/schemas/AdminCollectionsRes.yaml +++ b/docs/api/admin/components/schemas/AdminCollectionsRes.yaml @@ -1,4 +1,10 @@ type: object +x-expanded-relations: + field: collection + relations: + - products +required: + - collection properties: collection: $ref: ./ProductCollection.yaml diff --git a/docs/api/admin/components/schemas/AdminCurrenciesListRes.yaml b/docs/api/admin/components/schemas/AdminCurrenciesListRes.yaml index 7d8433a050..f4dd293fef 100644 --- a/docs/api/admin/components/schemas/AdminCurrenciesListRes.yaml +++ b/docs/api/admin/components/schemas/AdminCurrenciesListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - currencies + - count + - offset + - limit properties: currencies: type: array diff --git a/docs/api/admin/components/schemas/AdminCurrenciesRes.yaml b/docs/api/admin/components/schemas/AdminCurrenciesRes.yaml index 905466e5ee..0dce871edf 100644 --- a/docs/api/admin/components/schemas/AdminCurrenciesRes.yaml +++ b/docs/api/admin/components/schemas/AdminCurrenciesRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - currency properties: currency: $ref: ./Currency.yaml diff --git a/docs/api/admin/components/schemas/AdminCustomerGroupsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminCustomerGroupsDeleteRes.yaml index f6ede8bd97..c71ac29d49 100644 --- a/docs/api/admin/components/schemas/AdminCustomerGroupsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminCustomerGroupsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminCustomerGroupsListRes.yaml b/docs/api/admin/components/schemas/AdminCustomerGroupsListRes.yaml index 9a57b834f2..13c74d86ac 100644 --- a/docs/api/admin/components/schemas/AdminCustomerGroupsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminCustomerGroupsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - customer_groups + - count + - offset + - limit properties: customer_groups: type: array diff --git a/docs/api/admin/components/schemas/AdminCustomerGroupsRes.yaml b/docs/api/admin/components/schemas/AdminCustomerGroupsRes.yaml index a0f75ac4ad..2e324ec54c 100644 --- a/docs/api/admin/components/schemas/AdminCustomerGroupsRes.yaml +++ b/docs/api/admin/components/schemas/AdminCustomerGroupsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - customer_group properties: customer_group: $ref: ./CustomerGroup.yaml diff --git a/docs/api/admin/components/schemas/AdminCustomersListRes.yaml b/docs/api/admin/components/schemas/AdminCustomersListRes.yaml index d5703c84a5..531a0a23d7 100644 --- a/docs/api/admin/components/schemas/AdminCustomersListRes.yaml +++ b/docs/api/admin/components/schemas/AdminCustomersListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - customers + - count + - offset + - limit properties: customers: type: array diff --git a/docs/api/admin/components/schemas/AdminCustomersRes.yaml b/docs/api/admin/components/schemas/AdminCustomersRes.yaml index ffb6903bf2..7bcdcd6186 100644 --- a/docs/api/admin/components/schemas/AdminCustomersRes.yaml +++ b/docs/api/admin/components/schemas/AdminCustomersRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: customer + relations: + - orders + - shipping_addresses +required: + - customer properties: customer: $ref: ./Customer.yaml diff --git a/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionRes.yaml b/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionRes.yaml index 338dd63277..c42a782b07 100644 --- a/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionRes.yaml +++ b/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - removed_products properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteShippingProfileRes.yaml b/docs/api/admin/components/schemas/AdminDeleteShippingProfileRes.yaml index c558057588..05b2d2c485 100644 --- a/docs/api/admin/components/schemas/AdminDeleteShippingProfileRes.yaml +++ b/docs/api/admin/components/schemas/AdminDeleteShippingProfileRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteUploadsRes.yaml b/docs/api/admin/components/schemas/AdminDeleteUploadsRes.yaml index 1d146d2088..36c221a599 100644 --- a/docs/api/admin/components/schemas/AdminDeleteUploadsRes.yaml +++ b/docs/api/admin/components/schemas/AdminDeleteUploadsRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteUserRes.yaml b/docs/api/admin/components/schemas/AdminDeleteUserRes.yaml index b078d453de..1a0f1e1b90 100644 --- a/docs/api/admin/components/schemas/AdminDeleteUserRes.yaml +++ b/docs/api/admin/components/schemas/AdminDeleteUserRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDiscountConditionsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminDiscountConditionsDeleteRes.yaml index b84ac7be83..189b8eb0cc 100644 --- a/docs/api/admin/components/schemas/AdminDiscountConditionsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminDiscountConditionsDeleteRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - id + - object + - deleted + - discount properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDiscountConditionsRes.yaml b/docs/api/admin/components/schemas/AdminDiscountConditionsRes.yaml index 94ddc8b610..0e77e73048 100644 --- a/docs/api/admin/components/schemas/AdminDiscountConditionsRes.yaml +++ b/docs/api/admin/components/schemas/AdminDiscountConditionsRes.yaml @@ -1,4 +1,10 @@ type: object +x-expanded-relations: + field: discount_condition + relations: + - discount_rule +required: + - discount_condition properties: discount_condition: $ref: ./DiscountCondition.yaml diff --git a/docs/api/admin/components/schemas/AdminDiscountsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminDiscountsDeleteRes.yaml index 54add9e208..d0b4c29790 100644 --- a/docs/api/admin/components/schemas/AdminDiscountsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminDiscountsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDiscountsListRes.yaml b/docs/api/admin/components/schemas/AdminDiscountsListRes.yaml index 5b69366794..981118a2c0 100644 --- a/docs/api/admin/components/schemas/AdminDiscountsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminDiscountsListRes.yaml @@ -1,4 +1,16 @@ type: object +x-expanded-relations: + field: discounts + relations: + - parent_discount + - regions + - rule + - rule.conditions +required: + - discounts + - count + - offset + - limit properties: discounts: type: array diff --git a/docs/api/admin/components/schemas/AdminDiscountsRes.yaml b/docs/api/admin/components/schemas/AdminDiscountsRes.yaml index f8d9aa73a1..b52dcf4784 100644 --- a/docs/api/admin/components/schemas/AdminDiscountsRes.yaml +++ b/docs/api/admin/components/schemas/AdminDiscountsRes.yaml @@ -1,4 +1,16 @@ type: object +x-expanded-relations: + field: discount + relations: + - parent_discount + - regions + - rule + - rule.conditions + eager: + - regions.fulfillment_providers + - regions.payment_providers +required: + - discount properties: discount: $ref: ./Discount.yaml diff --git a/docs/api/admin/components/schemas/AdminDraftOrdersDeleteRes.yaml b/docs/api/admin/components/schemas/AdminDraftOrdersDeleteRes.yaml index 219d3c80e3..542765dfed 100644 --- a/docs/api/admin/components/schemas/AdminDraftOrdersDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminDraftOrdersDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminDraftOrdersListRes.yaml b/docs/api/admin/components/schemas/AdminDraftOrdersListRes.yaml index f85c0a6b3e..134f839693 100644 --- a/docs/api/admin/components/schemas/AdminDraftOrdersListRes.yaml +++ b/docs/api/admin/components/schemas/AdminDraftOrdersListRes.yaml @@ -1,4 +1,16 @@ type: object +x-expanded-relations: + field: draft_orders + relations: + - order + - cart + - cart.items + - cart.items.adjustments +required: + - draft_orders + - count + - offset + - limit properties: draft_orders: type: array diff --git a/docs/api/admin/components/schemas/AdminDraftOrdersRes.yaml b/docs/api/admin/components/schemas/AdminDraftOrdersRes.yaml index e8723460e4..5a495eeb2d 100644 --- a/docs/api/admin/components/schemas/AdminDraftOrdersRes.yaml +++ b/docs/api/admin/components/schemas/AdminDraftOrdersRes.yaml @@ -1,4 +1,64 @@ type: object +x-expanded-relations: + field: draft_order + relations: + - order + - cart + - cart.items + - cart.items.adjustments + - cart.billing_address + - cart.customer + - cart.discounts + - cart.discounts.rule + - cart.items + - cart.items.adjustments + - cart.payment + - cart.payment_sessions + - cart.region + - cart.region.payment_providers + - cart.shipping_address + - cart.shipping_methods + - cart.shipping_methods.shipping_option + eager: + - cart.region.fulfillment_providers + - cart.region.payment_providers + - cart.shipping_methods.shipping_option + implicit: + - cart.discounts + - cart.discounts.rule + - cart.gift_cards + - cart.items + - cart.items.adjustments + - cart.items.tax_lines + - cart.items.variant + - cart.items.variant.product + - cart.region + - cart.region.tax_rates + - cart.shipping_address + - cart.shipping_methods + - cart.shipping_methods.tax_lines + totals: + - cart.discount_total + - cart.gift_card_tax_total + - cart.gift_card_total + - cart.item_tax_total + - cart.refundable_amount + - cart.refunded_total + - cart.shipping_tax_total + - cart.shipping_total + - cart.subtotal + - cart.tax_total + - cart.total + - cart.items.discount_total + - cart.items.gift_card_total + - cart.items.original_tax_total + - cart.items.original_total + - cart.items.refundable + - cart.items.subtotal + - cart.items.tax_total + - cart.items.total +required: + - draft_order properties: draft_order: $ref: ./DraftOrder.yaml diff --git a/docs/api/admin/components/schemas/AdminExtendedStoresRes.yaml b/docs/api/admin/components/schemas/AdminExtendedStoresRes.yaml new file mode 100644 index 0000000000..8b3e0894c2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminExtendedStoresRes.yaml @@ -0,0 +1,11 @@ +type: object +x-expanded-relations: + field: store + relations: + - currencies + - default_currency +required: + - store +properties: + store: + $ref: ./ExtendedStoreDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes.yaml b/docs/api/admin/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes.yaml index 531eb3895d..e26d1debe0 100644 --- a/docs/api/admin/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes.yaml +++ b/docs/api/admin/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes.yaml @@ -1,17 +1,24 @@ type: object +required: + - fulfillment_options properties: fulfillment_options: type: array items: type: object + required: + - provider_id + - options properties: provider_id: - type: string description: ID of the fulfillment provider + type: string options: - type: array description: fulfillment provider options - example: - - id: manual-fulfillment - - id: manual-fulfillment-return - is_return: true + type: array + items: + type: object + example: + - id: manual-fulfillment + - id: manual-fulfillment-return + is_return: true diff --git a/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml b/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml index 165c290b71..f055f06413 100644 --- a/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml +++ b/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml @@ -1,21 +1,5 @@ type: object properties: - id: - description: the id of the variant - type: string - inventory: - description: the stock location address ID - type: string - sales_channel_availability: + variant: type: object - description: An optional key-value map with additional details - properties: - channel_name: - description: Sales channel name - type: string - channel_id: - description: Sales channel id - type: string - available_quantity: - description: Available quantity in sales channel - type: number + $ref: ./VariantInventory.yaml diff --git a/docs/api/admin/components/schemas/AdminGiftCardsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminGiftCardsDeleteRes.yaml index 1076a0f9c7..6f113a2ed4 100644 --- a/docs/api/admin/components/schemas/AdminGiftCardsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminGiftCardsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminGiftCardsListRes.yaml b/docs/api/admin/components/schemas/AdminGiftCardsListRes.yaml index d48cb2935e..1df6eafb6f 100644 --- a/docs/api/admin/components/schemas/AdminGiftCardsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminGiftCardsListRes.yaml @@ -1,4 +1,17 @@ type: object +x-expanded-relations: + field: gift_cards + relations: + - order + - region + eager: + - region.fulfillment_providers + - region.payment_providers +required: + - gift_cards + - count + - offset + - limit properties: gift_cards: type: array diff --git a/docs/api/admin/components/schemas/AdminGiftCardsRes.yaml b/docs/api/admin/components/schemas/AdminGiftCardsRes.yaml index d72a7917c2..90e4caf50d 100644 --- a/docs/api/admin/components/schemas/AdminGiftCardsRes.yaml +++ b/docs/api/admin/components/schemas/AdminGiftCardsRes.yaml @@ -1,4 +1,14 @@ type: object +x-expanded-relations: + field: gift_card + relations: + - order + - region + eager: + - region.fulfillment_providers + - region.payment_providers +required: + - gift_card properties: gift_card: $ref: ./GiftCard.yaml diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml index e31b73414b..a0ded8e57a 100644 --- a/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml index eec764d4b2..4f87fd6629 100644 --- a/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - inventory_items + - count + - offset + - limit properties: inventory_items: type: array diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml index d46c1b70ba..fc2767763d 100644 --- a/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml +++ b/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - inventory_items + - count + - offset + - limit properties: inventory_items: type: array diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml index 4c0077947d..f275fb9d97 100644 --- a/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml +++ b/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml @@ -1,9 +1,17 @@ type: object +required: + - inventory_item properties: - id: - description: The id of the location - location_levels: - description: List of stock levels at a given location - type: array - items: - $ref: ./InventoryLevelDTO.yaml + inventory_item: + type: object + required: + - id + - location_levels + properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: ./InventoryLevelDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml index 8b0468433e..dacf72e622 100644 --- a/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml +++ b/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - inventory_item properties: inventory_item: $ref: ./InventoryItemDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminInviteDeleteRes.yaml b/docs/api/admin/components/schemas/AdminInviteDeleteRes.yaml index 17dd571381..d0a91ac8b7 100644 --- a/docs/api/admin/components/schemas/AdminInviteDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminInviteDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminListInvitesRes.yaml b/docs/api/admin/components/schemas/AdminListInvitesRes.yaml index 90af041322..264a1b4e90 100644 --- a/docs/api/admin/components/schemas/AdminListInvitesRes.yaml +++ b/docs/api/admin/components/schemas/AdminListInvitesRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - invites properties: invites: type: array diff --git a/docs/api/admin/components/schemas/AdminNotesDeleteRes.yaml b/docs/api/admin/components/schemas/AdminNotesDeleteRes.yaml index a0703d1f98..679ce92ba8 100644 --- a/docs/api/admin/components/schemas/AdminNotesDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminNotesDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminNotesListRes.yaml b/docs/api/admin/components/schemas/AdminNotesListRes.yaml index b44cb9b77d..9721914a0e 100644 --- a/docs/api/admin/components/schemas/AdminNotesListRes.yaml +++ b/docs/api/admin/components/schemas/AdminNotesListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - notes + - count + - offset + - limit properties: notes: type: array diff --git a/docs/api/admin/components/schemas/AdminNotesRes.yaml b/docs/api/admin/components/schemas/AdminNotesRes.yaml index 9c7d25e1b1..1f495bf7c7 100644 --- a/docs/api/admin/components/schemas/AdminNotesRes.yaml +++ b/docs/api/admin/components/schemas/AdminNotesRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - note properties: note: $ref: ./Note.yaml diff --git a/docs/api/admin/components/schemas/AdminNotificationsListRes.yaml b/docs/api/admin/components/schemas/AdminNotificationsListRes.yaml index c5f9c490df..f114beaaf2 100644 --- a/docs/api/admin/components/schemas/AdminNotificationsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminNotificationsListRes.yaml @@ -1,4 +1,10 @@ type: object +x-expanded-relations: + field: notifications + relations: + - resends +required: + - notifications properties: notifications: type: array diff --git a/docs/api/admin/components/schemas/AdminNotificationsRes.yaml b/docs/api/admin/components/schemas/AdminNotificationsRes.yaml index 607f862759..b3b370452f 100644 --- a/docs/api/admin/components/schemas/AdminNotificationsRes.yaml +++ b/docs/api/admin/components/schemas/AdminNotificationsRes.yaml @@ -1,4 +1,10 @@ type: object +x-expanded-relations: + field: notification + relations: + - resends +required: + - notification properties: notification: $ref: ./Notification.yaml diff --git a/docs/api/admin/components/schemas/AdminOrderEditDeleteRes.yaml b/docs/api/admin/components/schemas/AdminOrderEditDeleteRes.yaml index ea94c0111c..2435bc0769 100644 --- a/docs/api/admin/components/schemas/AdminOrderEditDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminOrderEditDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminOrderEditItemChangeDeleteRes.yaml b/docs/api/admin/components/schemas/AdminOrderEditItemChangeDeleteRes.yaml index 4889f74d96..b1d52f5627 100644 --- a/docs/api/admin/components/schemas/AdminOrderEditItemChangeDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminOrderEditItemChangeDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminOrderEditsListRes.yaml b/docs/api/admin/components/schemas/AdminOrderEditsListRes.yaml index 91941a9eff..efa37a0fca 100644 --- a/docs/api/admin/components/schemas/AdminOrderEditsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminOrderEditsListRes.yaml @@ -1,4 +1,44 @@ type: object +x-expanded-relations: + field: order_edits + relations: + - changes + - changes.line_item + - changes.line_item.variant + - changes.original_line_item + - changes.original_line_item.variant + - items + - items.adjustments + - items.tax_lines + - items.variant + - payment_collection + implicit: + - items + - items.tax_lines + - items.adjustments + - items.variant + totals: + - difference_due + - discount_total + - gift_card_tax_total + - gift_card_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total +required: + - order_edits + - count + - offset + - limit properties: order_edits: type: array diff --git a/docs/api/admin/components/schemas/AdminOrderEditsRes.yaml b/docs/api/admin/components/schemas/AdminOrderEditsRes.yaml index d266863926..4f5087710f 100644 --- a/docs/api/admin/components/schemas/AdminOrderEditsRes.yaml +++ b/docs/api/admin/components/schemas/AdminOrderEditsRes.yaml @@ -1,4 +1,41 @@ type: object +x-expanded-relations: + field: order_edit + relations: + - changes + - changes.line_item + - changes.line_item.variant + - changes.original_line_item + - changes.original_line_item.variant + - items + - items.adjustments + - items.tax_lines + - items.variant + - payment_collection + implicit: + - items + - items.tax_lines + - items.adjustments + - items.variant + totals: + - difference_due + - discount_total + - gift_card_tax_total + - gift_card_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total +required: + - order_edit properties: order_edit: $ref: ./OrderEdit.yaml diff --git a/docs/api/admin/components/schemas/AdminOrdersListRes.yaml b/docs/api/admin/components/schemas/AdminOrdersListRes.yaml index 1b4106242e..d9331dd990 100644 --- a/docs/api/admin/components/schemas/AdminOrdersListRes.yaml +++ b/docs/api/admin/components/schemas/AdminOrdersListRes.yaml @@ -1,4 +1,112 @@ type: object +x-expanded-relations: + field: orders + relations: + - billing_address + - claims + - claims.additional_items + - claims.additional_items.variant + - claims.claim_items + - claims.claim_items.images + - claims.claim_items.item + - claims.fulfillments + - claims.fulfillments.tracking_links + - claims.return_order + - claims.return_order.shipping_method + - claims.return_order.shipping_method.tax_lines + - claims.shipping_address + - claims.shipping_methods + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.items + - fulfillments.tracking_links + - gift_card_transactions + - gift_cards + - items + - payments + - refunds + - region + - returns + - returns.items + - returns.items.reason + - returns.shipping_method + - returns.shipping_method.tax_lines + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - region.fulfillment_providers + - region.payment_providers + - returns.items + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total +required: + - orders + - count + - offset + - limit properties: orders: type: array diff --git a/docs/api/admin/components/schemas/AdminOrdersRes.yaml b/docs/api/admin/components/schemas/AdminOrdersRes.yaml index 43b8e917ca..020e86f931 100644 --- a/docs/api/admin/components/schemas/AdminOrdersRes.yaml +++ b/docs/api/admin/components/schemas/AdminOrdersRes.yaml @@ -1,4 +1,109 @@ type: object +x-expanded-relations: + field: order + relations: + - billing_address + - claims + - claims.additional_items + - claims.additional_items.variant + - claims.claim_items + - claims.claim_items.images + - claims.claim_items.item + - claims.fulfillments + - claims.fulfillments.tracking_links + - claims.return_order + - claims.return_order.shipping_method + - claims.return_order.shipping_method.tax_lines + - claims.shipping_address + - claims.shipping_methods + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.items + - fulfillments.tracking_links + - gift_card_transactions + - gift_cards + - items + - payments + - refunds + - region + - returns + - returns.items + - returns.items.reason + - returns.shipping_method + - returns.shipping_method.tax_lines + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - region.fulfillment_providers + - region.payment_providers + - returns.items + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total +required: + - order properties: order: $ref: ./Order.yaml diff --git a/docs/api/admin/components/schemas/AdminPaymentCollectionDeleteRes.yaml b/docs/api/admin/components/schemas/AdminPaymentCollectionDeleteRes.yaml index ccc45be4d7..46401f7f36 100644 --- a/docs/api/admin/components/schemas/AdminPaymentCollectionDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminPaymentCollectionDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminPaymentCollectionsRes.yaml b/docs/api/admin/components/schemas/AdminPaymentCollectionsRes.yaml index a7748cf4f4..6b57258c43 100644 --- a/docs/api/admin/components/schemas/AdminPaymentCollectionsRes.yaml +++ b/docs/api/admin/components/schemas/AdminPaymentCollectionsRes.yaml @@ -1,4 +1,15 @@ type: object +x-expanded-relations: + field: payment_collection + relations: + - payment_sessions + - payments + - region + eager: + - region.fulfillment_providers + - region.payment_providers +required: + - payment_collection properties: payment_collection: $ref: ./PaymentCollection.yaml diff --git a/docs/api/admin/components/schemas/AdminPaymentProvidersList.yaml b/docs/api/admin/components/schemas/AdminPaymentProvidersList.yaml index fc6042e3fe..db6385af46 100644 --- a/docs/api/admin/components/schemas/AdminPaymentProvidersList.yaml +++ b/docs/api/admin/components/schemas/AdminPaymentProvidersList.yaml @@ -1,4 +1,6 @@ type: object +required: + - payment_providers properties: payment_providers: type: array diff --git a/docs/api/admin/components/schemas/AdminPaymentRes.yaml b/docs/api/admin/components/schemas/AdminPaymentRes.yaml index f063721de0..cba9949004 100644 --- a/docs/api/admin/components/schemas/AdminPaymentRes.yaml +++ b/docs/api/admin/components/schemas/AdminPaymentRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - payment properties: payment: $ref: ./Payment.yaml diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.yaml index 43b8e917ca..53497a9af7 100644 --- a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.yaml +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - order properties: order: $ref: ./Order.yaml diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml index 05a6d92efc..29179bd29e 100644 --- a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml @@ -17,12 +17,12 @@ properties: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: ./AddressFields.yaml + - $ref: ./AddressPayload.yaml - type: string shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: ./AddressFields.yaml + - $ref: ./AddressPayload.yaml - type: string discounts: description: An array of Discount codes to add to the Draft Order. diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml index e2f7db512d..f6b12380f5 100644 --- a/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml @@ -17,12 +17,12 @@ properties: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: ./AddressFields.yaml + - $ref: ./AddressPayload.yaml - type: string shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: ./AddressFields.yaml + - $ref: ./AddressPayload.yaml - type: string items: description: The Line Items that have been received. diff --git a/docs/api/admin/components/schemas/AdminPostInventoryItemsReq.yaml b/docs/api/admin/components/schemas/AdminPostInventoryItemsReq.yaml new file mode 100644 index 0000000000..b6abd5adde --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInventoryItemsReq.yaml @@ -0,0 +1,54 @@ +type: object +properties: + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + default: true + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml index 2221e9c16e..70a139b7a5 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml @@ -94,11 +94,10 @@ properties: description: An optional set of key-value pairs to hold additional information. type: object shipping_address: - type: object description: >- An optional shipping address to send the claim to. Defaults to the parent order's shipping address - $ref: ./Address.yaml + $ref: ./AddressPayload.yaml refund_amount: description: The amount to refund the Customer when the Claim type is `refund`. type: integer diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml index 5a7c57fb2d..62d6722f97 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml @@ -5,12 +5,10 @@ properties: type: string billing_address: description: Billing address - anyOf: - - $ref: ./AddressFields.yaml + $ref: ./AddressPayload.yaml shipping_address: description: Shipping address - anyOf: - - $ref: ./AddressFields.yaml + $ref: ./AddressPayload.yaml items: description: The Line Items for the order type: array diff --git a/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryReq.yaml b/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryReq.yaml index f185943b26..58dfccf7b9 100644 --- a/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryReq.yaml @@ -15,3 +15,6 @@ properties: parent_category_id: type: string description: The ID of the parent product category + rank: + type: number + description: The rank of the category in the tree node (starting from 0) diff --git a/docs/api/admin/components/schemas/AdminPostReservationsReq.yaml b/docs/api/admin/components/schemas/AdminPostReservationsReq.yaml index 6428010b23..e08aad2afc 100644 --- a/docs/api/admin/components/schemas/AdminPostReservationsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostReservationsReq.yaml @@ -1,6 +1,21 @@ type: object required: - - reservation + - location_id + - inventory_item_id + - quantity properties: - reservation: - $ref: ./ReservationItemDTO.yaml + line_item_id: + description: The id of the location of the reservation + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPriceListDeleteBatchRes.yaml b/docs/api/admin/components/schemas/AdminPriceListDeleteBatchRes.yaml index a6e7cbc41a..4f128a04d4 100644 --- a/docs/api/admin/components/schemas/AdminPriceListDeleteBatchRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListDeleteBatchRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - ids + - object + - deleted properties: ids: type: array diff --git a/docs/api/admin/components/schemas/AdminPriceListDeleteProductPricesRes.yaml b/docs/api/admin/components/schemas/AdminPriceListDeleteProductPricesRes.yaml index 9e71cf7cf3..23239ef090 100644 --- a/docs/api/admin/components/schemas/AdminPriceListDeleteProductPricesRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListDeleteProductPricesRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - ids + - object + - deleted properties: ids: type: array diff --git a/docs/api/admin/components/schemas/AdminPriceListDeleteRes.yaml b/docs/api/admin/components/schemas/AdminPriceListDeleteRes.yaml index a6727b02e1..0402210313 100644 --- a/docs/api/admin/components/schemas/AdminPriceListDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminPriceListDeleteVariantPricesRes.yaml b/docs/api/admin/components/schemas/AdminPriceListDeleteVariantPricesRes.yaml index 9e71cf7cf3..23239ef090 100644 --- a/docs/api/admin/components/schemas/AdminPriceListDeleteVariantPricesRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListDeleteVariantPricesRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - ids + - object + - deleted properties: ids: type: array diff --git a/docs/api/admin/components/schemas/AdminPriceListRes.yaml b/docs/api/admin/components/schemas/AdminPriceListRes.yaml index c6be0b0caa..53323693f2 100644 --- a/docs/api/admin/components/schemas/AdminPriceListRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: price_list + relations: + - customer_groups + - prices +required: + - price_list properties: price_list: $ref: ./PriceList.yaml diff --git a/docs/api/admin/components/schemas/AdminPriceListsListRes.yaml b/docs/api/admin/components/schemas/AdminPriceListsListRes.yaml index 4da038dd18..e11bd28269 100644 --- a/docs/api/admin/components/schemas/AdminPriceListsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - price_lists + - count + - offset + - limit properties: price_lists: type: array diff --git a/docs/api/admin/components/schemas/AdminPriceListsProductsListRes.yaml b/docs/api/admin/components/schemas/AdminPriceListsProductsListRes.yaml index 57a72f2ef3..9098b75a16 100644 --- a/docs/api/admin/components/schemas/AdminPriceListsProductsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminPriceListsProductsListRes.yaml @@ -1,4 +1,20 @@ type: object +x-expanded-relations: + field: products + relations: + - categories + - collection + - images + - options + - tags + - type + - variants + - variants.options +required: + - products + - count + - offset + - limit properties: products: type: array diff --git a/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml index 16bdada85e..c9acfd91c0 100644 --- a/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminProductCategoriesCategoryRes.yaml b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryRes.yaml index d343bc439f..eaf81a7222 100644 --- a/docs/api/admin/components/schemas/AdminProductCategoriesCategoryRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: product_category + relations: + - category_children + - parent_category +required: + - product_category properties: product_category: $ref: ./ProductCategory.yaml diff --git a/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml b/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml index 0b6a32c916..f053d45d1e 100644 --- a/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml @@ -1,4 +1,14 @@ type: object +x-expanded-relations: + field: product_categories + relations: + - category_children + - parent_category +required: + - product_categories + - count + - offset + - limit properties: product_categories: type: array diff --git a/docs/api/admin/components/schemas/AdminProductTagsListRes.yaml b/docs/api/admin/components/schemas/AdminProductTagsListRes.yaml index 6a5ca82bb8..405eac0731 100644 --- a/docs/api/admin/components/schemas/AdminProductTagsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductTagsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - product_tags + - count + - offset + - limit properties: product_tags: type: array diff --git a/docs/api/admin/components/schemas/AdminProductTypesListRes.yaml b/docs/api/admin/components/schemas/AdminProductTypesListRes.yaml index 4cb021af96..774ce804cc 100644 --- a/docs/api/admin/components/schemas/AdminProductTypesListRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductTypesListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - product_types + - count + - offset + - limit properties: product_types: type: array diff --git a/docs/api/admin/components/schemas/AdminProductsDeleteOptionRes.yaml b/docs/api/admin/components/schemas/AdminProductsDeleteOptionRes.yaml index 30c41d02d7..a30ba74881 100644 --- a/docs/api/admin/components/schemas/AdminProductsDeleteOptionRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsDeleteOptionRes.yaml @@ -1,4 +1,20 @@ type: object +x-expanded-relations: + field: product + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices +required: + - option_id + - object + - deleted + - product properties: option_id: type: string @@ -12,4 +28,4 @@ properties: description: Whether or not the items were deleted. default: true product: - $ref: ./Product.yaml + $ref: ./PricedProduct.yaml diff --git a/docs/api/admin/components/schemas/AdminProductsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminProductsDeleteRes.yaml index 6d537a2698..709cb3aef3 100644 --- a/docs/api/admin/components/schemas/AdminProductsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminProductsDeleteVariantRes.yaml b/docs/api/admin/components/schemas/AdminProductsDeleteVariantRes.yaml index 8ed1c8db64..1d4a1c61ac 100644 --- a/docs/api/admin/components/schemas/AdminProductsDeleteVariantRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsDeleteVariantRes.yaml @@ -1,4 +1,20 @@ type: object +x-expanded-relations: + field: product + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices +required: + - variant_id + - object + - deleted + - product properties: variant_id: type: string @@ -12,4 +28,4 @@ properties: description: Whether or not the items were deleted. default: true product: - $ref: ./Product.yaml + $ref: ./PricedProduct.yaml diff --git a/docs/api/admin/components/schemas/AdminProductsListRes.yaml b/docs/api/admin/components/schemas/AdminProductsListRes.yaml index ab35016359..a85acdc2bb 100644 --- a/docs/api/admin/components/schemas/AdminProductsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsListRes.yaml @@ -1,11 +1,25 @@ type: object +x-expanded-relations: + field: products + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices +required: + - products + - count + - offset + - limit properties: products: type: array items: - oneOf: - - $ref: ./Product.yaml - - $ref: ./PricedProduct.yaml + $ref: ./PricedProduct.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml b/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml index 12e422431b..36dee5cf26 100644 --- a/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml @@ -1,9 +1,15 @@ type: object +required: + - tags properties: tags: type: array items: type: object + required: + - id + - usage_count + - value properties: id: description: The ID of the tag. diff --git a/docs/api/admin/components/schemas/AdminProductsListTypesRes.yaml b/docs/api/admin/components/schemas/AdminProductsListTypesRes.yaml index 617453260a..b9ce359c5d 100644 --- a/docs/api/admin/components/schemas/AdminProductsListTypesRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsListTypesRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - types properties: types: type: array diff --git a/docs/api/admin/components/schemas/AdminProductsListVariantsRes.yaml b/docs/api/admin/components/schemas/AdminProductsListVariantsRes.yaml index 0dd6293790..9f9bd329d9 100644 --- a/docs/api/admin/components/schemas/AdminProductsListVariantsRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsListVariantsRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - variants + - count + - offset + - limit properties: variants: type: array diff --git a/docs/api/admin/components/schemas/AdminProductsRes.yaml b/docs/api/admin/components/schemas/AdminProductsRes.yaml index 3fbf46b05b..0845416c01 100644 --- a/docs/api/admin/components/schemas/AdminProductsRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsRes.yaml @@ -1,4 +1,17 @@ type: object +x-expanded-relations: + field: product + relations: + - collection + - images + - options + - tags + - type + - variants + - variants.options + - variants.prices +required: + - product properties: product: - $ref: ./Product.yaml + $ref: ./PricedProduct.yaml diff --git a/docs/api/admin/components/schemas/AdminPublishableApiKeyDeleteRes.yaml b/docs/api/admin/components/schemas/AdminPublishableApiKeyDeleteRes.yaml index 47a0ea7e2a..0714ea5231 100644 --- a/docs/api/admin/components/schemas/AdminPublishableApiKeyDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminPublishableApiKeyDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminPublishableApiKeysListRes.yaml b/docs/api/admin/components/schemas/AdminPublishableApiKeysListRes.yaml index 085a3d7190..59f953bb88 100644 --- a/docs/api/admin/components/schemas/AdminPublishableApiKeysListRes.yaml +++ b/docs/api/admin/components/schemas/AdminPublishableApiKeysListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - publishable_api_keys + - count + - offset + - limit properties: publishable_api_keys: type: array diff --git a/docs/api/admin/components/schemas/AdminPublishableApiKeysListSalesChannelsRes.yaml b/docs/api/admin/components/schemas/AdminPublishableApiKeysListSalesChannelsRes.yaml index 0a9db99c8f..35678ee35a 100644 --- a/docs/api/admin/components/schemas/AdminPublishableApiKeysListSalesChannelsRes.yaml +++ b/docs/api/admin/components/schemas/AdminPublishableApiKeysListSalesChannelsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - sales_channels properties: sales_channels: type: array diff --git a/docs/api/admin/components/schemas/AdminPublishableApiKeysRes.yaml b/docs/api/admin/components/schemas/AdminPublishableApiKeysRes.yaml index c17f539d38..c994cac4db 100644 --- a/docs/api/admin/components/schemas/AdminPublishableApiKeysRes.yaml +++ b/docs/api/admin/components/schemas/AdminPublishableApiKeysRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - publishable_api_key properties: publishable_api_key: $ref: ./PublishableApiKey.yaml diff --git a/docs/api/admin/components/schemas/AdminRefundRes.yaml b/docs/api/admin/components/schemas/AdminRefundRes.yaml index cd621f5f05..9f159d8a63 100644 --- a/docs/api/admin/components/schemas/AdminRefundRes.yaml +++ b/docs/api/admin/components/schemas/AdminRefundRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - refund properties: refund: $ref: ./Refund.yaml diff --git a/docs/api/admin/components/schemas/AdminRegionsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminRegionsDeleteRes.yaml index a75d2e5a48..890f5414e2 100644 --- a/docs/api/admin/components/schemas/AdminRegionsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminRegionsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminRegionsListRes.yaml b/docs/api/admin/components/schemas/AdminRegionsListRes.yaml index efebb681c2..c5ff015351 100644 --- a/docs/api/admin/components/schemas/AdminRegionsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminRegionsListRes.yaml @@ -1,4 +1,18 @@ type: object +x-expanded-relations: + field: regions + relations: + - countries + - fulfillment_providers + - payment_providers + eager: + - fulfillment_providers + - payment_providers +required: + - regions + - count + - offset + - limit properties: regions: type: array diff --git a/docs/api/admin/components/schemas/AdminRegionsRes.yaml b/docs/api/admin/components/schemas/AdminRegionsRes.yaml index b4080ea096..4e52f90323 100644 --- a/docs/api/admin/components/schemas/AdminRegionsRes.yaml +++ b/docs/api/admin/components/schemas/AdminRegionsRes.yaml @@ -1,4 +1,15 @@ type: object +x-expanded-relations: + field: region + relations: + - countries + - fulfillment_providers + - payment_providers + eager: + - fulfillment_providers + - payment_providers +required: + - region properties: region: $ref: ./Region.yaml diff --git a/docs/api/admin/components/schemas/AdminReservationsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminReservationsDeleteRes.yaml new file mode 100644 index 0000000000..7b10d15ecd --- /dev/null +++ b/docs/api/admin/components/schemas/AdminReservationsDeleteRes.yaml @@ -0,0 +1,17 @@ +type: object +required: + - id + - object + - deleted +properties: + id: + type: string + description: The ID of the deleted Reservation. + object: + type: string + description: The type of the object that was deleted. + default: reservation + deleted: + type: boolean + description: Whether or not the Reservation was deleted. + default: true diff --git a/docs/api/admin/components/schemas/AdminGetReservationReservationsReq.yaml b/docs/api/admin/components/schemas/AdminReservationsListRes.yaml similarity index 85% rename from docs/api/admin/components/schemas/AdminGetReservationReservationsReq.yaml rename to docs/api/admin/components/schemas/AdminReservationsListRes.yaml index 0523d76e88..7f2e521066 100644 --- a/docs/api/admin/components/schemas/AdminGetReservationReservationsReq.yaml +++ b/docs/api/admin/components/schemas/AdminReservationsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - reservations + - count + - offset + - limit properties: reservations: type: array diff --git a/docs/api/admin/components/schemas/AdminReservationsRes.yaml b/docs/api/admin/components/schemas/AdminReservationsRes.yaml new file mode 100644 index 0000000000..6428010b23 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminReservationsRes.yaml @@ -0,0 +1,6 @@ +type: object +required: + - reservation +properties: + reservation: + $ref: ./ReservationItemDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminReturnReasonsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminReturnReasonsDeleteRes.yaml index 02bf4792f0..424e73dbab 100644 --- a/docs/api/admin/components/schemas/AdminReturnReasonsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminReturnReasonsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminReturnReasonsListRes.yaml b/docs/api/admin/components/schemas/AdminReturnReasonsListRes.yaml index c52e27f424..0f212752fc 100644 --- a/docs/api/admin/components/schemas/AdminReturnReasonsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminReturnReasonsListRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: return_reasons + relations: + - parent_return_reason + - return_reason_children +required: + - return_reasons properties: return_reasons: type: array diff --git a/docs/api/admin/components/schemas/AdminReturnReasonsRes.yaml b/docs/api/admin/components/schemas/AdminReturnReasonsRes.yaml index ac6e4045bd..f5a1907b17 100644 --- a/docs/api/admin/components/schemas/AdminReturnReasonsRes.yaml +++ b/docs/api/admin/components/schemas/AdminReturnReasonsRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: return_reason + relations: + - parent_return_reason + - return_reason_children +required: + - return_reason properties: return_reason: $ref: ./ReturnReason.yaml diff --git a/docs/api/admin/components/schemas/AdminReturnsCancelRes.yaml b/docs/api/admin/components/schemas/AdminReturnsCancelRes.yaml index 43b8e917ca..ab11b5eeb5 100644 --- a/docs/api/admin/components/schemas/AdminReturnsCancelRes.yaml +++ b/docs/api/admin/components/schemas/AdminReturnsCancelRes.yaml @@ -1,4 +1,54 @@ type: object +x-expanded-relations: + field: order + relations: + - billing_address + - claims + - claims.additional_items + - claims.additional_items.variant + - claims.claim_items + - claims.claim_items.images + - claims.claim_items.item + - claims.fulfillments + - claims.fulfillments.tracking_links + - claims.return_order + - claims.return_order.shipping_method + - claims.return_order.shipping_method.tax_lines + - claims.shipping_address + - claims.shipping_methods + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.items + - fulfillments.tracking_links + - gift_card_transactions + - gift_cards + - items + - payments + - refunds + - region + - returns + - returns.items + - returns.items.reason + - returns.shipping_method + - returns.shipping_method.tax_lines + - shipping_address + - shipping_methods + - swaps + - swaps.additional_items + - swaps.additional_items.variant + - swaps.fulfillments + - swaps.fulfillments.tracking_links + - swaps.payment + - swaps.return_order + - swaps.return_order.shipping_method + - swaps.return_order.shipping_method.tax_lines + - swaps.shipping_address + - swaps.shipping_methods + - swaps.shipping_methods.tax_lines +required: + - order properties: order: $ref: ./Order.yaml diff --git a/docs/api/admin/components/schemas/AdminReturnsListRes.yaml b/docs/api/admin/components/schemas/AdminReturnsListRes.yaml index b86af7dc39..57b6eb15e5 100644 --- a/docs/api/admin/components/schemas/AdminReturnsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminReturnsListRes.yaml @@ -1,4 +1,14 @@ type: object +x-expanded-relation: + field: returns + relations: + - order + - swap +required: + - returns + - count + - offset + - limit properties: returns: type: array diff --git a/docs/api/admin/components/schemas/AdminReturnsRes.yaml b/docs/api/admin/components/schemas/AdminReturnsRes.yaml index 3291cf0e08..f8000dec9b 100644 --- a/docs/api/admin/components/schemas/AdminReturnsRes.yaml +++ b/docs/api/admin/components/schemas/AdminReturnsRes.yaml @@ -1,4 +1,10 @@ type: object +x-expanded-relation: + field: return + relations: + - swap +required: + - return properties: return: $ref: ./Return.yaml diff --git a/docs/api/admin/components/schemas/AdminSalesChannelsDeleteLocationRes.yaml b/docs/api/admin/components/schemas/AdminSalesChannelsDeleteLocationRes.yaml index 8cc317294e..6d12dbbcec 100644 --- a/docs/api/admin/components/schemas/AdminSalesChannelsDeleteLocationRes.yaml +++ b/docs/api/admin/components/schemas/AdminSalesChannelsDeleteLocationRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminSalesChannelsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminSalesChannelsDeleteRes.yaml index 15a97ff689..c953197736 100644 --- a/docs/api/admin/components/schemas/AdminSalesChannelsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminSalesChannelsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminSalesChannelsListRes.yaml b/docs/api/admin/components/schemas/AdminSalesChannelsListRes.yaml index 7409f4ba18..ed590a4737 100644 --- a/docs/api/admin/components/schemas/AdminSalesChannelsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminSalesChannelsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - sales_channels + - count + - offset + - limit properties: sales_channels: type: array diff --git a/docs/api/admin/components/schemas/AdminSalesChannelsRes.yaml b/docs/api/admin/components/schemas/AdminSalesChannelsRes.yaml index 09c58c3022..fda0b10e76 100644 --- a/docs/api/admin/components/schemas/AdminSalesChannelsRes.yaml +++ b/docs/api/admin/components/schemas/AdminSalesChannelsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - sales_channel properties: sales_channel: $ref: ./SalesChannel.yaml diff --git a/docs/api/admin/components/schemas/AdminShippingOptionsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminShippingOptionsDeleteRes.yaml index d8e319611b..e734f894f8 100644 --- a/docs/api/admin/components/schemas/AdminShippingOptionsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminShippingOptionsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminShippingOptionsListRes.yaml b/docs/api/admin/components/schemas/AdminShippingOptionsListRes.yaml index 539446d9e4..7c8ae6f7ad 100644 --- a/docs/api/admin/components/schemas/AdminShippingOptionsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminShippingOptionsListRes.yaml @@ -1,4 +1,18 @@ type: object +x-expanded-relations: + field: shipping_options + relations: + - profile + - region + - requirements + eager: + - region.fulfillment_providers + - region.payment_providers +required: + - shipping_options + - count + - offset + - limit properties: shipping_options: type: array @@ -7,3 +21,9 @@ properties: count: type: integer description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/admin/components/schemas/AdminShippingOptionsRes.yaml b/docs/api/admin/components/schemas/AdminShippingOptionsRes.yaml index ef80497854..4b11048199 100644 --- a/docs/api/admin/components/schemas/AdminShippingOptionsRes.yaml +++ b/docs/api/admin/components/schemas/AdminShippingOptionsRes.yaml @@ -1,4 +1,15 @@ type: object +x-expanded-relations: + field: shipping_option + relations: + - profile + - region + - requirements + eager: + - region.fulfillment_providers + - region.payment_providers +required: + - shipping_option properties: shipping_option: $ref: ./ShippingOption.yaml diff --git a/docs/api/admin/components/schemas/AdminShippingProfilesListRes.yaml b/docs/api/admin/components/schemas/AdminShippingProfilesListRes.yaml index 33cdf0e98f..f0eaa82aac 100644 --- a/docs/api/admin/components/schemas/AdminShippingProfilesListRes.yaml +++ b/docs/api/admin/components/schemas/AdminShippingProfilesListRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - shipping_profiles properties: shipping_profiles: type: array diff --git a/docs/api/admin/components/schemas/AdminShippingProfilesRes.yaml b/docs/api/admin/components/schemas/AdminShippingProfilesRes.yaml index 392791dfa1..9e56d94a2f 100644 --- a/docs/api/admin/components/schemas/AdminShippingProfilesRes.yaml +++ b/docs/api/admin/components/schemas/AdminShippingProfilesRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: shipping_profile + relations: + - products + - shipping_options +required: + - shipping_profile properties: shipping_profile: $ref: ./ShippingProfile.yaml diff --git a/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml index fd827299df..6e5d17e47b 100644 --- a/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminStockLocationsListRes.yaml b/docs/api/admin/components/schemas/AdminStockLocationsListRes.yaml index 47df8c820a..aa29877a00 100644 --- a/docs/api/admin/components/schemas/AdminStockLocationsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminStockLocationsListRes.yaml @@ -1,9 +1,14 @@ type: object +required: + - stock_locations + - count + - offset + - limit properties: stock_locations: type: array items: - $ref: ./StockLocationDTO.yaml + $ref: ./StockLocationExpandedDTO.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/components/schemas/AdminStockLocationsRes.yaml b/docs/api/admin/components/schemas/AdminStockLocationsRes.yaml index adef34b4ff..c382f72085 100644 --- a/docs/api/admin/components/schemas/AdminStockLocationsRes.yaml +++ b/docs/api/admin/components/schemas/AdminStockLocationsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - stock_location properties: stock_location: - $ref: ./StockLocationDTO.yaml + $ref: ./StockLocationExpandedDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminStoresRes.yaml b/docs/api/admin/components/schemas/AdminStoresRes.yaml index 2c92fa1211..a02586a781 100644 --- a/docs/api/admin/components/schemas/AdminStoresRes.yaml +++ b/docs/api/admin/components/schemas/AdminStoresRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - store properties: store: $ref: ./Store.yaml diff --git a/docs/api/admin/components/schemas/AdminSwapsListRes.yaml b/docs/api/admin/components/schemas/AdminSwapsListRes.yaml index 94b2b1f075..da2e08617d 100644 --- a/docs/api/admin/components/schemas/AdminSwapsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminSwapsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - swaps + - count + - offset + - limit properties: swaps: type: array diff --git a/docs/api/admin/components/schemas/AdminSwapsRes.yaml b/docs/api/admin/components/schemas/AdminSwapsRes.yaml index 3eaa21eadf..d95facc390 100644 --- a/docs/api/admin/components/schemas/AdminSwapsRes.yaml +++ b/docs/api/admin/components/schemas/AdminSwapsRes.yaml @@ -1,4 +1,24 @@ type: object +x-expanded-relations: + field: swap + relations: + - additional_items + - additional_items.adjustments + - cart + - cart.items + - cart.items.adjustments + - cart.items.variant + - fulfillments + - order + - payment + - return_order + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - shipping_methods.shipping_option +required: + - swap properties: swap: $ref: ./Swap.yaml diff --git a/docs/api/admin/components/schemas/AdminTaxProvidersList.yaml b/docs/api/admin/components/schemas/AdminTaxProvidersList.yaml index 5f97c98d61..e924eba7a3 100644 --- a/docs/api/admin/components/schemas/AdminTaxProvidersList.yaml +++ b/docs/api/admin/components/schemas/AdminTaxProvidersList.yaml @@ -1,4 +1,6 @@ type: object +required: + - tax_providers properties: tax_providers: type: array diff --git a/docs/api/admin/components/schemas/AdminTaxRatesDeleteRes.yaml b/docs/api/admin/components/schemas/AdminTaxRatesDeleteRes.yaml index d3b6b06558..df9ba39e4d 100644 --- a/docs/api/admin/components/schemas/AdminTaxRatesDeleteRes.yaml +++ b/docs/api/admin/components/schemas/AdminTaxRatesDeleteRes.yaml @@ -1,4 +1,8 @@ type: object +required: + - id + - object + - deleted properties: id: type: string diff --git a/docs/api/admin/components/schemas/AdminTaxRatesListRes.yaml b/docs/api/admin/components/schemas/AdminTaxRatesListRes.yaml index e782e3d2c1..5de6ad890f 100644 --- a/docs/api/admin/components/schemas/AdminTaxRatesListRes.yaml +++ b/docs/api/admin/components/schemas/AdminTaxRatesListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - tax_rates + - count + - offset + - limit properties: tax_rates: type: array diff --git a/docs/api/admin/components/schemas/AdminTaxRatesRes.yaml b/docs/api/admin/components/schemas/AdminTaxRatesRes.yaml index 5d4c877a0e..bcd007f2d4 100644 --- a/docs/api/admin/components/schemas/AdminTaxRatesRes.yaml +++ b/docs/api/admin/components/schemas/AdminTaxRatesRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - tax_rate properties: tax_rate: $ref: ./TaxRate.yaml diff --git a/docs/api/admin/components/schemas/AdminUploadsDownloadUrlRes.yaml b/docs/api/admin/components/schemas/AdminUploadsDownloadUrlRes.yaml index 478368e8c5..52469d3c61 100644 --- a/docs/api/admin/components/schemas/AdminUploadsDownloadUrlRes.yaml +++ b/docs/api/admin/components/schemas/AdminUploadsDownloadUrlRes.yaml @@ -1,5 +1,7 @@ type: object +required: + - download_url properties: download_url: - type: string description: The Download URL of the file + type: string diff --git a/docs/api/admin/components/schemas/AdminUploadsRes.yaml b/docs/api/admin/components/schemas/AdminUploadsRes.yaml index 8c248af21c..ed8154b0bc 100644 --- a/docs/api/admin/components/schemas/AdminUploadsRes.yaml +++ b/docs/api/admin/components/schemas/AdminUploadsRes.yaml @@ -1,11 +1,15 @@ type: object +required: + - uploads properties: uploads: type: array items: type: object + required: + - url properties: url: - type: string description: The URL of the uploaded file. + type: string format: uri diff --git a/docs/api/admin/components/schemas/AdminUserRes.yaml b/docs/api/admin/components/schemas/AdminUserRes.yaml index 34a02f7ad2..1b473f3131 100644 --- a/docs/api/admin/components/schemas/AdminUserRes.yaml +++ b/docs/api/admin/components/schemas/AdminUserRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - user properties: user: $ref: ./User.yaml diff --git a/docs/api/admin/components/schemas/AdminUsersListRes.yaml b/docs/api/admin/components/schemas/AdminUsersListRes.yaml index 4549b76e5b..42af2d23e8 100644 --- a/docs/api/admin/components/schemas/AdminUsersListRes.yaml +++ b/docs/api/admin/components/schemas/AdminUsersListRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - users properties: users: type: array diff --git a/docs/api/admin/components/schemas/AdminVariantsListRes.yaml b/docs/api/admin/components/schemas/AdminVariantsListRes.yaml index 0dd6293790..215adc2240 100644 --- a/docs/api/admin/components/schemas/AdminVariantsListRes.yaml +++ b/docs/api/admin/components/schemas/AdminVariantsListRes.yaml @@ -1,9 +1,20 @@ type: object +x-expanded-relations: + field: variants + relations: + - options + - prices + - product +required: + - variants + - count + - offset + - limit properties: variants: type: array items: - $ref: ./ProductVariant.yaml + $ref: ./PricedVariant.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/components/schemas/AdminVariantsRes.yaml b/docs/api/admin/components/schemas/AdminVariantsRes.yaml new file mode 100644 index 0000000000..81e344ff80 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminVariantsRes.yaml @@ -0,0 +1,12 @@ +type: object +x-expanded-relations: + field: variant + relations: + - options + - prices + - product +required: + - variant +properties: + variant: + $ref: ./PricedVariant.yaml diff --git a/docs/api/admin/components/schemas/Cart.yaml b/docs/api/admin/components/schemas/Cart.yaml index 92c5146ff8..649b1149fd 100644 --- a/docs/api/admin/components/schemas/Cart.yaml +++ b/docs/api/admin/components/schemas/Cart.yaml @@ -174,6 +174,10 @@ properties: type: integer example: 1000 discount_total: + description: The total of discount rounded + type: integer + example: 800 + raw_discount_total: description: The total of discount type: integer example: 800 diff --git a/docs/api/admin/components/schemas/ExtendedStoreDTO.yaml b/docs/api/admin/components/schemas/ExtendedStoreDTO.yaml new file mode 100644 index 0000000000..af6132c641 --- /dev/null +++ b/docs/api/admin/components/schemas/ExtendedStoreDTO.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: ./Store.yaml + - type: object + required: + - payment_providers + - fulfillment_providers + - feature_flags + - modules + properties: + payment_providers: + $ref: ./PaymentProvider.yaml + fulfillment_providers: + $ref: ./FulfillmentProvider.yaml + feature_flags: + $ref: ./FeatureFlagsResponse.yaml + modules: + $ref: ./ModulesResponse.yaml diff --git a/docs/api/admin/components/schemas/FeatureFlagsResponse.yaml b/docs/api/admin/components/schemas/FeatureFlagsResponse.yaml new file mode 100644 index 0000000000..ce55d9ccc4 --- /dev/null +++ b/docs/api/admin/components/schemas/FeatureFlagsResponse.yaml @@ -0,0 +1,13 @@ +type: array +items: + type: object + required: + - key + - value + properties: + key: + description: The key of the feature flag. + type: string + value: + description: The value of the feature flag. + type: boolean diff --git a/docs/api/admin/components/schemas/LineItem.yaml b/docs/api/admin/components/schemas/LineItem.yaml index e809ce5e3c..67b1ee5cd0 100644 --- a/docs/api/admin/components/schemas/LineItem.yaml +++ b/docs/api/admin/components/schemas/LineItem.yaml @@ -199,6 +199,10 @@ properties: type: integer example: 0 discount_total: + description: The total of discount of the line item rounded + type: integer + example: 0 + raw_discount_total: description: The total of discount of the line item type: integer example: 0 diff --git a/docs/api/admin/components/schemas/LineItemAdjustment.yaml b/docs/api/admin/components/schemas/LineItemAdjustment.yaml index fe1b9049e8..5dcc6f496f 100644 --- a/docs/api/admin/components/schemas/LineItemAdjustment.yaml +++ b/docs/api/admin/components/schemas/LineItemAdjustment.yaml @@ -36,7 +36,7 @@ properties: $ref: ./Discount.yaml amount: description: The adjustment amount - type: integer + type: number example: 1000 metadata: description: An optional key-value map with additional details diff --git a/docs/api/admin/components/schemas/ModulesResponse.yaml b/docs/api/admin/components/schemas/ModulesResponse.yaml new file mode 100644 index 0000000000..f90e78d9f9 --- /dev/null +++ b/docs/api/admin/components/schemas/ModulesResponse.yaml @@ -0,0 +1,13 @@ +type: array +items: + type: object + required: + - module + - resolution + properties: + module: + description: The key of the module. + type: string + resolution: + description: The resolution path of the module or false if module is not installed. + type: string diff --git a/docs/api/admin/components/schemas/Order.yaml b/docs/api/admin/components/schemas/Order.yaml index 26d73485be..8406e48d2f 100644 --- a/docs/api/admin/components/schemas/Order.yaml +++ b/docs/api/admin/components/schemas/Order.yaml @@ -267,10 +267,14 @@ properties: type: integer description: The total of shipping example: 1000 - discount_total: + raw_discount_total: description: The total of discount type: integer example: 800 + discount_total: + description: The total of discount rounded + type: integer + example: 800 tax_total: description: The total of tax type: integer diff --git a/docs/api/admin/components/schemas/PricedShippingOption.yaml b/docs/api/admin/components/schemas/PricedShippingOption.yaml new file mode 100644 index 0000000000..a5f479328b --- /dev/null +++ b/docs/api/admin/components/schemas/PricedShippingOption.yaml @@ -0,0 +1,27 @@ +title: Priced Shipping Option +type: object +allOf: + - $ref: ./ShippingOption.yaml + - type: object + properties: + price_incl_tax: + type: number + description: Price including taxes + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + tax_amount: + type: number + description: The taxes applied. diff --git a/docs/api/admin/components/schemas/ProductCategory.yaml b/docs/api/admin/components/schemas/ProductCategory.yaml index 9d15054cd5..3dfe3b8ca6 100644 --- a/docs/api/admin/components/schemas/ProductCategory.yaml +++ b/docs/api/admin/components/schemas/ProductCategory.yaml @@ -5,7 +5,6 @@ type: object required: - category_children - created_at - - deleted_at - handle - id - is_active @@ -44,6 +43,10 @@ properties: type: boolean description: A flag to make product category visible/hidden in the store front default: false + rank: + type: integer + description: An integer that depicts the rank of category in a tree node + default: 0 category_children: description: Available if the relation `category_children` are expanded. type: array @@ -75,8 +78,3 @@ properties: description: The date with timezone at which the resource was updated. type: string format: date-time - deleted_at: - description: The date with timezone at which the resource was deleted. - nullable: true - type: string - format: date-time diff --git a/docs/api/admin/components/schemas/ResponseInventoryItem.yaml b/docs/api/admin/components/schemas/ResponseInventoryItem.yaml new file mode 100644 index 0000000000..279316dfc5 --- /dev/null +++ b/docs/api/admin/components/schemas/ResponseInventoryItem.yaml @@ -0,0 +1,8 @@ +allOf: + - $ref: ./InventoryItemDTO.yaml + - type: object + required: + - available_quantity + properties: + available_quantity: + type: number diff --git a/docs/api/admin/components/schemas/StockLocationExpandedDTO.yaml b/docs/api/admin/components/schemas/StockLocationExpandedDTO.yaml new file mode 100644 index 0000000000..e2d6b28a56 --- /dev/null +++ b/docs/api/admin/components/schemas/StockLocationExpandedDTO.yaml @@ -0,0 +1,6 @@ +allOf: + - $ref: ./StockLocationDTO.yaml + - type: object + properties: + sales_channels: + $ref: ./SalesChannel.yaml diff --git a/docs/api/admin/components/schemas/VariantInventory.yaml b/docs/api/admin/components/schemas/VariantInventory.yaml new file mode 100644 index 0000000000..9b7aebc58c --- /dev/null +++ b/docs/api/admin/components/schemas/VariantInventory.yaml @@ -0,0 +1,21 @@ +type: object +properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + $ref: ./ResponseInventoryItem.yaml + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index 76bd91d37f..344994fa4e 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -414,391 +414,385 @@ tags: description: >- Auth endpoints that allow authorization of admin Users and manages their sessions. - - name: App + - name: Apps description: App endpoints that allow handling apps in Medusa. - - name: Batch Job + - name: Batch Jobs description: Batch Job endpoints that allow handling batch jobs in Medusa. - - name: Claim - description: Claim endpoints that allow handling claims in Medusa. - - name: Collection + - name: Collections description: Collection endpoints that allow handling collections in Medusa. - - name: Customer + - name: Customers description: Customer endpoints that allow handling customers in Medusa. - - name: Customer Group + - name: Customer Groups description: Customer Group endpoints that allow handling customer groups in Medusa. - - name: Discount + - name: Discounts description: Discount endpoints that allow handling discounts in Medusa. - - name: Discount Condition - description: >- - Discount Condition endpoints that allow handling discount conditions in - Medusa. - - name: Draft Order + - name: Draft Orders description: Draft Order endpoints that allow handling draft orders in Medusa. - - name: Gift Card + - name: Gift Cards description: Gift Card endpoints that allow handling gift cards in Medusa. - - name: Invite + - name: Invites description: Invite endpoints that allow handling invites in Medusa. - - name: Note + - name: Notes description: Note endpoints that allow handling notes in Medusa. - - name: Notification + - name: Notifications description: Notification endpoints that allow handling notifications in Medusa. - - name: Order + - name: Orders description: Order endpoints that allow handling orders in Medusa. - - name: Price List + - name: Price Lists description: Price List endpoints that allow handling price lists in Medusa. - - name: Product + - name: Products description: Product endpoints that allow handling products in Medusa. - - name: Product Tag + - name: Product Tags description: Product Tag endpoints that allow handling product tags in Medusa. - - name: Product Type + - name: Product Types description: Product Types endpoints that allow handling product types in Medusa. - - name: Product Variant - description: Product Variant endpoints that allow handling product variants in Medusa. - - name: Region + - name: Regions description: Region endpoints that allow handling regions in Medusa. - - name: Return Reason + - name: Return Reasons description: Return Reason endpoints that allow handling return reasons in Medusa. - - name: Return + - name: Returns description: Return endpoints that allow handling returns in Medusa. - - name: Sales Channel + - name: Sales Channels description: Sales Channel endpoints that allow handling sales channels in Medusa. - - name: Shipping Option + - name: Shipping Options description: Shipping Option endpoints that allow handling shipping options in Medusa. - - name: Shipping Profile + - name: Shipping Profiles description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - name: Store description: Store endpoints that allow handling stores in Medusa. - - name: Swap + - name: Swaps description: Swap endpoints that allow handling swaps in Medusa. - - name: Tax Rate + - name: Tax Rates description: Tax Rate endpoints that allow handling tax rates in Medusa. - - name: Upload + - name: Uploads description: Upload endpoints that allow handling uploads in Medusa. - - name: User + - name: Users description: User endpoints that allow handling users in Medusa. + - name: Variants + description: Product Variant endpoints that allow handling product variants in Medusa. servers: - - url: https://api.medusa-commerce.com/admin + - url: https://api.medusa-commerce.com paths: - /apps/authorizations: - $ref: paths/apps_authorizations.yaml - /apps: - $ref: paths/apps.yaml - /auth: - $ref: paths/auth.yaml - /batch-jobs/{id}/cancel: - $ref: paths/batch-jobs_{id}_cancel.yaml - /batch-jobs/{id}/confirm: - $ref: paths/batch-jobs_{id}_confirm.yaml - /batch-jobs: - $ref: paths/batch-jobs.yaml - /batch-jobs/{id}: - $ref: paths/batch-jobs_{id}.yaml - /collections/{id}/products/batch: - $ref: paths/collections_{id}_products_batch.yaml - /collections: - $ref: paths/collections.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /currencies: - $ref: paths/currencies.yaml - /currencies/{code}: - $ref: paths/currencies_{code}.yaml - /customer-groups/{id}/customers/batch: - $ref: paths/customer-groups_{id}_customers_batch.yaml - /customer-groups: - $ref: paths/customer-groups.yaml - /customer-groups/{id}: - $ref: paths/customer-groups_{id}.yaml - /customer-groups/{id}/customers: - $ref: paths/customer-groups_{id}_customers.yaml - /customers: - $ref: paths/customers.yaml - /customers/{id}: - $ref: paths/customers_{id}.yaml - /discounts/{id}/regions/{region_id}: - $ref: paths/discounts_{id}_regions_{region_id}.yaml - /discounts/{discount_id}/conditions/{condition_id}/batch: - $ref: paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml - /discounts/{discount_id}/conditions: - $ref: paths/discounts_{discount_id}_conditions.yaml - /discounts: - $ref: paths/discounts.yaml - /discounts/{id}/dynamic-codes: - $ref: paths/discounts_{id}_dynamic-codes.yaml - /discounts/{discount_id}/conditions/{condition_id}: - $ref: paths/discounts_{discount_id}_conditions_{condition_id}.yaml - /discounts/{id}: - $ref: paths/discounts_{id}.yaml - /discounts/{id}/dynamic-codes/{code}: - $ref: paths/discounts_{id}_dynamic-codes_{code}.yaml - /discounts/code/{code}: - $ref: paths/discounts_code_{code}.yaml - /draft-orders: - $ref: paths/draft-orders.yaml - /draft-orders/{id}/line-items: - $ref: paths/draft-orders_{id}_line-items.yaml - /draft-orders/{id}: - $ref: paths/draft-orders_{id}.yaml - /draft-orders/{id}/line-items/{line_id}: - $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml - /draft-orders/{id}/pay: - $ref: paths/draft-orders_{id}_pay.yaml + /admin/apps: + $ref: paths/admin_apps.yaml + /admin/apps/authorizations: + $ref: paths/admin_apps_authorizations.yaml + /admin/auth: + $ref: paths/admin_auth.yaml + /admin/batch-jobs: + $ref: paths/admin_batch-jobs.yaml + /admin/batch-jobs/{id}: + $ref: paths/admin_batch-jobs_{id}.yaml + /admin/batch-jobs/{id}/cancel: + $ref: paths/admin_batch-jobs_{id}_cancel.yaml + /admin/batch-jobs/{id}/confirm: + $ref: paths/admin_batch-jobs_{id}_confirm.yaml + /admin/collections: + $ref: paths/admin_collections.yaml + /admin/collections/{id}: + $ref: paths/admin_collections_{id}.yaml + /admin/collections/{id}/products/batch: + $ref: paths/admin_collections_{id}_products_batch.yaml + /admin/currencies: + $ref: paths/admin_currencies.yaml + /admin/currencies/{code}: + $ref: paths/admin_currencies_{code}.yaml + /admin/customer-groups: + $ref: paths/admin_customer-groups.yaml + /admin/customer-groups/{id}: + $ref: paths/admin_customer-groups_{id}.yaml + /admin/customer-groups/{id}/customers: + $ref: paths/admin_customer-groups_{id}_customers.yaml + /admin/customer-groups/{id}/customers/batch: + $ref: paths/admin_customer-groups_{id}_customers_batch.yaml + /admin/customers: + $ref: paths/admin_customers.yaml + /admin/customers/{id}: + $ref: paths/admin_customers_{id}.yaml + /admin/discounts: + $ref: paths/admin_discounts.yaml + /admin/discounts/code/{code}: + $ref: paths/admin_discounts_code_{code}.yaml + /admin/discounts/{discount_id}/conditions: + $ref: paths/admin_discounts_{discount_id}_conditions.yaml + /admin/discounts/{discount_id}/conditions/{condition_id}: + $ref: paths/admin_discounts_{discount_id}_conditions_{condition_id}.yaml + /admin/discounts/{discount_id}/conditions/{condition_id}/batch: + $ref: paths/admin_discounts_{discount_id}_conditions_{condition_id}_batch.yaml + /admin/discounts/{id}: + $ref: paths/admin_discounts_{id}.yaml + /admin/discounts/{id}/dynamic-codes: + $ref: paths/admin_discounts_{id}_dynamic-codes.yaml + /admin/discounts/{id}/dynamic-codes/{code}: + $ref: paths/admin_discounts_{id}_dynamic-codes_{code}.yaml + /admin/discounts/{id}/regions/{region_id}: + $ref: paths/admin_discounts_{id}_regions_{region_id}.yaml + /admin/draft-orders: + $ref: paths/admin_draft-orders.yaml /admin/draft-orders/{id}: $ref: paths/admin_draft-orders_{id}.yaml - /gift-cards: - $ref: paths/gift-cards.yaml - /gift-cards/{id}: - $ref: paths/gift-cards_{id}.yaml - /inventory-items/{id}/location-levels: - $ref: paths/inventory-items_{id}_location-levels.yaml - /inventory-items/{id}: - $ref: paths/inventory-items_{id}.yaml - /inventory-items/{id}/location-levels/{location_id}: - $ref: paths/inventory-items_{id}_location-levels_{location_id}.yaml - /inventory-items: - $ref: paths/inventory-items.yaml - /invites/accept: - $ref: paths/invites_accept.yaml - /invites: - $ref: paths/invites.yaml - /invites/{invite_id}: - $ref: paths/invites_{invite_id}.yaml - /invites/{invite_id}/resend: - $ref: paths/invites_{invite_id}_resend.yaml - /notes: - $ref: paths/notes.yaml - /notes/{id}: - $ref: paths/notes_{id}.yaml - /notifications: - $ref: paths/notifications.yaml - /notifications/{id}/resend: - $ref: paths/notifications_{id}_resend.yaml - /order-edits/{id}/items: - $ref: paths/order-edits_{id}_items.yaml - /order-edits/{id}/cancel: - $ref: paths/order-edits_{id}_cancel.yaml - /order-edits/{id}/confirm: - $ref: paths/order-edits_{id}_confirm.yaml - /order-edits: - $ref: paths/order-edits.yaml - /order-edits/{id}/items/{item_id}: - $ref: paths/order-edits_{id}_items_{item_id}.yaml - /order-edits/{id}/changes/{change_id}: - $ref: paths/order-edits_{id}_changes_{change_id}.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml - /order-edits/{id}/request: - $ref: paths/order-edits_{id}_request.yaml - /orders/{id}/shipping-methods: - $ref: paths/orders_{id}_shipping-methods.yaml - /orders/{id}/archive: - $ref: paths/orders_{id}_archive.yaml - /orders/{id}/claims/{claim_id}/cancel: - $ref: paths/orders_{id}_claims_{claim_id}_cancel.yaml - /orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel: + /admin/draft-orders/{id}/line-items: + $ref: paths/admin_draft-orders_{id}_line-items.yaml + /admin/draft-orders/{id}/line-items/{line_id}: + $ref: paths/admin_draft-orders_{id}_line-items_{line_id}.yaml + /admin/draft-orders/{id}/pay: + $ref: paths/admin_draft-orders_{id}_pay.yaml + /admin/gift-cards: + $ref: paths/admin_gift-cards.yaml + /admin/gift-cards/{id}: + $ref: paths/admin_gift-cards_{id}.yaml + /admin/inventory-items: + $ref: paths/admin_inventory-items.yaml + /admin/inventory-items/{id}: + $ref: paths/admin_inventory-items_{id}.yaml + /admin/inventory-items/{id}/location-levels: + $ref: paths/admin_inventory-items_{id}_location-levels.yaml + /admin/inventory-items/{id}/location-levels/{location_id}: + $ref: paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml + /admin/invites: + $ref: paths/admin_invites.yaml + /admin/invites/accept: + $ref: paths/admin_invites_accept.yaml + /admin/invites/{invite_id}: + $ref: paths/admin_invites_{invite_id}.yaml + /admin/invites/{invite_id}/resend: + $ref: paths/admin_invites_{invite_id}_resend.yaml + /admin/notes: + $ref: paths/admin_notes.yaml + /admin/notes/{id}: + $ref: paths/admin_notes_{id}.yaml + /admin/notifications: + $ref: paths/admin_notifications.yaml + /admin/notifications/{id}/resend: + $ref: paths/admin_notifications_{id}_resend.yaml + /admin/order-edits: + $ref: paths/admin_order-edits.yaml + /admin/order-edits/{id}: + $ref: paths/admin_order-edits_{id}.yaml + /admin/order-edits/{id}/cancel: + $ref: paths/admin_order-edits_{id}_cancel.yaml + /admin/order-edits/{id}/changes/{change_id}: + $ref: paths/admin_order-edits_{id}_changes_{change_id}.yaml + /admin/order-edits/{id}/confirm: + $ref: paths/admin_order-edits_{id}_confirm.yaml + /admin/order-edits/{id}/items: + $ref: paths/admin_order-edits_{id}_items.yaml + /admin/order-edits/{id}/items/{item_id}: + $ref: paths/admin_order-edits_{id}_items_{item_id}.yaml + /admin/order-edits/{id}/request: + $ref: paths/admin_order-edits_{id}_request.yaml + /admin/orders: + $ref: paths/admin_orders.yaml + /admin/orders/{id}: + $ref: paths/admin_orders_{id}.yaml + /admin/orders/{id}/archive: + $ref: paths/admin_orders_{id}_archive.yaml + /admin/orders/{id}/cancel: + $ref: paths/admin_orders_{id}_cancel.yaml + /admin/orders/{id}/capture: + $ref: paths/admin_orders_{id}_capture.yaml + /admin/orders/{id}/claims: + $ref: paths/admin_orders_{id}_claims.yaml + /admin/orders/{id}/claims/{claim_id}: + $ref: paths/admin_orders_{id}_claims_{claim_id}.yaml + /admin/orders/{id}/claims/{claim_id}/cancel: + $ref: paths/admin_orders_{id}_claims_{claim_id}_cancel.yaml + /admin/orders/{id}/claims/{claim_id}/fulfillments: + $ref: paths/admin_orders_{id}_claims_{claim_id}_fulfillments.yaml + /admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel: $ref: >- - paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml - /orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel: + paths/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml + /admin/orders/{id}/claims/{claim_id}/shipments: + $ref: paths/admin_orders_{id}_claims_{claim_id}_shipments.yaml + /admin/orders/{id}/complete: + $ref: paths/admin_orders_{id}_complete.yaml + /admin/orders/{id}/fulfillment: + $ref: paths/admin_orders_{id}_fulfillment.yaml + /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel: + $ref: paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml + /admin/orders/{id}/line-items/{line_item_id}/reserve: + $ref: paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml + /admin/orders/{id}/refund: + $ref: paths/admin_orders_{id}_refund.yaml + /admin/orders/{id}/reservations: + $ref: paths/admin_orders_{id}_reservations.yaml + /admin/orders/{id}/return: + $ref: paths/admin_orders_{id}_return.yaml + /admin/orders/{id}/shipment: + $ref: paths/admin_orders_{id}_shipment.yaml + /admin/orders/{id}/shipping-methods: + $ref: paths/admin_orders_{id}_shipping-methods.yaml + /admin/orders/{id}/swaps: + $ref: paths/admin_orders_{id}_swaps.yaml + /admin/orders/{id}/swaps/{swap_id}/cancel: + $ref: paths/admin_orders_{id}_swaps_{swap_id}_cancel.yaml + /admin/orders/{id}/swaps/{swap_id}/fulfillments: + $ref: paths/admin_orders_{id}_swaps_{swap_id}_fulfillments.yaml + /admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel: $ref: >- - paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml - /orders/{id}/fulfillments/{fulfillment_id}/cancel: - $ref: paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml - /orders/{id}/cancel: - $ref: paths/orders_{id}_cancel.yaml - /orders/{id}/swaps/{swap_id}/cancel: - $ref: paths/orders_{id}_swaps_{swap_id}_cancel.yaml - /orders/{id}/capture: - $ref: paths/orders_{id}_capture.yaml - /orders/{id}/complete: - $ref: paths/orders_{id}_complete.yaml - /orders/{id}/claims/{claim_id}/shipments: - $ref: paths/orders_{id}_claims_{claim_id}_shipments.yaml - /order/{id}/claims: - $ref: paths/order_{id}_claims.yaml - /orders/{id}/fulfillment: - $ref: paths/orders_{id}_fulfillment.yaml - /orders/{id}/line-items/{line_item_id}/reserve: - $ref: paths/orders_{id}_line-items_{line_item_id}_reserve.yaml - /orders/{id}/shipment: - $ref: paths/orders_{id}_shipment.yaml - /orders/{id}/swaps/{swap_id}/shipments: - $ref: paths/orders_{id}_swaps_{swap_id}_shipments.yaml - /order/{id}/swaps: - $ref: paths/order_{id}_swaps.yaml - /orders/{id}/claims/{claim_id}/fulfillments: - $ref: paths/orders_{id}_claims_{claim_id}_fulfillments.yaml - /orders/{id}/swaps/{swap_id}/fulfillments: - $ref: paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml - /orders/{id}: - $ref: paths/orders_{id}.yaml - /orders/{id}/reservations: - $ref: paths/orders_{id}_reservations.yaml - /orders: - $ref: paths/orders.yaml - /orders/{id}/swaps/{swap_id}/process-payment: - $ref: paths/orders_{id}_swaps_{swap_id}_process-payment.yaml - /orders/{id}/refund: - $ref: paths/orders_{id}_refund.yaml - /orders/{id}/return: - $ref: paths/orders_{id}_return.yaml - /order/{id}/claims/{claim_id}: - $ref: paths/order_{id}_claims_{claim_id}.yaml - /payment-collections/{id}: - $ref: paths/payment-collections_{id}.yaml - /payment-collections/{id}/authorize: - $ref: paths/payment-collections_{id}_authorize.yaml - /payments/{id}/capture: - $ref: paths/payments_{id}_capture.yaml - /payments/{id}: - $ref: paths/payments_{id}.yaml - /payments/{id}/refund: - $ref: paths/payments_{id}_refund.yaml - /price-lists/{id}/prices/batch: - $ref: paths/price-lists_{id}_prices_batch.yaml - /price-lists: - $ref: paths/price-lists.yaml - /price-lists/{id}: - $ref: paths/price-lists_{id}.yaml - /price-lists/{id}/products/{product_id}/prices: - $ref: paths/price-lists_{id}_products_{product_id}_prices.yaml - /price-lists/{id}/variants/{variant_id}/prices: - $ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml - /price-lists/{id}/products: - $ref: paths/price-lists_{id}_products.yaml - /product-categories/{id}/products/batch: - $ref: paths/product-categories_{id}_products_batch.yaml - /product-categories: - $ref: paths/product-categories.yaml - /product-categories/{id}: - $ref: paths/product-categories_{id}.yaml - /product-tags: - $ref: paths/product-tags.yaml - /product-types: - $ref: paths/product-types.yaml - /products/{id}/options: - $ref: paths/products_{id}_options.yaml - /products: - $ref: paths/products.yaml - /products/{id}/variants: - $ref: paths/products_{id}_variants.yaml - /products/{id}/options/{option_id}: - $ref: paths/products_{id}_options_{option_id}.yaml - /products/{id}: - $ref: paths/products_{id}.yaml - /products/{id}/variants/{variant_id}: - $ref: paths/products_{id}_variants_{variant_id}.yaml - /products/tag-usage: - $ref: paths/products_tag-usage.yaml - /products/types: - $ref: paths/products_types.yaml - /products/{id}/metadata: - $ref: paths/products_{id}_metadata.yaml - /publishable-api-keys/{id}/sales-channels/batch: - $ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml - /publishable-api-keys: - $ref: paths/publishable-api-keys.yaml - /publishable-api-keys/{id}: - $ref: paths/publishable-api-keys_{id}.yaml - /publishable-api-keys/{id}/sales-channels: - $ref: paths/publishable-api-keys_{id}_sales-channels.yaml - /publishable-api-keys/{id}/revoke: - $ref: paths/publishable-api-keys_{id}_revoke.yaml - /publishable-api-key/{id}: - $ref: paths/publishable-api-key_{id}.yaml - /regions/{id}/countries: - $ref: paths/regions_{id}_countries.yaml - /regions/{id}/fulfillment-providers: - $ref: paths/regions_{id}_fulfillment-providers.yaml - /regions/{id}/payment-providers: - $ref: paths/regions_{id}_payment-providers.yaml - /regions: - $ref: paths/regions.yaml - /regions/{id}: - $ref: paths/regions_{id}.yaml - /regions/{id}/fulfillment-options: - $ref: paths/regions_{id}_fulfillment-options.yaml - /regions/{id}/countries/{country_code}: - $ref: paths/regions_{id}_countries_{country_code}.yaml - /regions/{id}/fulfillment-providers/{provider_id}: - $ref: paths/regions_{id}_fulfillment-providers_{provider_id}.yaml - /regions/{id}/payment-providers/{provider_id}: - $ref: paths/regions_{id}_payment-providers_{provider_id}.yaml - /reservations: - $ref: paths/reservations.yaml - /reservations/{id}: - $ref: paths/reservations_{id}.yaml - /return-reasons: - $ref: paths/return-reasons.yaml - /return-reasons/{id}: - $ref: paths/return-reasons_{id}.yaml - /returns/{id}/cancel: - $ref: paths/returns_{id}_cancel.yaml - /returns: - $ref: paths/returns.yaml - /returns/{id}/receive: - $ref: paths/returns_{id}_receive.yaml - /sales-channels/{id}/products/batch: - $ref: paths/sales-channels_{id}_products_batch.yaml - /sales-channels/{id}/stock-locations: - $ref: paths/sales-channels_{id}_stock-locations.yaml - /sales-channels: - $ref: paths/sales-channels.yaml - /sales-channels/{id}: - $ref: paths/sales-channels_{id}.yaml - /shipping-options: - $ref: paths/shipping-options.yaml - /shipping-options/{id}: - $ref: paths/shipping-options_{id}.yaml - /shipping-profiles: - $ref: paths/shipping-profiles.yaml - /shipping-profiles/{id}: - $ref: paths/shipping-profiles_{id}.yaml - /stock-locations: - $ref: paths/stock-locations.yaml - /stock-locations/{id}: - $ref: paths/stock-locations_{id}.yaml - /store/currencies/{code}: - $ref: paths/store_currencies_{code}.yaml - /store: - $ref: paths/store.yaml - /store/payment-providers: - $ref: paths/store_payment-providers.yaml - /store/tax-providers: - $ref: paths/store_tax-providers.yaml - /swaps/{id}: - $ref: paths/swaps_{id}.yaml - /swaps: - $ref: paths/swaps.yaml - /tax-rates/{id}/product-types/batch: - $ref: paths/tax-rates_{id}_product-types_batch.yaml - /tax-rates/{id}/products/batch: - $ref: paths/tax-rates_{id}_products_batch.yaml - /tax-rates/{id}/shipping-options/batch: - $ref: paths/tax-rates_{id}_shipping-options_batch.yaml - /tax-rates: - $ref: paths/tax-rates.yaml - /tax-rates/{id}: - $ref: paths/tax-rates_{id}.yaml - /uploads/protected: - $ref: paths/uploads_protected.yaml - /uploads: - $ref: paths/uploads.yaml - /uploads/download-url: - $ref: paths/uploads_download-url.yaml - /users: - $ref: paths/users.yaml - /users/{id}: - $ref: paths/users_{id}.yaml - /users/password-token: - $ref: paths/users_password-token.yaml - /users/reset-password: - $ref: paths/users_reset-password.yaml - /variants/{id}/inventory: - $ref: paths/variants_{id}_inventory.yaml - /variants: - $ref: paths/variants.yaml + paths/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml + /admin/orders/{id}/swaps/{swap_id}/process-payment: + $ref: paths/admin_orders_{id}_swaps_{swap_id}_process-payment.yaml + /admin/orders/{id}/swaps/{swap_id}/shipments: + $ref: paths/admin_orders_{id}_swaps_{swap_id}_shipments.yaml + /admin/payment-collections/{id}: + $ref: paths/admin_payment-collections_{id}.yaml + /admin/payment-collections/{id}/authorize: + $ref: paths/admin_payment-collections_{id}_authorize.yaml + /admin/payments/{id}: + $ref: paths/admin_payments_{id}.yaml + /admin/payments/{id}/capture: + $ref: paths/admin_payments_{id}_capture.yaml + /admin/payments/{id}/refund: + $ref: paths/admin_payments_{id}_refund.yaml + /admin/price-lists: + $ref: paths/admin_price-lists.yaml + /admin/price-lists/{id}: + $ref: paths/admin_price-lists_{id}.yaml + /admin/price-lists/{id}/prices/batch: + $ref: paths/admin_price-lists_{id}_prices_batch.yaml + /admin/price-lists/{id}/products: + $ref: paths/admin_price-lists_{id}_products.yaml + /admin/price-lists/{id}/products/{product_id}/prices: + $ref: paths/admin_price-lists_{id}_products_{product_id}_prices.yaml + /admin/price-lists/{id}/variants/{variant_id}/prices: + $ref: paths/admin_price-lists_{id}_variants_{variant_id}_prices.yaml + /admin/product-categories: + $ref: paths/admin_product-categories.yaml + /admin/product-categories/{id}: + $ref: paths/admin_product-categories_{id}.yaml + /admin/product-categories/{id}/products/batch: + $ref: paths/admin_product-categories_{id}_products_batch.yaml + /admin/product-tags: + $ref: paths/admin_product-tags.yaml + /admin/product-types: + $ref: paths/admin_product-types.yaml + /admin/products: + $ref: paths/admin_products.yaml + /admin/products/tag-usage: + $ref: paths/admin_products_tag-usage.yaml + /admin/products/types: + $ref: paths/admin_products_types.yaml + /admin/products/{id}: + $ref: paths/admin_products_{id}.yaml + /admin/products/{id}/metadata: + $ref: paths/admin_products_{id}_metadata.yaml + /admin/products/{id}/options: + $ref: paths/admin_products_{id}_options.yaml + /admin/products/{id}/options/{option_id}: + $ref: paths/admin_products_{id}_options_{option_id}.yaml + /admin/products/{id}/variants: + $ref: paths/admin_products_{id}_variants.yaml + /admin/products/{id}/variants/{variant_id}: + $ref: paths/admin_products_{id}_variants_{variant_id}.yaml + /admin/publishable-api-key/{id}: + $ref: paths/admin_publishable-api-key_{id}.yaml + /admin/publishable-api-keys: + $ref: paths/admin_publishable-api-keys.yaml + /admin/publishable-api-keys/{id}: + $ref: paths/admin_publishable-api-keys_{id}.yaml + /admin/publishable-api-keys/{id}/revoke: + $ref: paths/admin_publishable-api-keys_{id}_revoke.yaml + /admin/publishable-api-keys/{id}/sales-channels: + $ref: paths/admin_publishable-api-keys_{id}_sales-channels.yaml + /admin/publishable-api-keys/{id}/sales-channels/batch: + $ref: paths/admin_publishable-api-keys_{id}_sales-channels_batch.yaml + /admin/regions: + $ref: paths/admin_regions.yaml + /admin/regions/{id}: + $ref: paths/admin_regions_{id}.yaml + /admin/regions/{id}/countries: + $ref: paths/admin_regions_{id}_countries.yaml + /admin/regions/{id}/countries/{country_code}: + $ref: paths/admin_regions_{id}_countries_{country_code}.yaml + /admin/regions/{id}/fulfillment-options: + $ref: paths/admin_regions_{id}_fulfillment-options.yaml + /admin/regions/{id}/fulfillment-providers: + $ref: paths/admin_regions_{id}_fulfillment-providers.yaml + /admin/regions/{id}/fulfillment-providers/{provider_id}: + $ref: paths/admin_regions_{id}_fulfillment-providers_{provider_id}.yaml + /admin/regions/{id}/payment-providers: + $ref: paths/admin_regions_{id}_payment-providers.yaml + /admin/regions/{id}/payment-providers/{provider_id}: + $ref: paths/admin_regions_{id}_payment-providers_{provider_id}.yaml + /admin/reservations: + $ref: paths/admin_reservations.yaml + /admin/reservations/{id}: + $ref: paths/admin_reservations_{id}.yaml + /admin/return-reasons: + $ref: paths/admin_return-reasons.yaml + /admin/return-reasons/{id}: + $ref: paths/admin_return-reasons_{id}.yaml + /admin/returns: + $ref: paths/admin_returns.yaml + /admin/returns/{id}/cancel: + $ref: paths/admin_returns_{id}_cancel.yaml + /admin/returns/{id}/receive: + $ref: paths/admin_returns_{id}_receive.yaml + /admin/sales-channels: + $ref: paths/admin_sales-channels.yaml + /admin/sales-channels/{id}: + $ref: paths/admin_sales-channels_{id}.yaml + /admin/sales-channels/{id}/products/batch: + $ref: paths/admin_sales-channels_{id}_products_batch.yaml + /admin/sales-channels/{id}/stock-locations: + $ref: paths/admin_sales-channels_{id}_stock-locations.yaml + /admin/shipping-options: + $ref: paths/admin_shipping-options.yaml + /admin/shipping-options/{id}: + $ref: paths/admin_shipping-options_{id}.yaml + /admin/shipping-profiles: + $ref: paths/admin_shipping-profiles.yaml + /admin/shipping-profiles/{id}: + $ref: paths/admin_shipping-profiles_{id}.yaml + /admin/stock-locations: + $ref: paths/admin_stock-locations.yaml + /admin/stock-locations/{id}: + $ref: paths/admin_stock-locations_{id}.yaml + /admin/store: + $ref: paths/admin_store.yaml + /admin/store/currencies/{code}: + $ref: paths/admin_store_currencies_{code}.yaml + /admin/store/payment-providers: + $ref: paths/admin_store_payment-providers.yaml + /admin/store/tax-providers: + $ref: paths/admin_store_tax-providers.yaml + /admin/swaps: + $ref: paths/admin_swaps.yaml + /admin/swaps/{id}: + $ref: paths/admin_swaps_{id}.yaml + /admin/tax-rates: + $ref: paths/admin_tax-rates.yaml + /admin/tax-rates/{id}: + $ref: paths/admin_tax-rates_{id}.yaml + /admin/tax-rates/{id}/product-types/batch: + $ref: paths/admin_tax-rates_{id}_product-types_batch.yaml + /admin/tax-rates/{id}/products/batch: + $ref: paths/admin_tax-rates_{id}_products_batch.yaml + /admin/tax-rates/{id}/shipping-options/batch: + $ref: paths/admin_tax-rates_{id}_shipping-options_batch.yaml + /admin/uploads: + $ref: paths/admin_uploads.yaml + /admin/uploads/download-url: + $ref: paths/admin_uploads_download-url.yaml + /admin/uploads/protected: + $ref: paths/admin_uploads_protected.yaml + /admin/users: + $ref: paths/admin_users.yaml + /admin/users/password-token: + $ref: paths/admin_users_password-token.yaml + /admin/users/reset-password: + $ref: paths/admin_users_reset-password.yaml + /admin/users/{id}: + $ref: paths/admin_users_{id}.yaml + /admin/variants: + $ref: paths/admin_variants.yaml + /admin/variants/{id}: + $ref: paths/admin_variants_{id}.yaml + /admin/variants/{id}/inventory: + $ref: paths/admin_variants_{id}_inventory.yaml components: securitySchemes: api_token: diff --git a/docs/api/admin/paths/apps.yaml b/docs/api/admin/paths/admin_apps.yaml similarity index 92% rename from docs/api/admin/paths/apps.yaml rename to docs/api/admin/paths/admin_apps.yaml index e92bf91ab2..9c99d37b74 100644 --- a/docs/api/admin/paths/apps.yaml +++ b/docs/api/admin/paths/admin_apps.yaml @@ -9,12 +9,12 @@ get: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/apps/get.sh + $ref: ../code_samples/Shell/admin_apps/get.sh security: - api_token: [] - cookie_auth: [] tags: - - App + - Apps responses: '200': description: OK diff --git a/docs/api/admin/paths/apps_authorizations.yaml b/docs/api/admin/paths/admin_apps_authorizations.yaml similarity index 92% rename from docs/api/admin/paths/apps_authorizations.yaml rename to docs/api/admin/paths/admin_apps_authorizations.yaml index bea62545f4..92d46e9a8d 100644 --- a/docs/api/admin/paths/apps_authorizations.yaml +++ b/docs/api/admin/paths/admin_apps_authorizations.yaml @@ -14,12 +14,12 @@ post: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/apps_authorizations/post.sh + $ref: ../code_samples/Shell/admin_apps_authorizations/post.sh security: - api_token: [] - cookie_auth: [] tags: - - App + - Apps responses: '200': description: OK diff --git a/docs/api/admin/paths/auth.yaml b/docs/api/admin/paths/admin_auth.yaml similarity index 89% rename from docs/api/admin/paths/auth.yaml rename to docs/api/admin/paths/admin_auth.yaml index 9e69305fc7..295f934faa 100644 --- a/docs/api/admin/paths/auth.yaml +++ b/docs/api/admin/paths/admin_auth.yaml @@ -1,3 +1,43 @@ +get: + operationId: GetAuth + summary: Get Current User + x-authenticated: true + description: Gets the currently logged in User. + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_auth/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_auth/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminAuthRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml post: operationId: PostAuth summary: User Login @@ -25,11 +65,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/post.js + $ref: ../code_samples/JavaScript/admin_auth/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/post.sh + $ref: ../code_samples/Shell/admin_auth/post.sh tags: - Auth responses: @@ -62,11 +102,11 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/delete.js + $ref: ../code_samples/JavaScript/admin_auth/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/delete.sh + $ref: ../code_samples/Shell/admin_auth/delete.sh security: - api_token: [] - cookie_auth: [] @@ -87,43 +127,3 @@ delete: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml -get: - operationId: GetAuth - summary: Get Current User - x-authenticated: true - description: Gets the currently logged in User. - x-codegen: - method: getSession - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/auth/get.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/auth/get.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminAuthRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/batch-jobs.yaml b/docs/api/admin/paths/admin_batch-jobs.yaml similarity index 96% rename from docs/api/admin/paths/batch-jobs.yaml rename to docs/api/admin/paths/admin_batch-jobs.yaml index b970ce2cc4..a8cbf79f4e 100644 --- a/docs/api/admin/paths/batch-jobs.yaml +++ b/docs/api/admin/paths/admin_batch-jobs.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostBatchJobs - summary: Create a Batch Job - description: Creates a Batch Job. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostBatchesReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/batch-jobs/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/batch-jobs/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Batch Job - responses: - '201': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminBatchJobRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetBatchJobs summary: List Batch Jobs @@ -291,16 +246,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs/get.js + $ref: ../code_samples/JavaScript/admin_batch-jobs/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs/get.sh + $ref: ../code_samples/Shell/admin_batch-jobs/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Batch Jobs responses: '200': description: OK @@ -320,3 +275,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostBatchesReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_batch-jobs/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_batch-jobs/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Jobs + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminBatchJobRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/batch-jobs_{id}.yaml b/docs/api/admin/paths/admin_batch-jobs_{id}.yaml similarity index 87% rename from docs/api/admin/paths/batch-jobs_{id}.yaml rename to docs/api/admin/paths/admin_batch-jobs_{id}.yaml index c1c6c734d2..5e263ffaa2 100644 --- a/docs/api/admin/paths/batch-jobs_{id}.yaml +++ b/docs/api/admin/paths/admin_batch-jobs_{id}.yaml @@ -16,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs_{id}/get.js + $ref: ../code_samples/JavaScript/admin_batch-jobs_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs_{id}/get.sh + $ref: ../code_samples/Shell/admin_batch-jobs_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Batch Jobs responses: '200': description: OK diff --git a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml b/docs/api/admin/paths/admin_batch-jobs_{id}_cancel.yaml similarity index 86% rename from docs/api/admin/paths/batch-jobs_{id}_cancel.yaml rename to docs/api/admin/paths/admin_batch-jobs_{id}_cancel.yaml index cbd64a2c17..52b2f5c913 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml +++ b/docs/api/admin/paths/admin_batch-jobs_{id}_cancel.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs_{id}_cancel/post.js + $ref: ../code_samples/JavaScript/admin_batch-jobs_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs_{id}_cancel/post.sh + $ref: ../code_samples/Shell/admin_batch-jobs_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Batch Jobs responses: '200': description: OK diff --git a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml b/docs/api/admin/paths/admin_batch-jobs_{id}_confirm.yaml similarity index 86% rename from docs/api/admin/paths/batch-jobs_{id}_confirm.yaml rename to docs/api/admin/paths/admin_batch-jobs_{id}_confirm.yaml index 96b445516e..495a937aac 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml +++ b/docs/api/admin/paths/admin_batch-jobs_{id}_confirm.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs_{id}_confirm/post.js + $ref: ../code_samples/JavaScript/admin_batch-jobs_{id}_confirm/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs_{id}_confirm/post.sh + $ref: ../code_samples/Shell/admin_batch-jobs_{id}_confirm/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Batch Job + - Batch Jobs responses: '200': description: OK diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/admin_collections.yaml similarity index 94% rename from docs/api/admin/paths/collections.yaml rename to docs/api/admin/paths/admin_collections.yaml index 2e8818121f..f5880e9cdb 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/admin_collections.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostCollectionsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/collections/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/collections/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminCollectionsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetCollections summary: List Collections @@ -154,16 +109,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections/get.js + $ref: ../code_samples/JavaScript/admin_collections/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections/get.sh + $ref: ../code_samples/Shell/admin_collections/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Collections responses: '200': description: OK @@ -183,3 +138,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostCollectionsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_collections/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_collections/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminCollectionsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/collections_{id}.yaml b/docs/api/admin/paths/admin_collections_{id}.yaml similarity index 87% rename from docs/api/admin/paths/collections_{id}.yaml rename to docs/api/admin/paths/admin_collections_{id}.yaml index b3add7d148..00be96a064 100644 --- a/docs/api/admin/paths/collections_{id}.yaml +++ b/docs/api/admin/paths/admin_collections_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/collections_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/collections_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminCollectionsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetCollectionsCollection summary: Get a Collection @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/get.js + $ref: ../code_samples/JavaScript/admin_collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/get.sh + $ref: ../code_samples/Shell/admin_collections_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Collections responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/post.js + $ref: ../code_samples/JavaScript/admin_collections_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/post.sh + $ref: ../code_samples/Shell/admin_collections_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Collections responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_collections_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_collections_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminCollectionsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/collections_{id}_products_batch.yaml b/docs/api/admin/paths/admin_collections_{id}_products_batch.yaml similarity index 92% rename from docs/api/admin/paths/collections_{id}_products_batch.yaml rename to docs/api/admin/paths/admin_collections_{id}_products_batch.yaml index 1746b6ccbe..284840f648 100644 --- a/docs/api/admin/paths/collections_{id}_products_batch.yaml +++ b/docs/api/admin/paths/admin_collections_{id}_products_batch.yaml @@ -21,12 +21,12 @@ post: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}_products_batch/post.sh + $ref: ../code_samples/Shell/admin_collections_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Collections responses: '200': description: OK @@ -69,12 +69,12 @@ delete: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}_products_batch/delete.sh + $ref: ../code_samples/Shell/admin_collections_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Collection + - Collections responses: '200': description: OK diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/admin_currencies.yaml similarity index 89% rename from docs/api/admin/paths/currencies.yaml rename to docs/api/admin/paths/admin_currencies.yaml index 56afc700eb..fa5fc77506 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/admin_currencies.yaml @@ -38,13 +38,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/currencies/get.js + $ref: ../code_samples/JavaScript/admin_currencies/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/currencies/get.sh + $ref: ../code_samples/Shell/admin_currencies/get.sh tags: - - Currency + - Currencies responses: '200': description: OK diff --git a/docs/api/admin/paths/currencies_{code}.yaml b/docs/api/admin/paths/admin_currencies_{code}.yaml similarity index 82% rename from docs/api/admin/paths/currencies_{code}.yaml rename to docs/api/admin/paths/admin_currencies_{code}.yaml index f059541bae..948e4e274b 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/admin_currencies_{code}.yaml @@ -21,13 +21,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/currencies_{code}/post.js + $ref: ../code_samples/JavaScript/admin_currencies_{code}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/currencies_{code}/post.sh + $ref: ../code_samples/Shell/admin_currencies_{code}/post.sh tags: - - Currency + - Currencies responses: '200': description: OK diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/admin_customer-groups.yaml similarity index 94% rename from docs/api/admin/paths/customer-groups.yaml rename to docs/api/admin/paths/admin_customer-groups.yaml index 34919b4e7d..fb9d06d938 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/admin_customer-groups.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostCustomerGroupsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/customer-groups/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/customer-groups/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminCustomerGroupsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetCustomerGroups summary: List Customer Groups @@ -172,16 +127,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups/get.js + $ref: ../code_samples/JavaScript/admin_customer-groups/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups/get.sh + $ref: ../code_samples/Shell/admin_customer-groups/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Customer Groups responses: '200': description: OK @@ -201,3 +156,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostCustomerGroupsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_customer-groups/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_customer-groups/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminCustomerGroupsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/customer-groups_{id}.yaml b/docs/api/admin/paths/admin_customer-groups_{id}.yaml similarity index 88% rename from docs/api/admin/paths/customer-groups_{id}.yaml rename to docs/api/admin/paths/admin_customer-groups_{id}.yaml index 3dce0d500f..8cf327bc8f 100644 --- a/docs/api/admin/paths/customer-groups_{id}.yaml +++ b/docs/api/admin/paths/admin_customer-groups_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteCustomerGroupsCustomerGroup - summary: Delete a Customer Group - description: Deletes a CustomerGroup. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Customer Group - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/customer-groups_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/customer-groups_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminCustomerGroupsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetCustomerGroupsGroup summary: Get a Customer Group @@ -74,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}/get.js + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}/get.sh + $ref: ../code_samples/Shell/admin_customer-groups_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Customer Groups responses: '200': description: OK @@ -126,16 +79,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}/post.js + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}/post.sh + $ref: ../code_samples/Shell/admin_customer-groups_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Customer Groups responses: '200': description: OK @@ -155,3 +108,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_customer-groups_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Groups + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminCustomerGroupsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/customer-groups_{id}_customers.yaml b/docs/api/admin/paths/admin_customer-groups_{id}_customers.yaml similarity index 90% rename from docs/api/admin/paths/customer-groups_{id}_customers.yaml rename to docs/api/admin/paths/admin_customer-groups_{id}_customers.yaml index 9b6fbb1483..6e431ac4e5 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers.yaml +++ b/docs/api/admin/paths/admin_customer-groups_{id}_customers.yaml @@ -39,16 +39,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}_customers/get.js + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}_customers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}_customers/get.sh + $ref: ../code_samples/Shell/admin_customer-groups_{id}_customers/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Customer Groups responses: '200': description: OK diff --git a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml b/docs/api/admin/paths/admin_customer-groups_{id}_customers_batch.yaml similarity index 86% rename from docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml rename to docs/api/admin/paths/admin_customer-groups_{id}_customers_batch.yaml index 2d30363b1e..098537631c 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml +++ b/docs/api/admin/paths/admin_customer-groups_{id}_customers_batch.yaml @@ -23,16 +23,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/customer-groups_{id}_customers_batch/post.js + ../code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}_customers_batch/post.sh + $ref: >- + ../code_samples/Shell/admin_customer-groups_{id}_customers_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Customer Groups responses: '200': description: OK @@ -77,16 +78,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/customer-groups_{id}_customers_batch/delete.js + ../code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}_customers_batch/delete.sh + $ref: >- + ../code_samples/Shell/admin_customer-groups_{id}_customers_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer Group + - Customer Groups responses: '200': description: OK diff --git a/docs/api/admin/paths/customers.yaml b/docs/api/admin/paths/admin_customers.yaml similarity index 90% rename from docs/api/admin/paths/customers.yaml rename to docs/api/admin/paths/admin_customers.yaml index 329b08921d..ca668a7b00 100644 --- a/docs/api/admin/paths/customers.yaml +++ b/docs/api/admin/paths/admin_customers.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostCustomers - summary: Create a Customer - description: Creates a Customer. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostCustomersReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/customers/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/customers/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer - responses: - '201': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminCustomersRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetCustomers summary: List Customers @@ -78,16 +33,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers/get.js + $ref: ../code_samples/JavaScript/admin_customers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers/get.sh + $ref: ../code_samples/Shell/admin_customers/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK @@ -107,3 +62,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostCustomersReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_customers/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_customers/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customers + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminCustomersRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/customers_{id}.yaml b/docs/api/admin/paths/admin_customers_{id}.yaml similarity index 90% rename from docs/api/admin/paths/customers_{id}.yaml rename to docs/api/admin/paths/admin_customers_{id}.yaml index bbd0e2c8a5..8ec560bb02 100644 --- a/docs/api/admin/paths/customers_{id}.yaml +++ b/docs/api/admin/paths/admin_customers_{id}.yaml @@ -26,16 +26,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_{id}/get.js + $ref: ../code_samples/JavaScript/admin_customers_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_{id}/get.sh + $ref: ../code_samples/Shell/admin_customers_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK @@ -88,16 +88,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_{id}/post.js + $ref: ../code_samples/JavaScript/admin_customers_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_{id}/post.sh + $ref: ../code_samples/Shell/admin_customers_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK diff --git a/docs/api/admin/paths/discounts.yaml b/docs/api/admin/paths/admin_discounts.yaml similarity index 93% rename from docs/api/admin/paths/discounts.yaml rename to docs/api/admin/paths/admin_discounts.yaml index c9fe101596..183b683690 100644 --- a/docs/api/admin/paths/discounts.yaml +++ b/docs/api/admin/paths/admin_discounts.yaml @@ -1,62 +1,3 @@ -post: - operationId: PostDiscounts - summary: Creates a Discount - x-authenticated: true - description: >- - Creates a Discount with a given set of rules that define how the Discount - behaves. - parameters: - - in: query - name: expand - description: (Comma separated) Which fields should be expanded in the results. - schema: - type: string - - in: query - name: fields - description: (Comma separated) Which fields should be retrieved in the results. - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostDiscountsReq.yaml - x-codegen: - method: create - queryParams: AdminPostDiscountsParams - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/discounts/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/discounts/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDiscountsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetDiscounts summary: List Discounts @@ -126,16 +67,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts/get.js + $ref: ../code_samples/JavaScript/admin_discounts/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts/get.sh + $ref: ../code_samples/Shell/admin_discounts/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK @@ -155,3 +96,62 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostDiscounts + summary: Creates a Discount + x-authenticated: true + description: >- + Creates a Discount with a given set of rules that define how the Discount + behaves. + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostDiscountsReq.yaml + x-codegen: + method: create + queryParams: AdminPostDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_discounts/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_discounts/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDiscountsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/discounts_code_{code}.yaml b/docs/api/admin/paths/admin_discounts_code_{code}.yaml similarity index 89% rename from docs/api/admin/paths/discounts_code_{code}.yaml rename to docs/api/admin/paths/admin_discounts_code_{code}.yaml index ad838dd144..2e318cc8c7 100644 --- a/docs/api/admin/paths/discounts_code_{code}.yaml +++ b/docs/api/admin/paths/admin_discounts_code_{code}.yaml @@ -27,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_code_{code}/get.js + $ref: ../code_samples/JavaScript/admin_discounts_code_{code}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_code_{code}/get.sh + $ref: ../code_samples/Shell/admin_discounts_code_{code}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml b/docs/api/admin/paths/admin_discounts_{discount_id}_conditions.yaml similarity index 89% rename from docs/api/admin/paths/discounts_{discount_id}_conditions.yaml rename to docs/api/admin/paths/admin_discounts_{discount_id}_conditions.yaml index eda9816633..8062ba9ac6 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml +++ b/docs/api/admin/paths/admin_discounts_{discount_id}_conditions.yaml @@ -39,16 +39,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{discount_id}_conditions/post.js + $ref: >- + ../code_samples/JavaScript/admin_discounts_{discount_id}_conditions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{discount_id}_conditions/post.sh + $ref: ../code_samples/Shell/admin_discounts_{discount_id}_conditions/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Discounts responses: '200': description: OK diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml b/docs/api/admin/paths/admin_discounts_{discount_id}_conditions_{condition_id}.yaml similarity index 89% rename from docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml rename to docs/api/admin/paths/admin_discounts_{discount_id}_conditions_{condition_id}.yaml index 5501701835..ea496cba7f 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml +++ b/docs/api/admin/paths/admin_discounts_{discount_id}_conditions_{condition_id}.yaml @@ -1,69 +1,3 @@ -delete: - operationId: DeleteDiscountsDiscountConditionsCondition - summary: Delete a Condition - description: Deletes a DiscountCondition - x-authenticated: true - parameters: - - in: path - name: discount_id - required: true - description: The ID of the Discount - schema: - type: string - - in: path - name: condition_id - required: true - description: The ID of the DiscountCondition - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codegen: - method: deleteCondition - queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Discount Condition - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDiscountConditionsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetDiscountsDiscountConditionsCondition summary: Get a Condition @@ -100,17 +34,17 @@ get: label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/get.js + ../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/get.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/get.sh + ../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Discounts responses: '200': description: OK @@ -179,17 +113,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/post.js + ../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/post.sh + ../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK @@ -209,3 +143,69 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a Condition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDiscountConditionsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml b/docs/api/admin/paths/admin_discounts_{discount_id}_conditions_{condition_id}_batch.yaml similarity index 89% rename from docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml rename to docs/api/admin/paths/admin_discounts_{discount_id}_conditions_{condition_id}_batch.yaml index 0394b766da..449b2a70aa 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml +++ b/docs/api/admin/paths/admin_discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -44,17 +44,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/post.js + ../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/post.sh + ../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Discounts responses: '200': description: OK @@ -119,17 +119,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/delete.js + ../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh + ../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount Condition + - Discounts responses: '200': description: OK diff --git a/docs/api/admin/paths/discounts_{id}.yaml b/docs/api/admin/paths/admin_discounts_{id}.yaml similarity index 90% rename from docs/api/admin/paths/discounts_{id}.yaml rename to docs/api/admin/paths/admin_discounts_{id}.yaml index 605192c2ab..d9003c625b 100644 --- a/docs/api/admin/paths/discounts_{id}.yaml +++ b/docs/api/admin/paths/admin_discounts_{id}.yaml @@ -1,50 +1,3 @@ -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 - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/discounts_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/discounts_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDiscountsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetDiscountsDiscount summary: Get a Discount @@ -74,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}/get.js + $ref: ../code_samples/JavaScript/admin_discounts_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}/get.sh + $ref: ../code_samples/Shell/admin_discounts_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK @@ -143,16 +96,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}/post.js + $ref: ../code_samples/JavaScript/admin_discounts_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}/post.sh + $ref: ../code_samples/Shell/admin_discounts_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK @@ -172,3 +125,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +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 + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_discounts_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_discounts_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discounts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDiscountsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml b/docs/api/admin/paths/admin_discounts_{id}_dynamic-codes.yaml similarity index 88% rename from docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml rename to docs/api/admin/paths/admin_discounts_{id}_dynamic-codes.yaml index 9cee3a1389..8418de52f1 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml +++ b/docs/api/admin/paths/admin_discounts_{id}_dynamic-codes.yaml @@ -23,16 +23,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}_dynamic-codes/post.js + $ref: ../code_samples/JavaScript/admin_discounts_{id}_dynamic-codes/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}_dynamic-codes/post.sh + $ref: ../code_samples/Shell/admin_discounts_{id}_dynamic-codes/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml b/docs/api/admin/paths/admin_discounts_{id}_dynamic-codes_{code}.yaml similarity index 86% rename from docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml rename to docs/api/admin/paths/admin_discounts_{id}_dynamic-codes_{code}.yaml index 00931f18b1..8c0610f4a3 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml +++ b/docs/api/admin/paths/admin_discounts_{id}_dynamic-codes_{code}.yaml @@ -23,16 +23,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/delete.js + ../code_samples/JavaScript/admin_discounts_{id}_dynamic-codes_{code}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}_dynamic-codes_{code}/delete.sh + $ref: >- + ../code_samples/Shell/admin_discounts_{id}_dynamic-codes_{code}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK diff --git a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml b/docs/api/admin/paths/admin_discounts_{id}_regions_{region_id}.yaml similarity index 86% rename from docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml rename to docs/api/admin/paths/admin_discounts_{id}_regions_{region_id}.yaml index 8084d28099..727beddea7 100644 --- a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml +++ b/docs/api/admin/paths/admin_discounts_{id}_regions_{region_id}.yaml @@ -22,16 +22,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}_regions_{region_id}/post.js + $ref: >- + ../code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}_regions_{region_id}/post.sh + $ref: ../code_samples/Shell/admin_discounts_{id}_regions_{region_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK @@ -76,16 +77,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{id}_regions_{region_id}/delete.js + ../code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}_regions_{region_id}/delete.sh + $ref: >- + ../code_samples/Shell/admin_discounts_{id}_regions_{region_id}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Discount + - Discounts responses: '200': description: OK diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/admin_draft-orders.yaml similarity index 89% rename from docs/api/admin/paths/draft-orders.yaml rename to docs/api/admin/paths/admin_draft-orders.yaml index 0f78a3d87d..22681cec9f 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/admin_draft-orders.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostDraftOrders - summary: Create a Draft Order - description: Creates a Draft Order - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostDraftOrdersReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/draft-orders/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/draft-orders/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDraftOrdersRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetDraftOrders summary: List Draft Orders @@ -75,16 +30,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders/get.js + $ref: ../code_samples/JavaScript/admin_draft-orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders/get.sh + $ref: ../code_samples/Shell/admin_draft-orders/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Draft Orders responses: '200': description: OK @@ -104,3 +59,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostDraftOrdersReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_draft-orders/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDraftOrdersRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index 207be909e2..4bc5310a67 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -1,3 +1,50 @@ +get: + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDraftOrdersRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml post: operationId: PostDraftOrdersDraftOrder summary: Update a Draft Order @@ -30,7 +77,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Draft Orders responses: '200': description: OK @@ -50,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteDraftOrdersDraftOrder + summary: Delete a Draft Order + description: Deletes a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDraftOrdersDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml b/docs/api/admin/paths/admin_draft-orders_{id}_line-items.yaml similarity index 87% rename from docs/api/admin/paths/draft-orders_{id}_line-items.yaml rename to docs/api/admin/paths/admin_draft-orders_{id}_line-items.yaml index ef233bff9b..6326cea449 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}_line-items.yaml @@ -22,16 +22,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders_{id}_line-items/post.js + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}_line-items/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}_line-items/post.sh + $ref: ../code_samples/Shell/admin_draft-orders_{id}_line-items/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Draft Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}_line-items_{line_id}.yaml similarity index 86% rename from docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml rename to docs/api/admin/paths/admin_draft-orders_{id}_line-items_{line_id}.yaml index e5a76b1720..03b48621dc 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}_line-items_{line_id}.yaml @@ -1,57 +1,3 @@ -delete: - operationId: DeleteDraftOrdersDraftOrderLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codegen: - method: removeLineItem - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/draft-orders_{id}_line-items_{line_id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDraftOrdersRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostDraftOrdersDraftOrderLineItemsItem summary: Update a Line Item @@ -83,16 +29,72 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/post.js + ../code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}_line-items_{line_id}/post.sh + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDraftOrdersRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/draft-orders_{id}_pay.yaml b/docs/api/admin/paths/admin_draft-orders_{id}_pay.yaml similarity index 87% rename from docs/api/admin/paths/draft-orders_{id}_pay.yaml rename to docs/api/admin/paths/admin_draft-orders_{id}_pay.yaml index 8b3888acd3..bb304bca88 100644 --- a/docs/api/admin/paths/draft-orders_{id}_pay.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}_pay.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders_{id}_pay/post.js + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}_pay/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}_pay/post.sh + $ref: ../code_samples/Shell/admin_draft-orders_{id}_pay/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Draft Order + - Draft Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/gift-cards.yaml b/docs/api/admin/paths/admin_gift-cards.yaml similarity index 89% rename from docs/api/admin/paths/gift-cards.yaml rename to docs/api/admin/paths/admin_gift-cards.yaml index 383e39cf94..df93612ff0 100644 --- a/docs/api/admin/paths/gift-cards.yaml +++ b/docs/api/admin/paths/admin_gift-cards.yaml @@ -1,50 +1,3 @@ -post: - operationId: PostGiftCards - summary: Create a Gift Card - description: >- - Creates a Gift Card that can redeemed by its unique code. The Gift Card is - only valid within 1 region. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostGiftCardsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/gift-cards/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/gift-cards/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminGiftCardsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetGiftCards summary: List Gift Cards @@ -75,16 +28,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards/get.js + $ref: ../code_samples/JavaScript/admin_gift-cards/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards/get.sh + $ref: ../code_samples/Shell/admin_gift-cards/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Gift Cards responses: '200': description: OK @@ -104,3 +57,50 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostGiftCards + summary: Create a Gift Card + description: >- + Creates a Gift Card that can redeemed by its unique code. The Gift Card is + only valid within 1 region. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostGiftCardsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_gift-cards/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/gift-cards_{id}.yaml b/docs/api/admin/paths/admin_gift-cards_{id}.yaml similarity index 88% rename from docs/api/admin/paths/gift-cards_{id}.yaml rename to docs/api/admin/paths/admin_gift-cards_{id}.yaml index 624d467e80..816439bed2 100644 --- a/docs/api/admin/paths/gift-cards_{id}.yaml +++ b/docs/api/admin/paths/admin_gift-cards_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteGiftCardsGiftCard - summary: Delete a Gift Card - description: Deletes a Gift Card - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Gift Card to delete. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/gift-cards_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/gift-cards_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminGiftCardsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetGiftCardsGiftCard summary: Get a Gift Card @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{id}/get.js + $ref: ../code_samples/JavaScript/admin_gift-cards_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{id}/get.sh + $ref: ../code_samples/Shell/admin_gift-cards_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Gift Cards responses: '200': description: OK @@ -117,16 +70,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{id}/post.js + $ref: ../code_samples/JavaScript/admin_gift-cards_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{id}/post.sh + $ref: ../code_samples/Shell/admin_gift-cards_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Gift Cards responses: '200': description: OK @@ -146,3 +99,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteGiftCardsGiftCard + summary: Delete a Gift Card + description: Deletes a Gift Card + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_gift-cards_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_gift-cards_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminGiftCardsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/inventory-items.yaml b/docs/api/admin/paths/admin_inventory-items.yaml similarity index 63% rename from docs/api/admin/paths/inventory-items.yaml rename to docs/api/admin/paths/admin_inventory-items.yaml index e281ed7024..5262a40947 100644 --- a/docs/api/admin/paths/inventory-items.yaml +++ b/docs/api/admin/paths/admin_inventory-items.yaml @@ -95,15 +95,18 @@ get: description: requires_shipping to search for. schema: type: string + x-codegen: + method: list + queryParams: AdminGetInventoryItemsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/inventory-items/get.js + $ref: ../code_samples/JavaScript/admin_inventory-items/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/inventory-items/get.sh + $ref: ../code_samples/Shell/admin_inventory-items/get.sh security: - api_token: [] - cookie_auth: [] @@ -129,3 +132,60 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostInventoryItems + summary: Create an Inventory Item. + description: Creates an Inventory Item. + x-authenticated: true + parameters: + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostInventoryItemsReq.yaml + x-codegen: + method: create + queryParams: AdminPostInventoryItemsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_inventory-items/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_inventory-items/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/inventory-items_{id}.yaml b/docs/api/admin/paths/admin_inventory-items_{id}.yaml similarity index 84% rename from docs/api/admin/paths/inventory-items_{id}.yaml rename to docs/api/admin/paths/admin_inventory-items_{id}.yaml index c0fa12f028..9d9300a108 100644 --- a/docs/api/admin/paths/inventory-items_{id}.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}.yaml @@ -1,38 +1,3 @@ -delete: - operationId: DeleteInventoryItemsInventoryItem - summary: Delete an Inventory Item - description: Delete an Inventory Item - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Inventory Item to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/inventory-items_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/inventory-items_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - InventoryItem - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminInventoryItemsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml get: operationId: GetInventoryItemsInventoryItem summary: Retrive an Inventory Item. @@ -55,15 +20,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetInventoryItemsItemParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/inventory-items_{id}/get.js + $ref: ../code_samples/JavaScript/admin_inventory-items_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/inventory-items_{id}/get.sh + $ref: ../code_samples/Shell/admin_inventory-items_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -115,15 +83,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostInventoryItemsInventoryItemReq.yaml + x-codegen: + method: update + queryParams: AdminPostInventoryItemsInventoryItemParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/inventory-items_{id}/post.js + $ref: ../code_samples/JavaScript/admin_inventory-items_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/inventory-items_{id}/post.sh + $ref: ../code_samples/Shell/admin_inventory-items_{id}/post.sh security: - api_token: [] - cookie_auth: [] @@ -148,3 +119,40 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_inventory-items_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_inventory-items_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml diff --git a/docs/api/admin/paths/inventory-items_{id}_location-levels.yaml b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml similarity index 84% rename from docs/api/admin/paths/inventory-items_{id}_location-levels.yaml rename to docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml index ae6cdee417..1af91cb642 100644 --- a/docs/api/admin/paths/inventory-items_{id}_location-levels.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml @@ -1,65 +1,3 @@ -post: - operationId: PostInventoryItemsInventoryItemLocationLevels - summary: Create an Inventory Location Level for a given Inventory Item. - description: Creates an Inventory Location Level for a given Inventory Item. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Inventory Item. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: >- - ../components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/inventory-items_{id}_location-levels/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/inventory-items_{id}_location-levels/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Inventory Items - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminInventoryItemsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetInventoryItemsInventoryItemLocationLevels summary: List stock levels of a given location. @@ -94,15 +32,20 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: listLocationLevels + queryParams: AdminGetInventoryItemsItemLocationLevelsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/inventory-items_{id}_location-levels/get.js + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/inventory-items_{id}_location-levels/get.sh + $ref: >- + ../code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh security: - api_token: [] - cookie_auth: [] @@ -127,3 +70,69 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + ../components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml + x-codegen: + method: createLocationLevel + queryParams: AdminPostInventoryItemsItemLocationLevelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/inventory-items_{id}_location-levels_{location_id}.yaml b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml similarity index 82% rename from docs/api/admin/paths/inventory-items_{id}_location-levels_{location_id}.yaml rename to docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml index 27babb931e..f6263f2c11 100644 --- a/docs/api/admin/paths/inventory-items_{id}_location-levels_{location_id}.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml @@ -1,66 +1,3 @@ -delete: - operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation - summary: Delete a location level of an Inventory Item. - description: Delete a location level of an Inventory Item. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Inventory Item. - schema: - type: string - - in: path - name: location_id - required: true - description: The ID of the location. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: >- - ../code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Inventory Items - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminInventoryItemsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel summary: Update an Inventory Location Level for a given Inventory Item. @@ -95,17 +32,75 @@ post: schema: $ref: >- ../components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq.yaml + x-codegen: + method: updateLocationLevel + queryParams: AdminPostInventoryItemsItemLocationLevelsLevelParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh + ../code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + x-codegen: + method: deleteLocationLevel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/invites.yaml b/docs/api/admin/paths/admin_invites.yaml similarity index 87% rename from docs/api/admin/paths/invites.yaml rename to docs/api/admin/paths/admin_invites.yaml index ffb958086f..2c1ae42dc4 100644 --- a/docs/api/admin/paths/invites.yaml +++ b/docs/api/admin/paths/admin_invites.yaml @@ -1,44 +1,3 @@ -post: - operationId: PostInvites - summary: Create an Invite - description: Creates an Invite and triggers an 'invite' created event - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostInvitesReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/invites/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/invites/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Invite - responses: - '200': - description: OK - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetInvites summary: Lists Invites @@ -50,16 +9,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites/get.js + $ref: ../code_samples/JavaScript/admin_invites/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites/get.sh + $ref: ../code_samples/Shell/admin_invites/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Invites responses: '200': description: OK @@ -79,3 +38,44 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostInvites + summary: Create an Invite + description: Creates an Invite and triggers an 'invite' created event + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostInvitesReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_invites/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_invites/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invites + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/invites_accept.yaml b/docs/api/admin/paths/admin_invites_accept.yaml similarity index 86% rename from docs/api/admin/paths/invites_accept.yaml rename to docs/api/admin/paths/admin_invites_accept.yaml index e6ca3b2278..1341e11ea5 100644 --- a/docs/api/admin/paths/invites_accept.yaml +++ b/docs/api/admin/paths/admin_invites_accept.yaml @@ -13,16 +13,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites_accept/post.js + $ref: ../code_samples/JavaScript/admin_invites_accept/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites_accept/post.sh + $ref: ../code_samples/Shell/admin_invites_accept/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Invites responses: '200': description: OK diff --git a/docs/api/admin/paths/invites_{invite_id}.yaml b/docs/api/admin/paths/admin_invites_{invite_id}.yaml similarity index 86% rename from docs/api/admin/paths/invites_{invite_id}.yaml rename to docs/api/admin/paths/admin_invites_{invite_id}.yaml index aa56da1b65..29af360dce 100644 --- a/docs/api/admin/paths/invites_{invite_id}.yaml +++ b/docs/api/admin/paths/admin_invites_{invite_id}.yaml @@ -16,16 +16,16 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites_{invite_id}/delete.js + $ref: ../code_samples/JavaScript/admin_invites_{invite_id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites_{invite_id}/delete.sh + $ref: ../code_samples/Shell/admin_invites_{invite_id}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Invites responses: '200': description: OK diff --git a/docs/api/admin/paths/invites_{invite_id}_resend.yaml b/docs/api/admin/paths/admin_invites_{invite_id}_resend.yaml similarity index 85% rename from docs/api/admin/paths/invites_{invite_id}_resend.yaml rename to docs/api/admin/paths/admin_invites_{invite_id}_resend.yaml index b895f752ae..d482c36dbc 100644 --- a/docs/api/admin/paths/invites_{invite_id}_resend.yaml +++ b/docs/api/admin/paths/admin_invites_{invite_id}_resend.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites_{invite_id}_resend/post.js + $ref: ../code_samples/JavaScript/admin_invites_{invite_id}_resend/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites_{invite_id}_resend/post.sh + $ref: ../code_samples/Shell/admin_invites_{invite_id}_resend/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Invites responses: '200': description: OK diff --git a/docs/api/admin/paths/notes.yaml b/docs/api/admin/paths/admin_notes.yaml similarity index 90% rename from docs/api/admin/paths/notes.yaml rename to docs/api/admin/paths/admin_notes.yaml index e78f5b9352..fa32ccac98 100644 --- a/docs/api/admin/paths/notes.yaml +++ b/docs/api/admin/paths/admin_notes.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostNotes - summary: Creates a Note - description: Creates a Note which can be associated with any resource as required. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostNotesReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/notes/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/notes/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Note - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminNotesRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetNotes summary: List Notes @@ -73,16 +28,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes/get.js + $ref: ../code_samples/JavaScript/admin_notes/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes/get.sh + $ref: ../code_samples/Shell/admin_notes/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Note + - Notes responses: '200': description: OK @@ -102,3 +57,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostNotes + summary: Creates a Note + description: Creates a Note which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostNotesReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_notes/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_notes/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminNotesRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/notes_{id}.yaml b/docs/api/admin/paths/admin_notes_{id}.yaml similarity index 88% rename from docs/api/admin/paths/notes_{id}.yaml rename to docs/api/admin/paths/admin_notes_{id}.yaml index b0706086a3..00e5c73ae0 100644 --- a/docs/api/admin/paths/notes_{id}.yaml +++ b/docs/api/admin/paths/admin_notes_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteNotesNote - summary: Delete a Note - description: Deletes a Note. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Note to delete. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/notes_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/notes_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Note - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminNotesDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetNotesNote summary: Get a Note @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes_{id}/get.js + $ref: ../code_samples/JavaScript/admin_notes_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes_{id}/get.sh + $ref: ../code_samples/Shell/admin_notes_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Note + - Notes responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes_{id}/post.js + $ref: ../code_samples/JavaScript/admin_notes_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes_{id}/post.sh + $ref: ../code_samples/Shell/admin_notes_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Note + - Notes responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteNotesNote + summary: Delete a Note + description: Deletes a Note. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Note to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_notes_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_notes_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notes + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminNotesDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/notifications.yaml b/docs/api/admin/paths/admin_notifications.yaml similarity index 94% rename from docs/api/admin/paths/notifications.yaml rename to docs/api/admin/paths/admin_notifications.yaml index 3030528836..583b68cfab 100644 --- a/docs/api/admin/paths/notifications.yaml +++ b/docs/api/admin/paths/admin_notifications.yaml @@ -64,16 +64,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notifications/get.js + $ref: ../code_samples/JavaScript/admin_notifications/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notifications/get.sh + $ref: ../code_samples/Shell/admin_notifications/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Notification + - Notifications responses: '200': description: OK diff --git a/docs/api/admin/paths/notifications_{id}_resend.yaml b/docs/api/admin/paths/admin_notifications_{id}_resend.yaml similarity index 88% rename from docs/api/admin/paths/notifications_{id}_resend.yaml rename to docs/api/admin/paths/admin_notifications_{id}_resend.yaml index 29311f9a2d..c219aa7024 100644 --- a/docs/api/admin/paths/notifications_{id}_resend.yaml +++ b/docs/api/admin/paths/admin_notifications_{id}_resend.yaml @@ -24,16 +24,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notifications_{id}_resend/post.js + $ref: ../code_samples/JavaScript/admin_notifications_{id}_resend/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notifications_{id}_resend/post.sh + $ref: ../code_samples/Shell/admin_notifications_{id}_resend/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Notification + - Notifications responses: '200': description: OK diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/admin_order-edits.yaml similarity index 90% rename from docs/api/admin/paths/order-edits.yaml rename to docs/api/admin/paths/admin_order-edits.yaml index 3f4a409171..6468d3b538 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/admin_order-edits.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostOrderEdits - summary: Create an OrderEdit - description: Creates an OrderEdit. - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostOrderEditsReq.yaml - x-authenticated: true - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/order-edits/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/order-edits/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminOrderEditsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetOrderEdits summary: List OrderEdits @@ -88,16 +43,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits/get.js + $ref: ../code_samples/JavaScript/admin_order-edits/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits/get.sh + $ref: ../code_samples/Shell/admin_order-edits/get.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK @@ -117,3 +72,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostOrderEdits + summary: Create an OrderEdit + description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostOrderEditsReq.yaml + x-authenticated: true + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_order-edits/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_order-edits/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminOrderEditsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/admin_order-edits_{id}.yaml similarity index 87% rename from docs/api/admin/paths/order-edits_{id}.yaml rename to docs/api/admin/paths/admin_order-edits_{id}.yaml index 6ec5af4de5..babe0b977d 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}.yaml @@ -1,40 +1,3 @@ -delete: - operationId: DeleteOrderEditsOrderEdit - summary: Delete an Order Edit - description: Delete an Order Edit - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/order-edits_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/order-edits_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminOrderEditDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml get: operationId: GetOrderEditsOrderEdit summary: Get an OrderEdit @@ -64,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/get.js + $ref: ../code_samples/JavaScript/admin_order-edits_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/get.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK @@ -116,16 +79,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/post.js + $ref: ../code_samples/JavaScript/admin_order-edits_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/post.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK @@ -145,3 +108,40 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteOrderEditsOrderEdit + summary: Delete an Order Edit + description: Delete an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_order-edits_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_order-edits_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminOrderEditDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_cancel.yaml b/docs/api/admin/paths/admin_order-edits_{id}_cancel.yaml similarity index 84% rename from docs/api/admin/paths/order-edits_{id}_cancel.yaml rename to docs/api/admin/paths/admin_order-edits_{id}_cancel.yaml index f1ef280a37..c96aa11406 100644 --- a/docs/api/admin/paths/order-edits_{id}_cancel.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}_cancel.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_cancel/post.js + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_cancel/post.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml b/docs/api/admin/paths/admin_order-edits_{id}_changes_{change_id}.yaml similarity index 82% rename from docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml rename to docs/api/admin/paths/admin_order-edits_{id}_changes_{change_id}.yaml index 492c02d3ed..1d12d2f785 100644 --- a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}_changes_{change_id}.yaml @@ -23,16 +23,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/order-edits_{id}_changes_{change_id}/delete.js + ../code_samples/JavaScript/admin_order-edits_{id}_changes_{change_id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_changes_{change_id}/delete.sh + $ref: >- + ../code_samples/Shell/admin_order-edits_{id}_changes_{change_id}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/admin/paths/order-edits_{id}_confirm.yaml b/docs/api/admin/paths/admin_order-edits_{id}_confirm.yaml similarity index 84% rename from docs/api/admin/paths/order-edits_{id}_confirm.yaml rename to docs/api/admin/paths/admin_order-edits_{id}_confirm.yaml index 0d7d0e05e6..712c203243 100644 --- a/docs/api/admin/paths/order-edits_{id}_confirm.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}_confirm.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_confirm/post.js + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_confirm/post.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}_confirm/post.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/admin_order-edits_{id}_items.yaml similarity index 87% rename from docs/api/admin/paths/order-edits_{id}_items.yaml rename to docs/api/admin/paths/admin_order-edits_{id}_items.yaml index 1dddf39282..315462160a 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}_items.yaml @@ -21,16 +21,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_items/post.js + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_items/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_items/post.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}_items/post.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml b/docs/api/admin/paths/admin_order-edits_{id}_items_{item_id}.yaml similarity index 87% rename from docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml rename to docs/api/admin/paths/admin_order-edits_{id}_items_{item_id}.yaml index 7d9279065d..1c42d69dba 100644 --- a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}_items_{item_id}.yaml @@ -1,56 +1,3 @@ -delete: - operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete a Line Item - description: Delete line items from an order edit and create change item - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete from. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to delete from order. - schema: - type: string - x-codegen: - method: removeLineItem - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/order-edits_{id}_items_{item_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/order-edits_{id}_items_{item_id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminOrderEditsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostOrderEditsEditLineItemsLineItem summary: Upsert Line Item Change @@ -81,16 +28,71 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_items_{item_id}/post.js + $ref: >- + ../code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_items_{item_id}/post.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}_items_{item_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminOrderEditsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteOrderEditsOrderEditLineItemsLineItem + summary: Delete a Line Item + description: Delete line items from an order edit and create change item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete from. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to delete from order. + schema: + type: string + x-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_order-edits_{id}_items_{item_id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order Edits responses: '200': description: OK diff --git a/docs/api/admin/paths/order-edits_{id}_request.yaml b/docs/api/admin/paths/admin_order-edits_{id}_request.yaml similarity index 85% rename from docs/api/admin/paths/order-edits_{id}_request.yaml rename to docs/api/admin/paths/admin_order-edits_{id}_request.yaml index b73c2cbbdc..e2d1cf87a1 100644 --- a/docs/api/admin/paths/order-edits_{id}_request.yaml +++ b/docs/api/admin/paths/admin_order-edits_{id}_request.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_request/post.js + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_request/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_request/post.sh + $ref: ../code_samples/Shell/admin_order-edits_{id}_request/post.sh security: - api_token: [] - cookie_auth: [] tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/admin/paths/orders.yaml b/docs/api/admin/paths/admin_orders.yaml similarity index 98% rename from docs/api/admin/paths/orders.yaml rename to docs/api/admin/paths/admin_orders.yaml index d2eab3db64..7684574ecf 100644 --- a/docs/api/admin/paths/orders.yaml +++ b/docs/api/admin/paths/admin_orders.yaml @@ -224,16 +224,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders/get.js + $ref: ../code_samples/JavaScript/admin_orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders/get.sh + $ref: ../code_samples/Shell/admin_orders/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/admin_orders_{id}.yaml similarity index 91% rename from docs/api/admin/paths/orders_{id}.yaml rename to docs/api/admin/paths/admin_orders_{id}.yaml index 555f7b277a..332fca38cd 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/admin_orders_{id}.yaml @@ -27,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}/get.js + $ref: ../code_samples/JavaScript/admin_orders_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}/get.sh + $ref: ../code_samples/Shell/admin_orders_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK @@ -90,16 +90,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/admin_orders_{id}_archive.yaml similarity index 89% rename from docs/api/admin/paths/orders_{id}_archive.yaml rename to docs/api/admin/paths/admin_orders_{id}_archive.yaml index 10fbab9ecc..7d1a27ae62 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_archive.yaml @@ -27,16 +27,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_archive/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_archive/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_archive/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_archive/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/admin_orders_{id}_cancel.yaml similarity index 91% rename from docs/api/admin/paths/orders_{id}_cancel.yaml rename to docs/api/admin/paths/admin_orders_{id}_cancel.yaml index 7c499cbd0a..aa327c0ad9 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_cancel.yaml @@ -30,16 +30,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_cancel/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_cancel/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/admin_orders_{id}_capture.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_capture.yaml rename to docs/api/admin/paths/admin_orders_{id}_capture.yaml index 240ae56920..ff87be29a0 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_capture.yaml @@ -27,16 +27,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_capture/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_capture/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_capture/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_capture/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/admin_orders_{id}_claims.yaml similarity index 90% rename from docs/api/admin/paths/order_{id}_claims.yaml rename to docs/api/admin/paths/admin_orders_{id}_claims.yaml index b9e5445e8c..29f9c96132 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_claims.yaml @@ -32,16 +32,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order_{id}_claims/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_claims/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order_{id}_claims/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_claims/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}.yaml similarity index 90% rename from docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml rename to docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}.yaml index a91f61b942..bf90d5336e 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}.yaml @@ -38,16 +38,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order_{id}_claims_{claim_id}/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order_{id}_claims_{claim_id}/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_claims_{claim_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_cancel.yaml similarity index 88% rename from docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml rename to docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_cancel.yaml index c380d75a35..bdd9327b38 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_cancel.yaml @@ -34,16 +34,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/post.js + ../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/post.sh + $ref: >- + ../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_fulfillments.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml rename to docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_fulfillments.yaml index 4c0fa7d0a4..b759165741 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_fulfillments.yaml @@ -40,17 +40,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/post.js + ../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/post.sh + ../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml similarity index 88% rename from docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml rename to docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml index dcfb4b1201..b15fba082b 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -40,17 +40,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js + ../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh + ../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_shipments.yaml similarity index 89% rename from docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml rename to docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_shipments.yaml index c510f0ac12..9f3414c595 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_claims_{claim_id}_shipments.yaml @@ -40,16 +40,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/post.js + ../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_shipments/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/post.sh + $ref: >- + ../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_shipments/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Claim + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/admin_orders_{id}_complete.yaml similarity index 89% rename from docs/api/admin/paths/orders_{id}_complete.yaml rename to docs/api/admin/paths/admin_orders_{id}_complete.yaml index 29d3d5a529..05cf138228 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_complete.yaml @@ -27,16 +27,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_complete/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_complete/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_complete/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_complete/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/admin_orders_{id}_fulfillment.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_fulfillment.yaml rename to docs/api/admin/paths/admin_orders_{id}_fulfillment.yaml index 78331b8a72..cfe8f822d3 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_fulfillment.yaml @@ -34,16 +34,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_fulfillment/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_fulfillment/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_fulfillment/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_fulfillment/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml similarity index 88% rename from docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml rename to docs/api/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index ad8e739fda..f4dad676ea 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -34,17 +34,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js + ../code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh + ../code_samples/Shell/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml b/docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml similarity index 88% rename from docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml rename to docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml index 4b7fa823ef..de5c19f75c 100644 --- a/docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml @@ -28,17 +28,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/post.js + ../code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/post.sh + ../code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/admin_orders_{id}_refund.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_refund.yaml rename to docs/api/admin/paths/admin_orders_{id}_refund.yaml index d05590568a..e7e8c9d5d2 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_refund.yaml @@ -32,16 +32,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_refund/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_refund/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_refund/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_refund/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_reservations.yaml b/docs/api/admin/paths/admin_orders_{id}_reservations.yaml similarity index 84% rename from docs/api/admin/paths/orders_{id}_reservations.yaml rename to docs/api/admin/paths/admin_orders_{id}_reservations.yaml index 3d45df09ae..ee4eacdca8 100644 --- a/docs/api/admin/paths/orders_{id}_reservations.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_reservations.yaml @@ -26,23 +26,23 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_reservations/get.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_reservations/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_reservations/get.sh + $ref: ../code_samples/Shell/admin_orders_{id}_reservations/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/AdminGetReservationReservationsReq.yaml + $ref: ../components/schemas/AdminReservationsListRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_return.yaml b/docs/api/admin/paths/admin_orders_{id}_return.yaml similarity index 91% rename from docs/api/admin/paths/orders_{id}_return.yaml rename to docs/api/admin/paths/admin_orders_{id}_return.yaml index d034374384..c7b4d0dd37 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_return.yaml @@ -34,17 +34,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_return/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_return/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_return/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_return/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Return - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/admin_orders_{id}_shipment.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_shipment.yaml rename to docs/api/admin/paths/admin_orders_{id}_shipment.yaml index 138e916c1b..7e1db41a59 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_shipment.yaml @@ -32,16 +32,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_shipment/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_shipment/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_shipment/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_shipment/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/admin_orders_{id}_shipping-methods.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_shipping-methods.yaml rename to docs/api/admin/paths/admin_orders_{id}_shipping-methods.yaml index 27014e6203..20a6337d61 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_shipping-methods.yaml @@ -34,16 +34,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_shipping-methods/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_shipping-methods/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_shipping-methods/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_shipping-methods/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/admin_orders_{id}_swaps.yaml similarity index 91% rename from docs/api/admin/paths/order_{id}_swaps.yaml rename to docs/api/admin/paths/admin_orders_{id}_swaps.yaml index 1aa00a6fb7..79228b7c95 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_swaps.yaml @@ -38,16 +38,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order_{id}_swaps/post.js + $ref: ../code_samples/JavaScript/admin_orders_{id}_swaps/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order_{id}_swaps/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_swaps/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_cancel.yaml similarity index 88% rename from docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml rename to docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_cancel.yaml index 2dec550158..e757819c8e 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_cancel.yaml @@ -33,16 +33,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/post.js + $ref: >- + ../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/post.sh + $ref: ../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_fulfillments.yaml similarity index 89% rename from docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml rename to docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_fulfillments.yaml index cacdf51ac9..71604f75da 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_fulfillments.yaml @@ -40,16 +40,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/post.js + ../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/post.sh + $ref: >- + ../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml similarity index 88% rename from docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml rename to docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml index e1a205e7e9..40505d55ec 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -40,17 +40,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js + ../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh + ../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Fulfillment + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_process-payment.yaml similarity index 90% rename from docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml rename to docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_process-payment.yaml index c5aca27e66..9259fe9d9d 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_process-payment.yaml @@ -37,17 +37,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/post.js + ../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_process-payment/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/post.sh + ../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_process-payment/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_shipments.yaml similarity index 89% rename from docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml rename to docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_shipments.yaml index 8339a2ea01..833e9402bd 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_swaps_{swap_id}_shipments.yaml @@ -39,16 +39,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/post.js + ../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_shipments/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/post.sh + $ref: >- + ../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_shipments/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Orders responses: '200': description: OK diff --git a/docs/api/admin/paths/payment-collections_{id}.yaml b/docs/api/admin/paths/admin_payment-collections_{id}.yaml similarity index 85% rename from docs/api/admin/paths/payment-collections_{id}.yaml rename to docs/api/admin/paths/admin_payment-collections_{id}.yaml index 164df9dcd2..b6ea47c195 100644 --- a/docs/api/admin/paths/payment-collections_{id}.yaml +++ b/docs/api/admin/paths/admin_payment-collections_{id}.yaml @@ -1,42 +1,3 @@ -delete: - operationId: DeletePaymentCollectionsPaymentCollection - summary: Del a PaymentCollection - description: Deletes a Payment Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collection to delete. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/payment-collections_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/payment-collections_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - PaymentCollection - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminPaymentCollectionDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml get: operationId: GetPaymentCollectionsPaymentCollection summary: Get a PaymentCollection @@ -61,21 +22,21 @@ get: type: string x-codegen: method: retrieve - queryParams: GetPaymentCollectionsParams + queryParams: AdminGetPaymentCollectionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}/get.js + $ref: ../code_samples/JavaScript/admin_payment-collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/get.sh + $ref: ../code_samples/Shell/admin_payment-collections_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK @@ -118,16 +79,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}/post.js + $ref: ../code_samples/JavaScript/admin_payment-collections_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/post.sh + $ref: ../code_samples/Shell/admin_payment-collections_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK @@ -147,3 +108,42 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Del a PaymentCollection + description: Deletes a Payment Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_payment-collections_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_payment-collections_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPaymentCollectionDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml diff --git a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml b/docs/api/admin/paths/admin_payment-collections_{id}_authorize.yaml similarity index 84% rename from docs/api/admin/paths/payment-collections_{id}_authorize.yaml rename to docs/api/admin/paths/admin_payment-collections_{id}_authorize.yaml index 54779435e2..1d7534f1e0 100644 --- a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml +++ b/docs/api/admin/paths/admin_payment-collections_{id}_authorize.yaml @@ -16,16 +16,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}_authorize/post.js + $ref: >- + ../code_samples/JavaScript/admin_payment-collections_{id}_authorize/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}_authorize/post.sh + $ref: ../code_samples/Shell/admin_payment-collections_{id}_authorize/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/admin/paths/payments_{id}.yaml b/docs/api/admin/paths/admin_payments_{id}.yaml similarity index 88% rename from docs/api/admin/paths/payments_{id}.yaml rename to docs/api/admin/paths/admin_payments_{id}.yaml index 6d17d9769a..c746517ef1 100644 --- a/docs/api/admin/paths/payments_{id}.yaml +++ b/docs/api/admin/paths/admin_payments_{id}.yaml @@ -17,16 +17,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payments_{id}/get.js + $ref: ../code_samples/JavaScript/admin_payments_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payments_{id}/get.sh + $ref: ../code_samples/Shell/admin_payments_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Payment + - Payments responses: '200': description: OK diff --git a/docs/api/admin/paths/payments_{id}_capture.yaml b/docs/api/admin/paths/admin_payments_{id}_capture.yaml similarity index 86% rename from docs/api/admin/paths/payments_{id}_capture.yaml rename to docs/api/admin/paths/admin_payments_{id}_capture.yaml index accd276fbd..13d67f1ce7 100644 --- a/docs/api/admin/paths/payments_{id}_capture.yaml +++ b/docs/api/admin/paths/admin_payments_{id}_capture.yaml @@ -16,16 +16,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payments_{id}_capture/post.js + $ref: ../code_samples/JavaScript/admin_payments_{id}_capture/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payments_{id}_capture/post.sh + $ref: ../code_samples/Shell/admin_payments_{id}_capture/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Payment + - Payments responses: '200': description: OK diff --git a/docs/api/admin/paths/payments_{id}_refund.yaml b/docs/api/admin/paths/admin_payments_{id}_refund.yaml similarity index 88% rename from docs/api/admin/paths/payments_{id}_refund.yaml rename to docs/api/admin/paths/admin_payments_{id}_refund.yaml index a3bf0f7140..52ccbc14be 100644 --- a/docs/api/admin/paths/payments_{id}_refund.yaml +++ b/docs/api/admin/paths/admin_payments_{id}_refund.yaml @@ -21,16 +21,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payments_{id}_refund/post.js + $ref: ../code_samples/JavaScript/admin_payments_{id}_refund/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payments_{id}_refund/post.sh + $ref: ../code_samples/Shell/admin_payments_{id}_refund/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Payment + - Payments responses: '200': description: OK diff --git a/docs/api/admin/paths/price-lists.yaml b/docs/api/admin/paths/admin_price-lists.yaml similarity index 95% rename from docs/api/admin/paths/price-lists.yaml rename to docs/api/admin/paths/admin_price-lists.yaml index 002ea6e12e..0977730c13 100644 --- a/docs/api/admin/paths/price-lists.yaml +++ b/docs/api/admin/paths/admin_price-lists.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostPriceListsPriceList - summary: Create a Price List - description: Creates a Price List - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostPriceListsPriceListReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/price-lists/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/price-lists/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Price List - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminPriceListRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetPriceLists summary: List Price Lists @@ -196,16 +151,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists/get.js + $ref: ../code_samples/JavaScript/admin_price-lists/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists/get.sh + $ref: ../code_samples/Shell/admin_price-lists/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK @@ -225,3 +180,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostPriceListsPriceList + summary: Create a Price List + description: Creates a Price List + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostPriceListsPriceListReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_price-lists/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_price-lists/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPriceListRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/price-lists_{id}.yaml b/docs/api/admin/paths/admin_price-lists_{id}.yaml similarity index 87% rename from docs/api/admin/paths/price-lists_{id}.yaml rename to docs/api/admin/paths/admin_price-lists_{id}.yaml index ac25394799..b3b945aab9 100644 --- a/docs/api/admin/paths/price-lists_{id}.yaml +++ b/docs/api/admin/paths/admin_price-lists_{id}.yaml @@ -1,50 +1,3 @@ -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 - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/price-lists_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/price-lists_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Price List - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminPriceListDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetPriceListsPriceList summary: Get a Price List @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}/get.js + $ref: ../code_samples/JavaScript/admin_price-lists_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}/get.sh + $ref: ../code_samples/Shell/admin_price-lists_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}/post.js + $ref: ../code_samples/JavaScript/admin_price-lists_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}/post.sh + $ref: ../code_samples/Shell/admin_price-lists_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +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 + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_price-lists_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPriceListDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml b/docs/api/admin/paths/admin_price-lists_{id}_prices_batch.yaml similarity index 87% rename from docs/api/admin/paths/price-lists_{id}_prices_batch.yaml rename to docs/api/admin/paths/admin_price-lists_{id}_prices_batch.yaml index 5938b2505a..f270584d8c 100644 --- a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml +++ b/docs/api/admin/paths/admin_price-lists_{id}_prices_batch.yaml @@ -21,16 +21,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}_prices_batch/post.js + $ref: ../code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}_prices_batch/post.sh + $ref: ../code_samples/Shell/admin_price-lists_{id}_prices_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK @@ -75,16 +75,17 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}_prices_batch/delete.js + $ref: >- + ../code_samples/JavaScript/admin_price-lists_{id}_prices_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}_prices_batch/delete.sh + $ref: ../code_samples/Shell/admin_price-lists_{id}_prices_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK diff --git a/docs/api/admin/paths/price-lists_{id}_products.yaml b/docs/api/admin/paths/admin_price-lists_{id}_products.yaml similarity index 97% rename from docs/api/admin/paths/price-lists_{id}_products.yaml rename to docs/api/admin/paths/admin_price-lists_{id}_products.yaml index b79f613361..16455aaeb7 100644 --- a/docs/api/admin/paths/price-lists_{id}_products.yaml +++ b/docs/api/admin/paths/admin_price-lists_{id}_products.yaml @@ -183,16 +183,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}_products/get.js + $ref: ../code_samples/JavaScript/admin_price-lists_{id}_products/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}_products/get.sh + $ref: ../code_samples/Shell/admin_price-lists_{id}_products/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK diff --git a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml b/docs/api/admin/paths/admin_price-lists_{id}_products_{product_id}_prices.yaml similarity index 87% rename from docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml rename to docs/api/admin/paths/admin_price-lists_{id}_products_{product_id}_prices.yaml index f2e06239ba..9ec17f197a 100644 --- a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml +++ b/docs/api/admin/paths/admin_price-lists_{id}_products_{product_id}_prices.yaml @@ -25,17 +25,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/delete.js + ../code_samples/JavaScript/admin_price-lists_{id}_products_{product_id}_prices/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/price-lists_{id}_products_{product_id}_prices/delete.sh + ../code_samples/Shell/admin_price-lists_{id}_products_{product_id}_prices/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK diff --git a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml b/docs/api/admin/paths/admin_price-lists_{id}_variants_{variant_id}_prices.yaml similarity index 87% rename from docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml rename to docs/api/admin/paths/admin_price-lists_{id}_variants_{variant_id}_prices.yaml index b0f3ba05bc..c5e55267ab 100644 --- a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml +++ b/docs/api/admin/paths/admin_price-lists_{id}_variants_{variant_id}_prices.yaml @@ -25,17 +25,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/delete.js + ../code_samples/JavaScript/admin_price-lists_{id}_variants_{variant_id}_prices/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/delete.sh + ../code_samples/Shell/admin_price-lists_{id}_variants_{variant_id}_prices/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Price List + - Price Lists responses: '200': description: OK diff --git a/docs/api/admin/paths/product-categories.yaml b/docs/api/admin/paths/admin_product-categories.yaml similarity index 88% rename from docs/api/admin/paths/product-categories.yaml rename to docs/api/admin/paths/admin_product-categories.yaml index 46547aa740..2c276a7b4c 100644 --- a/docs/api/admin/paths/product-categories.yaml +++ b/docs/api/admin/paths/admin_product-categories.yaml @@ -1,60 +1,3 @@ -post: - operationId: PostProductCategories - summary: Create a Product Category - description: Creates a Product Category. - x-authenticated: true - parameters: - - in: query - name: expand - description: (Comma separated) Which fields should be expanded in the results. - schema: - type: string - - in: query - name: fields - description: (Comma separated) Which fields should be retrieved in the results. - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostProductCategoriesReq.yaml - x-codegen: - method: create - queryParams: AdminPostProductCategoriesParams - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/product-categories/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/product-categories/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product Category - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetProductCategories summary: List Product Categories @@ -76,6 +19,11 @@ get: description: Search for only active categories schema: type: boolean + - in: query + name: include_descendants_tree + description: Include all nested descendants of category + schema: + type: boolean - in: query name: parent_category_id description: Returns categories scoped by parent @@ -114,16 +62,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-categories/get.js + $ref: ../code_samples/JavaScript/admin_product-categories/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories/get.sh + $ref: ../code_samples/Shell/admin_product-categories/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK @@ -143,3 +91,60 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostProductCategories + summary: Create a Product Category + description: Creates a Product Category. + x-authenticated: true + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostProductCategoriesReq.yaml + x-codegen: + method: create + queryParams: AdminPostProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_product-categories/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_product-categories/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/product-categories_{id}.yaml b/docs/api/admin/paths/admin_product-categories_{id}.yaml similarity index 88% rename from docs/api/admin/paths/product-categories_{id}.yaml rename to docs/api/admin/paths/admin_product-categories_{id}.yaml index 21620dc360..eb4079c382 100644 --- a/docs/api/admin/paths/product-categories_{id}.yaml +++ b/docs/api/admin/paths/admin_product-categories_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteProductCategoriesCategory - summary: Delete a Product Category - description: Deletes a ProductCategory. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product Category - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/product-categories_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/product-categories_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product Category - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetProductCategoriesCategory summary: Get a Product Category @@ -74,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-categories_{id}/get.js + $ref: ../code_samples/JavaScript/admin_product-categories_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/get.sh + $ref: ../code_samples/Shell/admin_product-categories_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK @@ -141,16 +94,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-categories_{id}/post.js + $ref: ../code_samples/JavaScript/admin_product-categories_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/post.sh + $ref: ../code_samples/Shell/admin_product-categories_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK @@ -170,3 +123,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteProductCategoriesCategory + summary: Delete a Product Category + description: Deletes a ProductCategory. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_product-categories_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_product-categories_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/product-categories_{id}_products_batch.yaml b/docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml similarity index 88% rename from docs/api/admin/paths/product-categories_{id}_products_batch.yaml rename to docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml index ae45b7c7f2..178c3b328e 100644 --- a/docs/api/admin/paths/product-categories_{id}_products_batch.yaml +++ b/docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml @@ -34,16 +34,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/product-categories_{id}_products_batch/post.js + ../code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}_products_batch/post.sh + $ref: >- + ../code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK @@ -99,16 +100,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/product-categories_{id}_products_batch/delete.js + ../code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}_products_batch/delete.sh + $ref: >- + ../code_samples/Shell/admin_product-categories_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/admin_product-tags.yaml similarity index 95% rename from docs/api/admin/paths/product-tags.yaml rename to docs/api/admin/paths/admin_product-tags.yaml index f933093037..8077cd2da6 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/admin_product-tags.yaml @@ -100,16 +100,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-tags/get.js + $ref: ../code_samples/JavaScript/admin_product-tags/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-tags/get.sh + $ref: ../code_samples/Shell/admin_product-tags/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Tag + - Product Tags responses: '200': description: OK diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/admin_product-types.yaml similarity index 95% rename from docs/api/admin/paths/product-types.yaml rename to docs/api/admin/paths/admin_product-types.yaml index 1077ae9426..b31a17e380 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/admin_product-types.yaml @@ -100,16 +100,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-types/get.js + $ref: ../code_samples/JavaScript/admin_product-types/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-types/get.sh + $ref: ../code_samples/Shell/admin_product-types/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Type + - Product Types responses: '200': description: OK diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/admin_products.yaml similarity index 96% rename from docs/api/admin/paths/products.yaml rename to docs/api/admin/paths/admin_products.yaml index 7b599fb1fa..015cdbce7c 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/admin_products.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostProducts - summary: Create a Product - x-authenticated: true - description: Creates a Product - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostProductsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/products/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/products/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetProducts summary: List Products @@ -271,16 +226,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products/get.js + $ref: ../code_samples/JavaScript/admin_products/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products/get.sh + $ref: ../code_samples/Shell/admin_products/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK @@ -300,3 +255,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostProducts + summary: Create a Product + x-authenticated: true + description: Creates a Product + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostProductsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_products/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_products/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/products_tag-usage.yaml b/docs/api/admin/paths/admin_products_tag-usage.yaml similarity index 86% rename from docs/api/admin/paths/products_tag-usage.yaml rename to docs/api/admin/paths/admin_products_tag-usage.yaml index 31544af7da..4abbf654ec 100644 --- a/docs/api/admin/paths/products_tag-usage.yaml +++ b/docs/api/admin/paths/admin_products_tag-usage.yaml @@ -9,16 +9,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_tag-usage/get.js + $ref: ../code_samples/JavaScript/admin_products_tag-usage/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_tag-usage/get.sh + $ref: ../code_samples/Shell/admin_products_tag-usage/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Tag + - Products responses: '200': description: OK diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/admin_products_types.yaml similarity index 86% rename from docs/api/admin/paths/products_types.yaml rename to docs/api/admin/paths/admin_products_types.yaml index 668e7a7609..949a963437 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/admin_products_types.yaml @@ -10,16 +10,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_types/get.js + $ref: ../code_samples/JavaScript/admin_products_types/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_types/get.sh + $ref: ../code_samples/Shell/admin_products_types/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK diff --git a/docs/api/admin/paths/products_{id}.yaml b/docs/api/admin/paths/admin_products_{id}.yaml similarity index 88% rename from docs/api/admin/paths/products_{id}.yaml rename to docs/api/admin/paths/admin_products_{id}.yaml index 7ecf980012..36cf087796 100644 --- a/docs/api/admin/paths/products_{id}.yaml +++ b/docs/api/admin/paths/admin_products_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteProductsProduct - summary: Delete a Product - description: Deletes a Product and it's associated Product Variants. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/products_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/products_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetProductsProduct summary: Get a Product @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/get.js + $ref: ../code_samples/JavaScript/admin_products_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/get.sh + $ref: ../code_samples/Shell/admin_products_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/post.js + $ref: ../code_samples/JavaScript/admin_products_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/post.sh + $ref: ../code_samples/Shell/admin_products_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteProductsProduct + summary: Delete a Product + description: Deletes a Product and it's associated Product Variants. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_products_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_products_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/products_{id}_metadata.yaml b/docs/api/admin/paths/admin_products_{id}_metadata.yaml similarity index 88% rename from docs/api/admin/paths/products_{id}_metadata.yaml rename to docs/api/admin/paths/admin_products_{id}_metadata.yaml index 3440873c7d..5a0b4f1cfe 100644 --- a/docs/api/admin/paths/products_{id}_metadata.yaml +++ b/docs/api/admin/paths/admin_products_{id}_metadata.yaml @@ -21,16 +21,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_metadata/post.js + $ref: ../code_samples/JavaScript/admin_products_{id}_metadata/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_metadata/post.sh + $ref: ../code_samples/Shell/admin_products_{id}_metadata/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK diff --git a/docs/api/admin/paths/products_{id}_options.yaml b/docs/api/admin/paths/admin_products_{id}_options.yaml similarity index 88% rename from docs/api/admin/paths/products_{id}_options.yaml rename to docs/api/admin/paths/admin_products_{id}_options.yaml index 3712d6bc71..ac1388e566 100644 --- a/docs/api/admin/paths/products_{id}_options.yaml +++ b/docs/api/admin/paths/admin_products_{id}_options.yaml @@ -21,16 +21,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_options/post.js + $ref: ../code_samples/JavaScript/admin_products_{id}_options/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_options/post.sh + $ref: ../code_samples/Shell/admin_products_{id}_options/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK diff --git a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml b/docs/api/admin/paths/admin_products_{id}_options_{option_id}.yaml similarity index 87% rename from docs/api/admin/paths/products_{id}_options_{option_id}.yaml rename to docs/api/admin/paths/admin_products_{id}_options_{option_id}.yaml index 4250264983..c7c21d88bb 100644 --- a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml +++ b/docs/api/admin/paths/admin_products_{id}_options_{option_id}.yaml @@ -1,59 +1,3 @@ -delete: - operationId: DeleteProductsProductOptionsOption - summary: Delete a Product Option - description: >- - Deletes a Product Option. Before a Product Option can be deleted all Option - Values for the Product Option must be the same. You may, for example, have - to delete some of your variants prior to deleting the Product Option - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: option_id - required: true - description: The ID of the Product Option. - schema: - type: string - x-codegen: - method: deleteOption - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/products_{id}_options_{option_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/products_{id}_options_{option_id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductsDeleteOptionRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostProductsProductOptionsOption summary: Update a Product Option @@ -83,16 +27,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_options_{option_id}/post.js + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_options_{option_id}/post.sh + $ref: ../code_samples/Shell/admin_products_{id}_options_{option_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK @@ -112,3 +57,61 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteProductsProductOptionsOption + summary: Delete a Product Option + description: >- + Deletes a Product Option. Before a Product Option can be deleted all Option + Values for the Product Option must be the same. You may, for example, have + to delete some of your variants prior to deleting the Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + x-codegen: + method: deleteOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_products_{id}_options_{option_id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductsDeleteOptionRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/products_{id}_variants.yaml b/docs/api/admin/paths/admin_products_{id}_variants.yaml similarity index 92% rename from docs/api/admin/paths/products_{id}_variants.yaml rename to docs/api/admin/paths/admin_products_{id}_variants.yaml index 408793da9a..ebfc2551a2 100644 --- a/docs/api/admin/paths/products_{id}_variants.yaml +++ b/docs/api/admin/paths/admin_products_{id}_variants.yaml @@ -1,57 +1,3 @@ -post: - operationId: PostProductsProductVariants - summary: Create a Product Variant - description: >- - Creates a Product Variant. Each Product Variant must have a unique - combination of Product Option Values. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostProductsProductVariantsReq.yaml - x-codegen: - method: createVariant - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/products_{id}_variants/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/products_{id}_variants/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetProductsProductVariants summary: List a Product's Variants @@ -93,12 +39,12 @@ get: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_variants/get.sh + $ref: ../code_samples/Shell/admin_products_{id}_variants/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK @@ -118,3 +64,57 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostProductsProductVariants + summary: Create a Product Variant + description: >- + Creates a Product Variant. Each Product Variant must have a unique + combination of Product Option Values. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostProductsProductVariantsReq.yaml + x-codegen: + method: createVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_products_{id}_variants/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_products_{id}_variants/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml b/docs/api/admin/paths/admin_products_{id}_variants_{variant_id}.yaml similarity index 86% rename from docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml rename to docs/api/admin/paths/admin_products_{id}_variants_{variant_id}.yaml index 52cead6eca..c42bce30e3 100644 --- a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml +++ b/docs/api/admin/paths/admin_products_{id}_variants_{variant_id}.yaml @@ -1,57 +1,3 @@ -delete: - operationId: DeleteProductsProductVariantsVariant - summary: Delete a Product Variant - description: Deletes a Product Variant. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product. - schema: - type: string - - in: path - name: variant_id - required: true - description: The ID of the Product Variant. - schema: - type: string - x-codegen: - method: deleteVariant - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/products_{id}_variants_{variant_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/products_{id}_variants_{variant_id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminProductsDeleteVariantRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostProductsProductVariantsVariant summary: Update a Product Variant @@ -82,16 +28,18 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_variants_{variant_id}/post.js + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_variants_{variant_id}/post.sh + $ref: >- + ../code_samples/Shell/admin_products_{id}_variants_{variant_id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Product + - Products responses: '200': description: OK @@ -111,3 +59,58 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteProductsProductVariantsVariant + summary: Delete a Product Variant + description: Deletes a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + x-codegen: + method: deleteVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_products_{id}_variants_{variant_id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductsDeleteVariantRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/publishable-api-key_{id}.yaml b/docs/api/admin/paths/admin_publishable-api-key_{id}.yaml similarity index 87% rename from docs/api/admin/paths/publishable-api-key_{id}.yaml rename to docs/api/admin/paths/admin_publishable-api-key_{id}.yaml index 18f468adf5..bf53950b68 100644 --- a/docs/api/admin/paths/publishable-api-key_{id}.yaml +++ b/docs/api/admin/paths/admin_publishable-api-key_{id}.yaml @@ -22,16 +22,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-key_{id}/post.js + $ref: ../code_samples/JavaScript/admin_publishable-api-key_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-key_{id}/post.sh + $ref: ../code_samples/Shell/admin_publishable-api-key_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK diff --git a/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/admin_publishable-api-keys.yaml similarity index 89% rename from docs/api/admin/paths/publishable-api-keys.yaml rename to docs/api/admin/paths/admin_publishable-api-keys.yaml index c70d47abb0..3b2eac0bee 100644 --- a/docs/api/admin/paths/publishable-api-keys.yaml +++ b/docs/api/admin/paths/admin_publishable-api-keys.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostPublishableApiKeys - summary: Create PublishableApiKey - description: Creates a PublishableApiKey. - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostPublishableApiKeysReq.yaml - x-authenticated: true - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/publishable-api-keys/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/publishable-api-keys/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - PublishableApiKey - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminPublishableApiKeysRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetPublishableApiKeys summary: List PublishableApiKeys @@ -83,16 +38,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys/get.js + $ref: ../code_samples/JavaScript/admin_publishable-api-keys/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys/get.sh + $ref: ../code_samples/Shell/admin_publishable-api-keys/get.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK @@ -112,3 +67,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostPublishableApiKeys + summary: Create PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostPublishableApiKeysReq.yaml + x-authenticated: true + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_publishable-api-keys/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_publishable-api-keys/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPublishableApiKeysRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/publishable-api-keys_{id}.yaml b/docs/api/admin/paths/admin_publishable-api-keys_{id}.yaml similarity index 83% rename from docs/api/admin/paths/publishable-api-keys_{id}.yaml rename to docs/api/admin/paths/admin_publishable-api-keys_{id}.yaml index b220a81531..9cd04da177 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}.yaml +++ b/docs/api/admin/paths/admin_publishable-api-keys_{id}.yaml @@ -1,40 +1,3 @@ -delete: - operationId: DeletePublishableApiKeysPublishableApiKey - summary: Delete PublishableApiKey - description: Deletes a PublishableApiKeys - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the PublishableApiKeys to delete. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - PublishableApiKey - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminPublishableApiKeyDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml get: operationId: GetPublishableApiKeysPublishableApiKey summary: Get a PublishableApiKey @@ -53,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/get.js + $ref: ../code_samples/JavaScript/admin_publishable-api-keys_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}/get.sh + $ref: ../code_samples/Shell/admin_publishable-api-keys_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK @@ -82,3 +45,40 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_publishable-api-keys_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_publishable-api-keys_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Keys + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPublishableApiKeyDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml b/docs/api/admin/paths/admin_publishable-api-keys_{id}_revoke.yaml similarity index 84% rename from docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml rename to docs/api/admin/paths/admin_publishable-api-keys_{id}_revoke.yaml index 357160386e..76f259ad17 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml +++ b/docs/api/admin/paths/admin_publishable-api-keys_{id}_revoke.yaml @@ -16,16 +16,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys_{id}_revoke/post.js + $ref: >- + ../code_samples/JavaScript/admin_publishable-api-keys_{id}_revoke/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}_revoke/post.sh + $ref: ../code_samples/Shell/admin_publishable-api-keys_{id}_revoke/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml b/docs/api/admin/paths/admin_publishable-api-keys_{id}_sales-channels.yaml similarity index 86% rename from docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml rename to docs/api/admin/paths/admin_publishable-api-keys_{id}_sales-channels.yaml index 549f69c3e5..1e94dfba13 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml +++ b/docs/api/admin/paths/admin_publishable-api-keys_{id}_sales-channels.yaml @@ -23,16 +23,17 @@ get: label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/get.js + ../code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}_sales-channels/get.sh + $ref: >- + ../code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels/get.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/admin_publishable-api-keys_{id}_sales-channels_batch.yaml similarity index 86% rename from docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml rename to docs/api/admin/paths/admin_publishable-api-keys_{id}_sales-channels_batch.yaml index 7e13a1a0a2..6a4b968f3f 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml +++ b/docs/api/admin/paths/admin_publishable-api-keys_{id}_sales-channels_batch.yaml @@ -23,17 +23,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/post.js + ../code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels_batch/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/post.sh + ../code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK @@ -78,17 +78,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/delete.js + ../code_samples/JavaScript/admin_publishable-api-keys_{id}_sales-channels_batch/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/delete.sh + ../code_samples/Shell/admin_publishable-api-keys_{id}_sales-channels_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - PublishableApiKey + - Publishable Api Keys responses: '200': description: OK diff --git a/docs/api/admin/paths/regions.yaml b/docs/api/admin/paths/admin_regions.yaml similarity index 91% rename from docs/api/admin/paths/regions.yaml rename to docs/api/admin/paths/admin_regions.yaml index 62f76fda96..eb111a0c26 100644 --- a/docs/api/admin/paths/regions.yaml +++ b/docs/api/admin/paths/admin_regions.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostRegions - summary: Create a Region - description: Creates a Region - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostRegionsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/regions/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/regions/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Region - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminRegionsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetRegions summary: List Regions @@ -94,16 +49,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions/get.js + $ref: ../code_samples/JavaScript/admin_regions/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions/get.sh + $ref: ../code_samples/Shell/admin_regions/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK @@ -123,3 +78,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostRegions + summary: Create a Region + description: Creates a Region + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostRegionsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_regions/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_regions/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminRegionsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/regions_{id}.yaml b/docs/api/admin/paths/admin_regions_{id}.yaml similarity index 88% rename from docs/api/admin/paths/regions_{id}.yaml rename to docs/api/admin/paths/admin_regions_{id}.yaml index c0077f6a60..11dddce5f8 100644 --- a/docs/api/admin/paths/regions_{id}.yaml +++ b/docs/api/admin/paths/admin_regions_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteRegionsRegion - summary: Delete a Region - description: Deletes a Region. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Region. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/regions_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/regions_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Region - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminRegionsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetRegionsRegion summary: Get a Region @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/get.js + $ref: ../code_samples/JavaScript/admin_regions_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/get.sh + $ref: ../code_samples/Shell/admin_regions_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/post.js + $ref: ../code_samples/JavaScript/admin_regions_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/post.sh + $ref: ../code_samples/Shell/admin_regions_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteRegionsRegion + summary: Delete a Region + description: Deletes a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_regions_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_regions_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminRegionsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/regions_{id}_countries.yaml b/docs/api/admin/paths/admin_regions_{id}_countries.yaml similarity index 88% rename from docs/api/admin/paths/regions_{id}_countries.yaml rename to docs/api/admin/paths/admin_regions_{id}_countries.yaml index f95d51fb16..7216646d2c 100644 --- a/docs/api/admin/paths/regions_{id}_countries.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_countries.yaml @@ -21,16 +21,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}_countries/post.js + $ref: ../code_samples/JavaScript/admin_regions_{id}_countries/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_countries/post.sh + $ref: ../code_samples/Shell/admin_regions_{id}_countries/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml b/docs/api/admin/paths/admin_regions_{id}_countries_{country_code}.yaml similarity index 87% rename from docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml rename to docs/api/admin/paths/admin_regions_{id}_countries_{country_code}.yaml index 84c6bcdfa3..e653031cbc 100644 --- a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_countries_{country_code}.yaml @@ -26,16 +26,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/regions_{id}_countries_{country_code}/delete.js + ../code_samples/JavaScript/admin_regions_{id}_countries_{country_code}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_countries_{country_code}/delete.sh + $ref: >- + ../code_samples/Shell/admin_regions_{id}_countries_{country_code}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml b/docs/api/admin/paths/admin_regions_{id}_fulfillment-options.yaml similarity index 85% rename from docs/api/admin/paths/regions_{id}_fulfillment-options.yaml rename to docs/api/admin/paths/admin_regions_{id}_fulfillment-options.yaml index 0a585cdd09..e1c4aee49a 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_fulfillment-options.yaml @@ -16,16 +16,17 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}_fulfillment-options/get.js + $ref: >- + ../code_samples/JavaScript/admin_regions_{id}_fulfillment-options/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_fulfillment-options/get.sh + $ref: ../code_samples/Shell/admin_regions_{id}_fulfillment-options/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml b/docs/api/admin/paths/admin_regions_{id}_fulfillment-providers.yaml similarity index 86% rename from docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml rename to docs/api/admin/paths/admin_regions_{id}_fulfillment-providers.yaml index 0264a95890..8eba44d0ed 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_fulfillment-providers.yaml @@ -22,16 +22,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}_fulfillment-providers/post.js + $ref: >- + ../code_samples/JavaScript/admin_regions_{id}_fulfillment-providers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_fulfillment-providers/post.sh + $ref: ../code_samples/Shell/admin_regions_{id}_fulfillment-providers/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml b/docs/api/admin/paths/admin_regions_{id}_fulfillment-providers_{provider_id}.yaml similarity index 86% rename from docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml rename to docs/api/admin/paths/admin_regions_{id}_fulfillment-providers_{provider_id}.yaml index 4a5bb28931..b0a1479d77 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_fulfillment-providers_{provider_id}.yaml @@ -23,17 +23,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/delete.js + ../code_samples/JavaScript/admin_regions_{id}_fulfillment-providers_{provider_id}/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/delete.sh + ../code_samples/Shell/admin_regions_{id}_fulfillment-providers_{provider_id}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/regions_{id}_payment-providers.yaml b/docs/api/admin/paths/admin_regions_{id}_payment-providers.yaml similarity index 86% rename from docs/api/admin/paths/regions_{id}_payment-providers.yaml rename to docs/api/admin/paths/admin_regions_{id}_payment-providers.yaml index d649d62f1d..b75982b636 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_payment-providers.yaml @@ -21,16 +21,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}_payment-providers/post.js + $ref: >- + ../code_samples/JavaScript/admin_regions_{id}_payment-providers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_payment-providers/post.sh + $ref: ../code_samples/Shell/admin_regions_{id}_payment-providers/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml b/docs/api/admin/paths/admin_regions_{id}_payment-providers_{provider_id}.yaml similarity index 86% rename from docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml rename to docs/api/admin/paths/admin_regions_{id}_payment-providers_{provider_id}.yaml index dc9a42c001..aad8aae415 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/admin_regions_{id}_payment-providers_{provider_id}.yaml @@ -23,17 +23,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/delete.js + ../code_samples/JavaScript/admin_regions_{id}_payment-providers_{provider_id}/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/regions_{id}_payment-providers_{provider_id}/delete.sh + ../code_samples/Shell/admin_regions_{id}_payment-providers_{provider_id}/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/admin/paths/reservations.yaml b/docs/api/admin/paths/admin_reservations.yaml similarity index 89% rename from docs/api/admin/paths/reservations.yaml rename to docs/api/admin/paths/admin_reservations.yaml index 5ab2b611c6..b9e6b80063 100644 --- a/docs/api/admin/paths/reservations.yaml +++ b/docs/api/admin/paths/admin_reservations.yaml @@ -1,46 +1,3 @@ -post: - operationId: PostReservations - summary: Creates a Reservation - description: Creates a Reservation which can be associated with any resource as required. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostReservationsReq.yaml - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/reservations/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/reservations/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Reservation - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostReservationsReq.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetReservations summary: List Reservations @@ -120,23 +77,69 @@ get: category. schema: type: string + x-codegen: + method: list + queryParams: AdminGetReservationsParams x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations/get.sh + $ref: ../code_samples/Shell/admin_reservations/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Reservations responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/AdminGetReservationReservationsReq.yaml + $ref: ../components/schemas/AdminReservationsListRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +post: + operationId: PostReservations + summary: Creates a Reservation + description: Creates a Reservation which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostReservationsReq.yaml + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_reservations/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_reservations/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminReservationsRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/reservations_{id}.yaml b/docs/api/admin/paths/admin_reservations_{id}.yaml similarity index 75% rename from docs/api/admin/paths/reservations_{id}.yaml rename to docs/api/admin/paths/admin_reservations_{id}.yaml index 587a62a1d0..aa0cf2fe6c 100644 --- a/docs/api/admin/paths/reservations_{id}.yaml +++ b/docs/api/admin/paths/admin_reservations_{id}.yaml @@ -1,60 +1,3 @@ -delete: - operationId: DeleteReservationsReservation - summary: Delete a Reservation - description: Deletes a Reservation. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Reservation to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/reservations_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/reservations_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Reservation - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Reservation. - object: - type: string - description: The type of the object that was deleted. - default: reservation - deleted: - type: boolean - description: Whether or not the Reservation was deleted. - default: true - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetReservationsReservation summary: Get a Reservation @@ -71,23 +14,23 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/reservations_{id}/get.js + $ref: ../code_samples/JavaScript/admin_reservations_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations_{id}/get.sh + $ref: ../code_samples/Shell/admin_reservations_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Reservation + - Reservations responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/AdminPostReservationsReq.yaml + $ref: ../components/schemas/AdminReservationsRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -121,23 +64,70 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/reservations_{id}/post.js + $ref: ../code_samples/JavaScript/admin_reservations_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations_{id}/post.sh + $ref: ../code_samples/Shell/admin_reservations_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Reservation + - Reservations responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/AdminPostReservationsReq.yaml + $ref: ../components/schemas/AdminReservationsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteReservationsReservation + summary: Delete a Reservation + description: Deletes a Reservation. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_reservations_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_reservations_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminReservationsDeleteRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/return-reasons.yaml b/docs/api/admin/paths/admin_return-reasons.yaml similarity index 86% rename from docs/api/admin/paths/return-reasons.yaml rename to docs/api/admin/paths/admin_return-reasons.yaml index 5c195c9370..942fcb4ef3 100644 --- a/docs/api/admin/paths/return-reasons.yaml +++ b/docs/api/admin/paths/admin_return-reasons.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostReturnReasons - summary: Create a Return Reason - description: Creates a Return Reason - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostReturnReasonsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/return-reasons/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/return-reasons/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminReturnReasonsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetReturnReasons summary: List Return Reasons @@ -54,16 +9,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons/get.js + $ref: ../code_samples/JavaScript/admin_return-reasons/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons/get.sh + $ref: ../code_samples/Shell/admin_return-reasons/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Return Reasons responses: '200': description: OK @@ -83,3 +38,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostReturnReasonsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_return-reasons/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_return-reasons/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminReturnReasonsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/return-reasons_{id}.yaml b/docs/api/admin/paths/admin_return-reasons_{id}.yaml similarity index 87% rename from docs/api/admin/paths/return-reasons_{id}.yaml rename to docs/api/admin/paths/admin_return-reasons_{id}.yaml index 1de20751f2..5097081744 100644 --- a/docs/api/admin/paths/return-reasons_{id}.yaml +++ b/docs/api/admin/paths/admin_return-reasons_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteReturnReason - summary: Delete a Return Reason - description: Deletes a return reason. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the return reason - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/return-reasons_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminReturnReasonsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetReturnReasonsReason summary: Get a Return Reason @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/get.js + $ref: ../code_samples/JavaScript/admin_return-reasons_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/get.sh + $ref: ../code_samples/Shell/admin_return-reasons_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Return Reasons responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/post.js + $ref: ../code_samples/JavaScript/admin_return-reasons_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/post.sh + $ref: ../code_samples/Shell/admin_return-reasons_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Return Reasons responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the return reason + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_return-reasons_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_return-reasons_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminReturnReasonsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/returns.yaml b/docs/api/admin/paths/admin_returns.yaml similarity index 90% rename from docs/api/admin/paths/returns.yaml rename to docs/api/admin/paths/admin_returns.yaml index e7a8aed6de..d716c6583e 100644 --- a/docs/api/admin/paths/returns.yaml +++ b/docs/api/admin/paths/admin_returns.yaml @@ -22,16 +22,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns/get.js + $ref: ../code_samples/JavaScript/admin_returns/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns/get.sh + $ref: ../code_samples/Shell/admin_returns/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Return + - Returns responses: '200': description: OK diff --git a/docs/api/admin/paths/returns_{id}_cancel.yaml b/docs/api/admin/paths/admin_returns_{id}_cancel.yaml similarity index 86% rename from docs/api/admin/paths/returns_{id}_cancel.yaml rename to docs/api/admin/paths/admin_returns_{id}_cancel.yaml index 62932b8110..fa41d224fa 100644 --- a/docs/api/admin/paths/returns_{id}_cancel.yaml +++ b/docs/api/admin/paths/admin_returns_{id}_cancel.yaml @@ -15,16 +15,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns_{id}_cancel/post.js + $ref: ../code_samples/JavaScript/admin_returns_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns_{id}_cancel/post.sh + $ref: ../code_samples/Shell/admin_returns_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Return + - Returns responses: '200': description: OK diff --git a/docs/api/admin/paths/returns_{id}_receive.yaml b/docs/api/admin/paths/admin_returns_{id}_receive.yaml similarity index 88% rename from docs/api/admin/paths/returns_{id}_receive.yaml rename to docs/api/admin/paths/admin_returns_{id}_receive.yaml index 9c253f6378..156c30bfae 100644 --- a/docs/api/admin/paths/returns_{id}_receive.yaml +++ b/docs/api/admin/paths/admin_returns_{id}_receive.yaml @@ -22,16 +22,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns_{id}_receive/post.js + $ref: ../code_samples/JavaScript/admin_returns_{id}_receive/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns_{id}_receive/post.sh + $ref: ../code_samples/Shell/admin_returns_{id}_receive/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Return + - Returns responses: '200': description: OK diff --git a/docs/api/admin/paths/sales-channels.yaml b/docs/api/admin/paths/admin_sales-channels.yaml similarity index 94% rename from docs/api/admin/paths/sales-channels.yaml rename to docs/api/admin/paths/admin_sales-channels.yaml index e895f39b06..127f968561 100644 --- a/docs/api/admin/paths/sales-channels.yaml +++ b/docs/api/admin/paths/admin_sales-channels.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostSalesChannels - summary: Create a Sales Channel - description: Creates a Sales Channel. - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostSalesChannelsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/sales-channels/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/sales-channels/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Sales Channel - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminSalesChannelsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetSalesChannels summary: List Sales Channels @@ -173,16 +128,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels/get.js + $ref: ../code_samples/JavaScript/admin_sales-channels/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels/get.sh + $ref: ../code_samples/Shell/admin_sales-channels/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK @@ -202,3 +157,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostSalesChannels + summary: Create a Sales Channel + description: Creates a Sales Channel. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostSalesChannelsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_sales-channels/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_sales-channels/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminSalesChannelsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/sales-channels_{id}.yaml b/docs/api/admin/paths/admin_sales-channels_{id}.yaml similarity index 87% rename from docs/api/admin/paths/sales-channels_{id}.yaml rename to docs/api/admin/paths/admin_sales-channels_{id}.yaml index 73d5678d53..abd8fbb30b 100644 --- a/docs/api/admin/paths/sales-channels_{id}.yaml +++ b/docs/api/admin/paths/admin_sales-channels_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteSalesChannelsSalesChannel - summary: Delete a Sales Channel - description: Deletes the sales channel. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Sales channel. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/sales-channels_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/sales-channels_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Sales Channel - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminSalesChannelsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetSalesChannelsSalesChannel summary: Get a Sales Channel @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}/get.js + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}/get.sh + $ref: ../code_samples/Shell/admin_sales-channels_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}/post.js + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}/post.sh + $ref: ../code_samples/Shell/admin_sales-channels_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteSalesChannelsSalesChannel + summary: Delete a Sales Channel + description: Deletes the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_sales-channels_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channels + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminSalesChannelsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml b/docs/api/admin/paths/admin_sales-channels_{id}_products_batch.yaml similarity index 86% rename from docs/api/admin/paths/sales-channels_{id}_products_batch.yaml rename to docs/api/admin/paths/admin_sales-channels_{id}_products_batch.yaml index 459942b185..12fccc67f4 100644 --- a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml +++ b/docs/api/admin/paths/admin_sales-channels_{id}_products_batch.yaml @@ -22,16 +22,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}_products_batch/post.js + $ref: >- + ../code_samples/JavaScript/admin_sales-channels_{id}_products_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}_products_batch/post.sh + $ref: ../code_samples/Shell/admin_sales-channels_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK @@ -76,16 +77,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/sales-channels_{id}_products_batch/delete.js + ../code_samples/JavaScript/admin_sales-channels_{id}_products_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}_products_batch/delete.sh + $ref: >- + ../code_samples/Shell/admin_sales-channels_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK diff --git a/docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml b/docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml similarity index 86% rename from docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml rename to docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml index 8aadd7fb3a..0f1681ac84 100644 --- a/docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml +++ b/docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml @@ -22,16 +22,18 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}_stock-locations/post.js + $ref: >- + ../code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}_stock-locations/post.sh + $ref: >- + ../code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK @@ -76,16 +78,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/sales-channels_{id}_stock-locations/delete.js + ../code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}_stock-locations/delete.sh + $ref: >- + ../code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Sales Channels responses: '200': description: OK diff --git a/docs/api/admin/paths/shipping-options.yaml b/docs/api/admin/paths/admin_shipping-options.yaml similarity index 88% rename from docs/api/admin/paths/shipping-options.yaml rename to docs/api/admin/paths/admin_shipping-options.yaml index e2b6222ae7..4f18704bc7 100644 --- a/docs/api/admin/paths/shipping-options.yaml +++ b/docs/api/admin/paths/admin_shipping-options.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostShippingOptions - summary: Create Shipping Option - description: Creates a Shipping Option - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostShippingOptionsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/shipping-options/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/shipping-options/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminShippingOptionsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetShippingOptions summary: List Shipping Options @@ -71,16 +26,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options/get.js + $ref: ../code_samples/JavaScript/admin_shipping-options/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options/get.sh + $ref: ../code_samples/Shell/admin_shipping-options/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Shipping Options responses: '200': description: OK @@ -100,3 +55,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostShippingOptions + summary: Create Shipping Option + description: Creates a Shipping Option + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostShippingOptionsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_shipping-options/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-options/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/shipping-options_{id}.yaml b/docs/api/admin/paths/admin_shipping-options_{id}.yaml similarity index 86% rename from docs/api/admin/paths/shipping-options_{id}.yaml rename to docs/api/admin/paths/admin_shipping-options_{id}.yaml index af892d47e0..1e60a2fba7 100644 --- a/docs/api/admin/paths/shipping-options_{id}.yaml +++ b/docs/api/admin/paths/admin_shipping-options_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteShippingOptionsOption - summary: Delete a Shipping Option - description: Deletes a Shipping Option. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/shipping-options_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/shipping-options_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminShippingOptionsDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetShippingOptionsOption summary: Get a Shipping Option @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{id}/get.js + $ref: ../code_samples/JavaScript/admin_shipping-options_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{id}/get.sh + $ref: ../code_samples/Shell/admin_shipping-options_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Shipping Options responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{id}/post.js + $ref: ../code_samples/JavaScript/admin_shipping-options_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{id}/post.sh + $ref: ../code_samples/Shell/admin_shipping-options_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Shipping Options responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteShippingOptionsOption + summary: Delete a Shipping Option + description: Deletes a Shipping Option. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_shipping-options_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-options_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/shipping-profiles.yaml b/docs/api/admin/paths/admin_shipping-profiles.yaml similarity index 86% rename from docs/api/admin/paths/shipping-profiles.yaml rename to docs/api/admin/paths/admin_shipping-profiles.yaml index 14080c61f1..43ce69665d 100644 --- a/docs/api/admin/paths/shipping-profiles.yaml +++ b/docs/api/admin/paths/admin_shipping-profiles.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostShippingProfilesReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/shipping-profiles/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/shipping-profiles/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminShippingProfilesRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetShippingProfiles summary: List Shipping Profiles @@ -54,16 +9,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles/get.js + $ref: ../code_samples/JavaScript/admin_shipping-profiles/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles/get.sh + $ref: ../code_samples/Shell/admin_shipping-profiles/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Shipping Profiles responses: '200': description: OK @@ -83,3 +38,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostShippingProfiles + summary: Create a Shipping Profile + description: Creates a Shipping Profile + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostShippingProfilesReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-profiles/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingProfilesRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/shipping-profiles_{id}.yaml b/docs/api/admin/paths/admin_shipping-profiles_{id}.yaml similarity index 86% rename from docs/api/admin/paths/shipping-profiles_{id}.yaml rename to docs/api/admin/paths/admin_shipping-profiles_{id}.yaml index 00ed6dbff3..62fffb5901 100644 --- a/docs/api/admin/paths/shipping-profiles_{id}.yaml +++ b/docs/api/admin/paths/admin_shipping-profiles_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/shipping-profiles_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/shipping-profiles_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDeleteShippingProfileRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetShippingProfilesProfile summary: Get a Shipping Profile @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles_{id}/get.js + $ref: ../code_samples/JavaScript/admin_shipping-profiles_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles_{id}/get.sh + $ref: ../code_samples/Shell/admin_shipping-profiles_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Shipping Profiles responses: '200': description: OK @@ -114,16 +67,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles_{id}/post.js + $ref: ../code_samples/JavaScript/admin_shipping-profiles_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles_{id}/post.sh + $ref: ../code_samples/Shell/admin_shipping-profiles_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Shipping Profiles responses: '200': description: OK @@ -143,3 +96,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-profiles_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profiles + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDeleteShippingProfileRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/stock-locations.yaml b/docs/api/admin/paths/admin_stock-locations.yaml similarity index 94% rename from docs/api/admin/paths/stock-locations.yaml rename to docs/api/admin/paths/admin_stock-locations.yaml index 38f410cf76..25cda8edc9 100644 --- a/docs/api/admin/paths/stock-locations.yaml +++ b/docs/api/admin/paths/admin_stock-locations.yaml @@ -1,59 +1,3 @@ -post: - operationId: PostStockLocations - summary: Create a Stock Location - description: Creates a Stock Location. - x-authenticated: true - parameters: - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostStockLocationsReq.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/stock-locations/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/stock-locations/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Stock Location - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminStockLocationsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetStockLocations summary: List Stock Locations @@ -174,16 +118,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations/get.js + $ref: ../code_samples/JavaScript/admin_stock-locations/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations/get.sh + $ref: ../code_samples/Shell/admin_stock-locations/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Sales Channel + - Stock Locations responses: '200': description: OK @@ -203,3 +147,59 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostStockLocations + summary: Create a Stock Location + description: Creates a Stock Location. + x-authenticated: true + parameters: + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostStockLocationsReq.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_stock-locations/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_stock-locations/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminStockLocationsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/stock-locations_{id}.yaml b/docs/api/admin/paths/admin_stock-locations_{id}.yaml similarity index 88% rename from docs/api/admin/paths/stock-locations_{id}.yaml rename to docs/api/admin/paths/admin_stock-locations_{id}.yaml index f22b4cef3d..eb46ce8a80 100644 --- a/docs/api/admin/paths/stock-locations_{id}.yaml +++ b/docs/api/admin/paths/admin_stock-locations_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteStockLocationsStockLocation - summary: Delete a Stock Location - description: Delete a Stock Location - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Stock Location to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/stock-locations_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/stock-locations_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - StockLocation - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Stock Location. - object: - type: string - description: The type of the object that was deleted. - format: stock_location - deleted: - type: boolean - description: Whether or not the Stock Location was deleted. - default: true - '400': - $ref: ../components/responses/400_error.yaml get: operationId: GetStockLocationsStockLocation summary: Get a Stock Location @@ -74,16 +27,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations_{id}/get.js + $ref: ../code_samples/JavaScript/admin_stock-locations_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations_{id}/get.sh + $ref: ../code_samples/Shell/admin_stock-locations_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Stock Location + - Stock Locations responses: '200': description: OK @@ -124,16 +77,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations_{id}/post.js + $ref: ../code_samples/JavaScript/admin_stock-locations_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations_{id}/post.sh + $ref: ../code_samples/Shell/admin_stock-locations_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Stock Location + - Stock Locations responses: '200': description: OK @@ -153,3 +106,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_stock-locations_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_stock-locations_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Locations + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: ../components/responses/400_error.yaml diff --git a/docs/api/admin/paths/store.yaml b/docs/api/admin/paths/admin_store.yaml similarity index 86% rename from docs/api/admin/paths/store.yaml rename to docs/api/admin/paths/admin_store.yaml index e8480eb842..ca274f0858 100644 --- a/docs/api/admin/paths/store.yaml +++ b/docs/api/admin/paths/admin_store.yaml @@ -9,11 +9,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store/get.js + $ref: ../code_samples/JavaScript/admin_store/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store/get.sh + $ref: ../code_samples/Shell/admin_store/get.sh security: - api_token: [] - cookie_auth: [] @@ -25,7 +25,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/AdminStoresRes.yaml + $ref: ../components/schemas/AdminExtendedStoresRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -54,11 +54,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store/post.js + $ref: ../code_samples/JavaScript/admin_store/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store/post.sh + $ref: ../code_samples/Shell/admin_store/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store_currencies_{code}.yaml b/docs/api/admin/paths/admin_store_currencies_{code}.yaml similarity index 89% rename from docs/api/admin/paths/store_currencies_{code}.yaml rename to docs/api/admin/paths/admin_store_currencies_{code}.yaml index 3c0d9a656b..7de11aecb5 100644 --- a/docs/api/admin/paths/store_currencies_{code}.yaml +++ b/docs/api/admin/paths/admin_store_currencies_{code}.yaml @@ -19,11 +19,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store_currencies_{code}/post.js + $ref: ../code_samples/JavaScript/admin_store_currencies_{code}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_currencies_{code}/post.sh + $ref: ../code_samples/Shell/admin_store_currencies_{code}/post.sh security: - api_token: [] - cookie_auth: [] @@ -69,11 +69,11 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store_currencies_{code}/delete.js + $ref: ../code_samples/JavaScript/admin_store_currencies_{code}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_currencies_{code}/delete.sh + $ref: ../code_samples/Shell/admin_store_currencies_{code}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store_payment-providers.yaml b/docs/api/admin/paths/admin_store_payment-providers.yaml similarity index 86% rename from docs/api/admin/paths/store_payment-providers.yaml rename to docs/api/admin/paths/admin_store_payment-providers.yaml index ed54a9d1d7..3383d39fdc 100644 --- a/docs/api/admin/paths/store_payment-providers.yaml +++ b/docs/api/admin/paths/admin_store_payment-providers.yaml @@ -9,11 +9,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store_payment-providers/get.js + $ref: ../code_samples/JavaScript/admin_store_payment-providers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_payment-providers/get.sh + $ref: ../code_samples/Shell/admin_store_payment-providers/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store_tax-providers.yaml b/docs/api/admin/paths/admin_store_tax-providers.yaml similarity index 87% rename from docs/api/admin/paths/store_tax-providers.yaml rename to docs/api/admin/paths/admin_store_tax-providers.yaml index 34d18c7f42..92b8f24717 100644 --- a/docs/api/admin/paths/store_tax-providers.yaml +++ b/docs/api/admin/paths/admin_store_tax-providers.yaml @@ -9,11 +9,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store_tax-providers/get.js + $ref: ../code_samples/JavaScript/admin_store_tax-providers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_tax-providers/get.sh + $ref: ../code_samples/Shell/admin_store_tax-providers/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/swaps.yaml b/docs/api/admin/paths/admin_swaps.yaml similarity index 90% rename from docs/api/admin/paths/swaps.yaml rename to docs/api/admin/paths/admin_swaps.yaml index 0ef3dc6b43..5900eeddeb 100644 --- a/docs/api/admin/paths/swaps.yaml +++ b/docs/api/admin/paths/admin_swaps.yaml @@ -23,16 +23,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps/get.js + $ref: ../code_samples/JavaScript/admin_swaps/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps/get.sh + $ref: ../code_samples/Shell/admin_swaps/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Swaps responses: '200': description: OK diff --git a/docs/api/admin/paths/swaps_{id}.yaml b/docs/api/admin/paths/admin_swaps_{id}.yaml similarity index 88% rename from docs/api/admin/paths/swaps_{id}.yaml rename to docs/api/admin/paths/admin_swaps_{id}.yaml index 3e015de067..81b6cbb83d 100644 --- a/docs/api/admin/paths/swaps_{id}.yaml +++ b/docs/api/admin/paths/admin_swaps_{id}.yaml @@ -16,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps_{id}/get.js + $ref: ../code_samples/JavaScript/admin_swaps_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps_{id}/get.sh + $ref: ../code_samples/Shell/admin_swaps_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Swap + - Swaps responses: '200': description: OK diff --git a/docs/api/admin/paths/tax-rates.yaml b/docs/api/admin/paths/admin_tax-rates.yaml similarity index 94% rename from docs/api/admin/paths/tax-rates.yaml rename to docs/api/admin/paths/admin_tax-rates.yaml index bffe85c655..5df462522b 100644 --- a/docs/api/admin/paths/tax-rates.yaml +++ b/docs/api/admin/paths/admin_tax-rates.yaml @@ -1,68 +1,3 @@ -post: - operationId: PostTaxRates - summary: Create a Tax Rate - description: Creates a Tax Rate - parameters: - - in: query - name: fields - description: Which fields should be included in the result. - style: form - explode: false - schema: - type: array - items: - type: string - - in: query - name: expand - description: Which fields should be expanded and retrieved in the result. - style: form - explode: false - schema: - type: array - items: - type: string - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminPostTaxRatesReq.yaml - x-codegen: - method: create - queryParams: AdminPostTaxRatesParams - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/tax-rates/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/tax-rates/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Tax Rate - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminTaxRatesRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetTaxRates summary: List Tax Rates @@ -149,16 +84,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates/get.js + $ref: ../code_samples/JavaScript/admin_tax-rates/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates/get.sh + $ref: ../code_samples/Shell/admin_tax-rates/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK @@ -178,3 +113,68 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostTaxRates + summary: Create a Tax Rate + description: Creates a Tax Rate + parameters: + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostTaxRatesReq.yaml + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_tax-rates/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_tax-rates/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTaxRatesRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}.yaml b/docs/api/admin/paths/admin_tax-rates_{id}.yaml similarity index 90% rename from docs/api/admin/paths/tax-rates_{id}.yaml rename to docs/api/admin/paths/admin_tax-rates_{id}.yaml index 82b5173419..55f2fc7c3a 100644 --- a/docs/api/admin/paths/tax-rates_{id}.yaml +++ b/docs/api/admin/paths/admin_tax-rates_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteTaxRatesTaxRate - summary: Delete a Tax Rate - description: Deletes a Tax Rate - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/tax-rates_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/tax-rates_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Tax Rate - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminTaxRatesDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetTaxRatesTaxRate summary: Get a Tax Rate @@ -82,16 +35,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}/get.js + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}/get.sh + $ref: ../code_samples/Shell/admin_tax-rates_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK @@ -153,16 +106,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}/post.js + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}/post.sh + $ref: ../code_samples/Shell/admin_tax-rates_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK @@ -182,3 +135,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteTaxRatesTaxRate + summary: Delete a Tax Rate + description: Deletes a Tax Rate + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_tax-rates_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rates + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTaxRatesDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml b/docs/api/admin/paths/admin_tax-rates_{id}_product-types_batch.yaml similarity index 89% rename from docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml rename to docs/api/admin/paths/admin_tax-rates_{id}_product-types_batch.yaml index 0b76709b22..65353a31ff 100644 --- a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml +++ b/docs/api/admin/paths/admin_tax-rates_{id}_product-types_batch.yaml @@ -40,16 +40,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}_product-types_batch/post.js + $ref: >- + ../code_samples/JavaScript/admin_tax-rates_{id}_product-types_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_product-types_batch/post.sh + $ref: ../code_samples/Shell/admin_tax-rates_{id}_product-types_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK @@ -112,16 +113,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_product-types_batch/delete.js + ../code_samples/JavaScript/admin_tax-rates_{id}_product-types_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_product-types_batch/delete.sh + $ref: >- + ../code_samples/Shell/admin_tax-rates_{id}_product-types_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK diff --git a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml b/docs/api/admin/paths/admin_tax-rates_{id}_products_batch.yaml similarity index 90% rename from docs/api/admin/paths/tax-rates_{id}_products_batch.yaml rename to docs/api/admin/paths/admin_tax-rates_{id}_products_batch.yaml index 0228525481..6964aae553 100644 --- a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml +++ b/docs/api/admin/paths/admin_tax-rates_{id}_products_batch.yaml @@ -40,16 +40,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}_products_batch/post.js + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}_products_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_products_batch/post.sh + $ref: ../code_samples/Shell/admin_tax-rates_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK @@ -111,16 +111,17 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}_products_batch/delete.js + $ref: >- + ../code_samples/JavaScript/admin_tax-rates_{id}_products_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_products_batch/delete.sh + $ref: ../code_samples/Shell/admin_tax-rates_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK diff --git a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml b/docs/api/admin/paths/admin_tax-rates_{id}_shipping-options_batch.yaml similarity index 89% rename from docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml rename to docs/api/admin/paths/admin_tax-rates_{id}_shipping-options_batch.yaml index abaf54d63f..fb306cbc84 100644 --- a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml +++ b/docs/api/admin/paths/admin_tax-rates_{id}_shipping-options_batch.yaml @@ -42,16 +42,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/post.js + ../code_samples/JavaScript/admin_tax-rates_{id}_shipping-options_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_shipping-options_batch/post.sh + $ref: >- + ../code_samples/Shell/admin_tax-rates_{id}_shipping-options_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK @@ -115,16 +116,17 @@ delete: label: JS Client source: $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/delete.js + ../code_samples/JavaScript/admin_tax-rates_{id}_shipping-options_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_shipping-options_batch/delete.sh + $ref: >- + ../code_samples/Shell/admin_tax-rates_{id}_shipping-options_batch/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Tax Rate + - Tax Rates responses: '200': description: OK diff --git a/docs/api/admin/paths/uploads.yaml b/docs/api/admin/paths/admin_uploads.yaml similarity index 87% rename from docs/api/admin/paths/uploads.yaml rename to docs/api/admin/paths/admin_uploads.yaml index 3070375714..3a64ca4ea0 100644 --- a/docs/api/admin/paths/uploads.yaml +++ b/docs/api/admin/paths/admin_uploads.yaml @@ -18,16 +18,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads/post.js + $ref: ../code_samples/JavaScript/admin_uploads/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads/post.sh + $ref: ../code_samples/Shell/admin_uploads/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Upload + - Uploads responses: '200': description: OK @@ -48,7 +48,7 @@ post: '500': $ref: ../components/responses/500_error.yaml delete: - operationId: AdminDeleteUploads + operationId: DeleteUploads summary: Delete an Uploaded File description: Removes an uploaded file using the installed fileservice x-authenticated: true @@ -61,16 +61,16 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads/delete.js + $ref: ../code_samples/JavaScript/admin_uploads/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads/delete.sh + $ref: ../code_samples/Shell/admin_uploads/delete.sh security: - api_token: [] - cookie_auth: [] tags: - - Upload + - Uploads responses: '200': description: OK diff --git a/docs/api/admin/paths/uploads_download-url.yaml b/docs/api/admin/paths/admin_uploads_download-url.yaml similarity index 86% rename from docs/api/admin/paths/uploads_download-url.yaml rename to docs/api/admin/paths/admin_uploads_download-url.yaml index a3a34d3688..edbaa161ec 100644 --- a/docs/api/admin/paths/uploads_download-url.yaml +++ b/docs/api/admin/paths/admin_uploads_download-url.yaml @@ -12,16 +12,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads_download-url/post.js + $ref: ../code_samples/JavaScript/admin_uploads_download-url/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads_download-url/post.sh + $ref: ../code_samples/Shell/admin_uploads_download-url/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Upload + - Uploads responses: '200': description: OK diff --git a/docs/api/admin/paths/uploads_protected.yaml b/docs/api/admin/paths/admin_uploads_protected.yaml similarity index 88% rename from docs/api/admin/paths/uploads_protected.yaml rename to docs/api/admin/paths/admin_uploads_protected.yaml index 67e678e526..5abe78c59b 100644 --- a/docs/api/admin/paths/uploads_protected.yaml +++ b/docs/api/admin/paths/admin_uploads_protected.yaml @@ -18,16 +18,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads_protected/post.js + $ref: ../code_samples/JavaScript/admin_uploads_protected/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads_protected/post.sh + $ref: ../code_samples/Shell/admin_uploads_protected/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Upload + - Uploads responses: '200': description: OK diff --git a/docs/api/admin/paths/users.yaml b/docs/api/admin/paths/admin_users.yaml similarity index 88% rename from docs/api/admin/paths/users.yaml rename to docs/api/admin/paths/admin_users.yaml index 3403b55103..d4af942bb4 100644 --- a/docs/api/admin/paths/users.yaml +++ b/docs/api/admin/paths/admin_users.yaml @@ -1,48 +1,3 @@ -post: - operationId: PostUsers - summary: Create a User - description: Creates a User - x-authenticated: true - requestBody: - content: - application/json: - schema: - $ref: ../components/schemas/AdminCreateUserRequest.yaml - x-codegen: - method: create - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/users/post.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/users/post.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminUserRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetUsers summary: List Users @@ -54,16 +9,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users/get.js + $ref: ../code_samples/JavaScript/admin_users/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users/get.sh + $ref: ../code_samples/Shell/admin_users/get.sh security: - api_token: [] - cookie_auth: [] tags: - - User + - Users responses: '200': description: OK @@ -83,3 +38,48 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +post: + operationId: PostUsers + summary: Create a User + description: Creates a User + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminCreateUserRequest.yaml + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_users/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_users/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminUserRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/users_password-token.yaml b/docs/api/admin/paths/admin_users_password-token.yaml similarity index 86% rename from docs/api/admin/paths/users_password-token.yaml rename to docs/api/admin/paths/admin_users_password-token.yaml index d82fb253ef..971f0e252d 100644 --- a/docs/api/admin/paths/users_password-token.yaml +++ b/docs/api/admin/paths/admin_users_password-token.yaml @@ -14,16 +14,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_password-token/post.js + $ref: ../code_samples/JavaScript/admin_users_password-token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_password-token/post.sh + $ref: ../code_samples/Shell/admin_users_password-token/post.sh security: - api_token: [] - cookie_auth: [] tags: - - User + - Users responses: '204': description: OK diff --git a/docs/api/admin/paths/users_reset-password.yaml b/docs/api/admin/paths/admin_users_reset-password.yaml similarity index 87% rename from docs/api/admin/paths/users_reset-password.yaml rename to docs/api/admin/paths/admin_users_reset-password.yaml index 24dcae1bda..ac3a677e1d 100644 --- a/docs/api/admin/paths/users_reset-password.yaml +++ b/docs/api/admin/paths/admin_users_reset-password.yaml @@ -14,16 +14,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_reset-password/post.js + $ref: ../code_samples/JavaScript/admin_users_reset-password/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_reset-password/post.sh + $ref: ../code_samples/Shell/admin_users_reset-password/post.sh security: - api_token: [] - cookie_auth: [] tags: - - User + - Users responses: '200': description: OK diff --git a/docs/api/admin/paths/users_{id}.yaml b/docs/api/admin/paths/admin_users_{id}.yaml similarity index 88% rename from docs/api/admin/paths/users_{id}.yaml rename to docs/api/admin/paths/admin_users_{id}.yaml index 962f3067ee..fa32500a69 100644 --- a/docs/api/admin/paths/users_{id}.yaml +++ b/docs/api/admin/paths/admin_users_{id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteUsersUser - summary: Delete a User - description: Deletes a User - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the User. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/users_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/users_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDeleteUserRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml get: operationId: GetUsersUser summary: Get a User @@ -63,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_{id}/get.js + $ref: ../code_samples/JavaScript/admin_users_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_{id}/get.sh + $ref: ../code_samples/Shell/admin_users_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - User + - Users responses: '200': description: OK @@ -115,16 +68,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_{id}/post.js + $ref: ../code_samples/JavaScript/admin_users_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_{id}/post.sh + $ref: ../code_samples/Shell/admin_users_{id}/post.sh security: - api_token: [] - cookie_auth: [] tags: - - User + - Users responses: '200': description: OK @@ -144,3 +97,50 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteUsersUser + summary: Delete a User + description: Deletes a User + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_users_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_users_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Users + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDeleteUserRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/admin_variants.yaml similarity index 96% rename from docs/api/admin/paths/variants.yaml rename to docs/api/admin/paths/admin_variants.yaml index 02357455bc..463d26a7e6 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/admin_variants.yaml @@ -100,16 +100,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/variants/get.js + $ref: ../code_samples/JavaScript/admin_variants/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants/get.sh + $ref: ../code_samples/Shell/admin_variants/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Variant + - Variants responses: '200': description: OK diff --git a/docs/api/admin/paths/admin_variants_{id}.yaml b/docs/api/admin/paths/admin_variants_{id}.yaml new file mode 100644 index 0000000000..dbe1b381c5 --- /dev/null +++ b/docs/api/admin/paths/admin_variants_{id}.yaml @@ -0,0 +1,62 @@ +get: + operationId: GetVariantsVariant + summary: Get a Product variant + description: Retrieves a Product variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the variant. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded the order of the + result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included the order of the + result. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetVariantParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_variants_{id}/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_variants_{id}/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminVariantsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/variants_{id}_inventory.yaml b/docs/api/admin/paths/admin_variants_{id}_inventory.yaml similarity index 88% rename from docs/api/admin/paths/variants_{id}_inventory.yaml rename to docs/api/admin/paths/admin_variants_{id}_inventory.yaml index 0504ea75cf..b2e311fceb 100644 --- a/docs/api/admin/paths/variants_{id}_inventory.yaml +++ b/docs/api/admin/paths/admin_variants_{id}_inventory.yaml @@ -16,16 +16,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/variants_{id}_inventory/get.js + $ref: ../code_samples/JavaScript/admin_variants_{id}_inventory/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants_{id}_inventory/get.sh + $ref: ../code_samples/Shell/admin_variants_{id}_inventory/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Variant + - Variants responses: '200': description: OK diff --git a/docs/api/admin/paths/draft-orders_{id}.yaml b/docs/api/admin/paths/draft-orders_{id}.yaml deleted file mode 100644 index 3434fcaf90..0000000000 --- a/docs/api/admin/paths/draft-orders_{id}.yaml +++ /dev/null @@ -1,94 +0,0 @@ -delete: - operationId: DeleteDraftOrdersDraftOrder - summary: Delete a Draft Order - description: Deletes a Draft Order - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codegen: - method: delete - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/draft-orders_{id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/draft-orders_{id}/delete.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDraftOrdersDeleteRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml -get: - operationId: GetDraftOrdersDraftOrder - summary: Get a Draft Order - description: Retrieves a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codegen: - method: retrieve - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/draft-orders_{id}/get.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/draft-orders_{id}/get.sh - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminDraftOrdersRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml diff --git a/docs/api/store.oas.json b/docs/api/store.oas.json new file mode 100644 index 0000000000..9569a3b736 --- /dev/null +++ b/docs/api/store.oas.json @@ -0,0 +1,15557 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Medusa Storefront API", + "description": "API reference for Medusa's Storefront endpoints. All endpoints are prefixed with `/store`.\n\n## Authentication\n\nTo send requests as an authenticated customer, you must use the Cookie Session ID.\n\n\n\n## Expanding Fields\n\nIn many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response.\n\nPlease note that the relations you pass to `expand` replace any relations that are expanded by default in the request.\n\n### Expanding One Relation\n\nFor example, when you retrieve a product, you can retrieve its collection by passing to the `expand` query parameter the value `collection`:\n\n```bash\ncurl \"http://localhost:9000/store/products/prod_01GDJGP2XPQT2N3JHZQFMH5V45?expand=collection\"\n```\n\n### Expanding Multiple Relations\n\nYou can expand more than one relation by separating the relations in the `expand` query parameter with a comma.\n\nFor example, to retrieve both the variants and the collection of a product, pass to the `expand` query parameter the value `variants,collection`:\n\n```bash\ncurl \"http://localhost:9000/store/products/prod_01GDJGP2XPQT2N3JHZQFMH5V45?expand=variants,collection\"\n```\n\n### Prevent Expanding Relations\n\nSome requests expand relations by default. You can prevent that by passing an empty expand value to retrieve an entity without any extra relations.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/store/products/prod_01GDJGP2XPQT2N3JHZQFMH5V45?expand\"\n```\n\nThis would retrieve the product with only its properties, without any relations like `collection`.\n\n## Selecting Fields\n\nIn many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response.\n\nPlease note that if you pass a `fields` query parameter, only the fields you pass in the value along with the `id` of the entity will be returned in the response.\n\nAlso, the `fields` query parameter does not affect the expanded relations. You'll have to use the `expand` parameter instead.\n\n### Selecting One Field\n\nFor example, when you retrieve a list of products, you can retrieve only the titles of the products by passing `title` as a value to the `fields` query parameter:\n\n```bash\ncurl \"http://localhost:9000/store/products?fields=title\"\n```\n\nAs mentioned above, the expanded relations such as `variants` will still be returned as they're not affected by the `fields` parameter.\n\nYou can ensure that only the `title` field is returned by passing an empty value to the `expand` query parameter. For example:\n\n```bash\ncurl \"http://localhost:9000/store/products?fields=title&expand\"\n```\n\n### Selecting Multiple Fields\n\nYou can pass more than one field by seperating the field names in the `fields` query parameter with a comma.\n\nFor example, to select the `title` and `handle` of a product:\n\n```bash\ncurl \"http://localhost:9000/store/products?fields=title,handle\"\n```\n\n### Retrieve Only the ID\n\nYou can pass an empty `fields` query parameter to return only the ID of an entity. For example:\n\n```bash\ncurl \"http://localhost:9000/store/products?fields\"\n```\n\nYou can also pair with an empty `expand` query parameter to ensure that the relations aren't retrieved as well. For example:\n\n```bash\ncurl \"http://localhost:9000/store/products?fields&expand\"\n```\n\n## Query Parameter Types\n\nThis section covers how to pass some common data types as query parameters. This is useful if you're sending requests to the API endpoints and not using our JS Client. For example, when using cURL or Postman.\n\n### Strings\n\nYou can pass a string value in the form of `=`.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/store/products?title=Shirt\"\n```\n\nIf the string has any characters other than letters and numbers, you must encode them.\n\nFor example, if the string has spaces, you can encode the space with `+` or `%20`:\n\n```bash\ncurl \"http://localhost:9000/store/products?title=Blue%20Shirt\"\n```\n\nYou can use tools like [this one](https://www.urlencoder.org/) to learn how a value can be encoded.\n\n### Integers\n\nYou can pass an integer value in the form of `=`.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/store/products?offset=1\"\n```\n\n### Boolean\n\nYou can pass a boolean value in the form of `=`.\n\nFor example:\n\n```bash\ncurl \"http://localhost:9000/store/products?is_giftcard=true\"\n```\n\n### Date and DateTime\n\nYou can pass a date value in the form `=`. The date must be in the format `YYYY-MM-DD`.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/store/products?created_at[lt]=2023-02-17\"\n```\n\nYou can also pass the time using the format `YYYY-MM-DDTHH:MM:SSZ`. Please note that the `T` and `Z` here are fixed.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/store/products?created_at[lt]=2023-02-17T07:22:30Z\"\n```\n\n### Array\n\nEach array value must be passed as a separate query parameter in the form `[]=`. You can also specify the index of each parameter in the brackets `[0]=`.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/store/products?sales_channel_id[]=sc_01GPGVB42PZ7N3YQEP2WDM7PC7&sales_channel_id[]=sc_234PGVB42PZ7N3YQEP2WDM7PC7\"\n```\n\nNote that the `-g` parameter passed to `curl` disables errors being thrown for using the brackets. Read more [here](https://curl.se/docs/manpage.html#-g).\n\n### Object\n\nObject parameters must be passed as separate query parameters in the form `[]=`.\n\nFor example:\n\n```bash\ncurl -g \"http://localhost:9000/store/products?created_at[lt]=2023-02-17&created_at[gt]=2022-09-17\"\n```\n\n## Pagination\n\n### Query Parameters\n\nIn listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`.\n\n`limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities.\n\nYou can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on.\n\nFor example, to limit the number of products returned in the List Products endpoint:\n\n```bash\ncurl \"http://localhost:9000/store/products?limit=5\"\n```\n\n### Response Fields\n\nIn the response of listing endpoints, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`.\n\nSimilar to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result.\n\n`count` is the total number of available items of this entity. It can be used to determine how many pages are there.\n\nFor example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`.\n", + "license": { + "name": "MIT", + "url": "https://github.com/medusajs/medusa/blob/master/LICENSE" + } + }, + "tags": [ + { + "name": "Auth", + "description": "Auth endpoints that allow authorization of customers and manages their sessions." + }, + { + "name": "Carts", + "description": "Cart endpoints that allow handling carts in Medusa." + }, + { + "name": "Collections", + "description": "Collection endpoints that allow handling collections in Medusa." + }, + { + "name": "Customers", + "description": "Customer endpoints that allow handling customers in Medusa." + }, + { + "name": "Gift Cards", + "description": "Gift Card endpoints that allow handling gift cards in Medusa." + }, + { + "name": "Orders", + "description": "Order endpoints that allow handling orders in Medusa." + }, + { + "name": "Products", + "description": "Product endpoints that allow handling products in Medusa." + }, + { + "name": "Product Variants", + "description": "Product Variant endpoints that allow handling product variants in Medusa." + }, + { + "name": "Regions", + "description": "Region endpoints that allow handling regions in Medusa." + }, + { + "name": "Return Reasons", + "description": "Return Reason endpoints that allow handling return reasons in Medusa." + }, + { + "name": "Returns", + "description": "Return endpoints that allow handling returns in Medusa." + }, + { + "name": "Shipping Options", + "description": "Shipping Option endpoints that allow handling shipping options in Medusa." + }, + { + "name": "Swaps", + "description": "Swap endpoints that allow handling swaps in Medusa." + } + ], + "servers": [ + { + "url": "https://api.medusa-commerce.com" + } + ], + "paths": { + "/store/auth": { + "get": { + "operationId": "GetAuth", + "summary": "Get Current Customer", + "description": "Gets the currently logged in Customer.", + "x-authenticated": true, + "x-codegen": { + "method": "getSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.auth.getSession()\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/auth' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreAuthRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostAuth", + "summary": "Customer Login", + "description": "Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostAuthReq" + } + } + } + }, + "x-codegen": { + "method": "authenticate" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.auth.authenticate({\n email: 'user@example.com',\n password: 'user@example.com'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/auth' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\"\n}'\n" + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreAuthRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/incorrect_credentials" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteAuth", + "summary": "Customer Log out", + "description": "Destroys a Customer's authenticated session.", + "x-authenticated": true, + "x-codegen": { + "method": "deleteSession" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/store/auth' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/auth/{email}": { + "get": { + "operationId": "GetAuthEmail", + "summary": "Check if email exists", + "description": "Checks if a Customer with the given email has signed up.", + "parameters": [ + { + "in": "path", + "name": "email", + "schema": { + "type": "string", + "format": "email" + }, + "required": true, + "description": "The email to check if exists." + } + ], + "x-codegen": { + "method": "exists" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.auth.exists('user@example.com')\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/auth/user@example.com' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreGetAuthEmailRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts": { + "post": { + "summary": "Create a Cart", + "operationId": "PostCart", + "description": "Creates a Cart within the given region and with the initial items. If no `region_id` is provided the cart will be associated with the first Region available. If no items are provided the cart will be empty after creation. If a user is logged in the cart's customer id and email will be set.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.create()\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "Successfully created a new Cart", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}": { + "get": { + "operationId": "GetCartsCart", + "summary": "Get a Cart", + "description": "Retrieves a Cart.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.retrieve(cart_id)\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/carts/{id}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCartsCart", + "summary": "Update a Cart", + "description": "Updates a Cart.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartsCartReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.update(cart_id, {\n email: 'user@example.com'\n})\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\"\n}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/complete": { + "post": { + "summary": "Complete a Cart", + "operationId": "PostCartsCartComplete", + "description": "Completes a cart. The following steps will be performed. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header `Idempotency-Key`. If not provided, we will generate one for the request.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Cart id.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "complete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.complete(cart_id)\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/complete'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "If a cart was successfully authorized, but requires further action from the user the response body will contain the cart with an updated payment session. If the Cart was successfully completed the response body will contain the newly created Order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCompleteCartRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/discounts/{code}": { + "delete": { + "operationId": "DeleteCartsCartDiscountsDiscount", + "description": "Removes a Discount from a Cart.", + "summary": "Remove Discount", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "code", + "required": true, + "description": "The unique Discount code.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteDiscount" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.deleteDiscount(cart_id, code)\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/discounts/{code}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/line-items": { + "post": { + "operationId": "PostCartsCartLineItems", + "summary": "Add a Line Item", + "description": "Generates a Line Item with a given Product Variant and adds it to the Cart", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart to add the Line Item to.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartsCartLineItemsReq" + } + } + } + }, + "x-codegen": { + "method": "createLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.lineItems.create(cart_id, {\n variant_id,\n quantity: 1\n})\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"variant_id\": \"{variant_id}\",\n \"quantity\": 1\n}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/line-items/{line_id}": { + "post": { + "operationId": "PostCartsCartLineItemsItem", + "summary": "Update a Line Item", + "description": "Updates a Line Item if the desired quantity can be fulfilled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_id", + "required": true, + "description": "The id of the Line Item.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartsCartLineItemsItemReq" + } + } + } + }, + "x-codegen": { + "method": "updateLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.lineItems.update(cart_id, line_id, {\n quantity: 1\n})\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"quantity\": 1\n}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteCartsCartLineItemsItem", + "summary": "Delete a Line Item", + "description": "Removes a Line Item from a Cart.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_id", + "required": true, + "description": "The id of the Line Item.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteLineItem" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.lineItems.delete(cart_id, line_id)\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/payment-session": { + "post": { + "operationId": "PostCartsCartPaymentSession", + "summary": "Select a Payment Session", + "description": "Selects a Payment Session as the session intended to be used towards the completion of the Cart.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Cart.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartsCartPaymentSessionReq" + } + } + } + }, + "x-codegen": { + "method": "setPaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.setPaymentSession(cart_id, {\n provider_id: 'manual'\n})\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"provider_id\": \"manual\"\n}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/payment-sessions": { + "post": { + "operationId": "PostCartsCartPaymentSessions", + "summary": "Create Payment Sessions", + "description": "Creates Payment Sessions for each of the available Payment Providers in the Cart's Region.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "createPaymentSessions" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.createPaymentSessions(cart_id)\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/payment-sessions/{provider_id}": { + "post": { + "operationId": "PostCartsCartPaymentSessionUpdate", + "summary": "Update a Payment Session", + "description": "Updates a Payment Session with additional data.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "provider_id", + "required": true, + "description": "The id of the payment provider.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartsCartPaymentSessionUpdateReq" + } + } + } + }, + "x-codegen": { + "method": "updatePaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.updatePaymentSession(cart_id, 'manual', {\n data: {\n\n }\n})\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"data\": {}\n}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteCartsCartPaymentSessionsSession", + "summary": "Delete a Payment Session", + "description": "Deletes a Payment Session on a Cart. May be useful if a payment has failed.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "provider_id", + "required": true, + "description": "The id of the Payment Provider used to create the Payment Session to be deleted.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deletePaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.deletePaymentSession(cart_id, 'manual')\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/payment-sessions/{provider_id}/refresh": { + "post": { + "operationId": "PostCartsCartPaymentSessionsSession", + "summary": "Refresh a Payment Session", + "description": "Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "provider_id", + "required": true, + "description": "The id of the Payment Provider that created the Payment Session to be refreshed.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "refreshPaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.refreshPaymentSession(cart_id, 'manual')\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/shipping-methods": { + "post": { + "operationId": "PostCartsCartShippingMethod", + "description": "Adds a Shipping Method to the Cart.", + "summary": "Add a Shipping Method", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The cart ID.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCartsCartShippingMethodReq" + } + } + } + }, + "x-codegen": { + "method": "addShippingMethod" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.carts.addShippingMethod(cart_id, {\n option_id\n})\n.then(({ cart }) => {\n console.log(cart.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/shipping-methods' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"option_id\": \"{option_id}\",\n}'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/carts/{id}/taxes": { + "post": { + "summary": "Calculate Cart Taxes", + "operationId": "PostCartsCartTaxes", + "description": "Calculates taxes for a cart. Depending on the cart's region this may involve making 3rd party API calls to a Tax Provider service.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Cart ID.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "calculateTaxes" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/carts/{id}/taxes'\n" + } + ], + "tags": [ + "Carts" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/collections": { + "get": { + "operationId": "GetCollections", + "summary": "List Collections", + "description": "Retrieve a list of Product Collection.", + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The number of collections to skip before starting to collect the collections set", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of collections to return", + "schema": { + "type": "integer", + "default": 10 + } + }, + { + "in": "query", + "name": "handle", + "style": "form", + "explode": false, + "description": "Filter by the collection handle", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting collections were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting collections were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetCollectionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.collections.list()\n.then(({ collections, limit, offset, count }) => {\n console.log(collections.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/collections'\n" + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCollectionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/collections/{id}": { + "get": { + "operationId": "GetCollectionsCollection", + "summary": "Get a Collection", + "description": "Retrieves a Product Collection.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product Collection", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.collections.retrieve(collection_id)\n.then(({ collection }) => {\n console.log(collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/collections/{id}'\n" + } + ], + "tags": [ + "Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers": { + "post": { + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer account.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCustomersReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.customers.create({\n first_name: 'Alec',\n last_name: 'Reynolds',\n email: 'user@example.com',\n password: 'supersecret'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/customers' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"first_name\": \"Alec\",\n \"last_name\": \"Reynolds\",\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\"\n}'\n" + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "description": "A customer with the same email exists", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The error code" + }, + "type": { + "type": "string", + "description": "The type of error" + }, + "message": { + "type": "string", + "description": "Human-readable message with details about the error" + } + } + }, + "example": { + "code": "invalid_request_error", + "type": "duplicate_error", + "message": "A customer with the given email already has an account. Log in instead" + } + } + } + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers/me": { + "get": { + "operationId": "GetCustomersCustomer", + "summary": "Get a Customer", + "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", + "x-authenticated": true, + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.retrieve()\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/customers/me' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "post": { + "operationId": "PostCustomersCustomer", + "summary": "Update Customer", + "description": "Updates a Customer's saved details.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCustomersCustomerReq" + } + } + } + }, + "x-codegen": { + "method": "update" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.update({\n first_name: 'Laury'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/customers/me' \\\n--header 'Cookie: connect.sid={sid}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"first_name\": \"Laury\"\n}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/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": { + "$ref": "#/components/schemas/StorePostCustomersCustomerAddressesReq" + } + } + } + }, + "x-codegen": { + "method": "addAddress" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.addresses.addAddress({\n address: {\n first_name: 'Celia',\n last_name: 'Schumm',\n address_1: '225 Bednar Curve',\n city: 'Danielville',\n country_code: 'US',\n postal_code: '85137',\n phone: '981-596-6748 x90188',\n company: 'Wyman LLC',\n address_2: '',\n province: 'Georgia',\n metadata: {}\n }\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses' \\\n--header 'Cookie: connect.sid={sid}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"address\": {\n \"first_name\": \"Celia\",\n \"last_name\": \"Schumm\",\n \"address_1\": \"225 Bednar Curve\",\n \"city\": \"Danielville\",\n \"country_code\": \"US\",\n \"postal_code\": \"85137\"\n }\n}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "A successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers/me/addresses/{address_id}": { + "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": { + "$ref": "#/components/schemas/StorePostCustomersCustomerAddressesAddressReq" + } + } + } + }, + "x-codegen": { + "method": "updateAddress" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.addresses.updateAddress(address_id, {\n first_name: 'Gina'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \\\n--header 'Cookie: connect.sid={sid}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"first_name\": \"Gina\"\n}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + }, + "delete": { + "operationId": "DeleteCustomersCustomerAddressesAddress", + "summary": "Delete an Address", + "description": "Removes an Address from the Customer's saved addresses.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "address_id", + "required": true, + "description": "The id of the Address to remove.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "deleteAddress" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.addresses.deleteAddress(address_id)\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request DELETE 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers/me/orders": { + "get": { + "operationId": "GetCustomersCustomerOrders", + "summary": "List Orders", + "description": "Retrieves a list of a Customer's Orders.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching orders.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Id of the order to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "style": "form", + "explode": false, + "description": "Status to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "fulfillment_status", + "style": "form", + "explode": false, + "description": "Fulfillment status to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "payment_status", + "style": "form", + "explode": false, + "description": "Payment status to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "display_id", + "description": "Display id to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "email", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "currency_code", + "style": "form", + "explode": false, + "description": "The 3 character ISO currency code to set prices based on.", + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + }, + { + "in": "query", + "name": "tax_rate", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting collections were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting collections were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "canceled_at", + "description": "Date comparison for when resulting collections were canceled.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "limit", + "description": "How many orders to return.", + "schema": { + "type": "integer", + "default": 10 + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset in the resulting orders.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated string) Which fields should be included in the resulting orders.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated string) Which relations should be expanded in the resulting orders.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "listOrders", + "queryParams": "StoreGetCustomersCustomerOrdersParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.listOrders()\n.then(({ orders, limit, offset, count }) => {\n console.log(orders);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersListOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers/me/payment-methods": { + "get": { + "operationId": "GetCustomersCustomerPaymentMethods", + "summary": "Get Payment Methods", + "description": "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods.", + "x-authenticated": true, + "x-codegen": { + "method": "listPaymentMethods" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged\nmedusa.customers.paymentMethods.list()\n.then(({ payment_methods }) => {\n console.log(payment_methods.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/customers/me/payment-methods' \\\n--header 'Cookie: connect.sid={sid}'\n" + } + ], + "security": [ + { + "cookie_auth": [] + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersListPaymentMethodsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers/password-reset": { + "post": { + "operationId": "PostCustomersResetPassword", + "summary": "Reset Password", + "description": "Resets a Customer's password using a password token created by a previous /password-token request.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCustomersResetPasswordReq" + } + } + } + }, + "x-codegen": { + "method": "resetPassword" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.customers.resetPassword({\n email: 'user@example.com',\n password: 'supersecret',\n token: 'supersecrettoken'\n})\n.then(({ customer }) => {\n console.log(customer.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/customers/password-reset' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\",\n \"token\": \"supersecrettoken\"\n}'\n" + } + ], + "tags": [ + "Customers" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCustomersResetPasswordRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/customers/password-token": { + "post": { + "operationId": "PostCustomersCustomerPasswordToken", + "summary": "Request Password Reset", + "description": "Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCustomersCustomerPasswordTokenReq" + } + } + } + }, + "x-codegen": { + "method": "generatePasswordToken" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.customers.generatePasswordToken({\n email: 'user@example.com'\n})\n.then(() => {\n // successful\n})\n.catch(() => {\n // failed\n})\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/customers/password-token' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\"\n}'\n" + } + ], + "tags": [ + "Customers" + ], + "responses": { + "204": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/gift-cards/{code}": { + "get": { + "operationId": "GetGiftCardsCode", + "summary": "Get Gift Card by Code", + "description": "Retrieves a Gift Card by its associated unique code.", + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The unique Gift Card code.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.giftCards.retrieve(code)\n.then(({ gift_card }) => {\n console.log(gift_card.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/gift-cards/{code}'\n" + } + ], + "tags": [ + "Gift Cards" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreGiftCardsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/order-edits/{id}": { + "get": { + "operationId": "GetOrderEditsOrderEdit", + "summary": "Retrieve an OrderEdit", + "description": "Retrieves a OrderEdit.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the OrderEdit.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.orderEdits.retrieve(order_edit_id)\n.then(({ order_edit }) => {\n console.log(order_edit.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}'\n" + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/order-edits/{id}/complete": { + "post": { + "operationId": "PostOrderEditsOrderEditComplete", + "summary": "Completes an OrderEdit", + "description": "Completes an OrderEdit.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Order Edit.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "complete" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.orderEdits.complete(order_edit_id)\n .then(({ order_edit }) => {\n console.log(order_edit.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/complete'\n" + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/order-edits/{id}/decline": { + "post": { + "operationId": "PostOrderEditsOrderEditDecline", + "summary": "Decline an OrderEdit", + "description": "Declines an OrderEdit.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the OrderEdit.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostOrderEditsOrderEditDecline" + } + } + } + }, + "x-codegen": { + "method": "decline" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.orderEdits.decline(order_edit_id)\n .then(({ order_edit }) => {\n console.log(order_edit.id);\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/decline'\n" + } + ], + "tags": [ + "Order Edits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreOrderEditsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/orders": { + "get": { + "operationId": "GetOrders", + "summary": "Look Up an Order", + "description": "Look up an order using filters.", + "parameters": [ + { + "in": "query", + "name": "display_id", + "required": true, + "description": "The display id given to the Order.", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "email", + "style": "form", + "explode": false, + "description": "The email associated with this order.", + "required": true, + "schema": { + "type": "string", + "format": "email" + } + }, + { + "in": "query", + "name": "shipping_address", + "style": "form", + "explode": false, + "description": "The shipping address associated with this order.", + "schema": { + "type": "object", + "properties": { + "postal_code": { + "type": "string", + "description": "The postal code of the shipping address" + } + } + } + } + ], + "x-codegen": { + "method": "lookupOrder", + "queryParams": "StoreGetOrdersParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.orders.lookupOrder({\n display_id: 1,\n email: 'user@example.com'\n})\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com'\n" + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/orders/batch/customer/token": { + "post": { + "operationId": "PostOrdersCustomerOrderClaim", + "summary": "Claim an Order", + "description": "Sends an email to emails registered to orders provided with link to transfer order ownership", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCustomersCustomerOrderClaimReq" + } + } + } + }, + "x-codegen": { + "method": "requestCustomerOrders" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.orders.claimOrders({\n display_ids,\n})\n.then(() => {\n // successful\n})\n.catch(() => {\n // an error occurred\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"display_ids\": [\"id\"],\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/orders/cart/{cart_id}": { + "get": { + "operationId": "GetOrdersOrderCartId", + "summary": "Get by Cart ID", + "description": "Retrieves an Order by the id of the Cart that was used to create the Order.", + "parameters": [ + { + "in": "path", + "name": "cart_id", + "required": true, + "description": "The ID of Cart.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieveByCartId" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.orders.retrieveByCartId(cart_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/orders/cart/{id}'\n" + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/orders/customer/confirm": { + "post": { + "operationId": "PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept", + "summary": "Verify an Order Claim", + "description": "Verifies the claim order token provided to the customer upon request of order ownership", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostCustomersCustomerAcceptClaimReq" + } + } + } + }, + "x-codegen": { + "method": "confirmRequest" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.orders.confirmRequest(\n token,\n)\n.then(() => {\n // successful\n})\n.catch(() => {\n // an error occurred\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"token\": \"{token}\",\n}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/orders/{id}": { + "get": { + "operationId": "GetOrdersOrder", + "summary": "Get an Order", + "description": "Retrieves an Order", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in the result.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.orders.retrieve(order_id)\n.then(({ order }) => {\n console.log(order.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/orders/{id}'\n" + } + ], + "tags": [ + "Orders" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreOrdersRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/payment-collections/{id}": { + "get": { + "operationId": "GetPaymentCollectionsPaymentCollection", + "summary": "Get a PaymentCollection", + "description": "Get a Payment Collection", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the PaymentCollection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "StoreGetPaymentCollectionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.paymentCollections.retrieve(paymentCollectionId)\n .then(({ payment_collection }) => {\n console.log(payment_collection.id)\n })\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/payment-collections/{id}/sessions": { + "post": { + "operationId": "PostPaymentCollectionsSessions", + "summary": "Manage a Payment Session", + "description": "Manages Payment Sessions from Payment Collections.", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionSessionsReq" + } + } + } + }, + "x-codegen": { + "method": "managePaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\n\n// Total amount = 10000\n\n// Adding a payment session\nmedusa.paymentCollections.managePaymentSession(payment_id, { provider_id: \"stripe\" })\n.then(({ payment_collection }) => {\n console.log(payment_collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/payment-collections/{id}/sessions/batch": { + "post": { + "operationId": "PostPaymentCollectionsPaymentCollectionSessionsBatch", + "summary": "Manage Payment Sessions", + "description": "Manages Multiple Payment Sessions from Payment Collections.", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment Collections.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq" + } + } + } + }, + "x-codegen": { + "method": "managePaymentSessionsBatch" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\n\n// Total amount = 10000\n\n// Adding two new sessions\nmedusa.paymentCollections.managePaymentSessionsBatch(payment_id, [\n {\n provider_id: \"stripe\",\n amount: 5000,\n },\n {\n provider_id: \"manual\",\n amount: 5000,\n },\n])\n.then(({ payment_collection }) => {\n console.log(payment_collection.id);\n});\n\n// Updating one session and removing the other\nmedusa.paymentCollections.managePaymentSessionsBatch(payment_id, [\n {\n provider_id: \"stripe\",\n amount: 10000,\n session_id: \"ps_123456\"\n },\n])\n.then(({ payment_collection }) => {\n console.log(payment_collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/payment-collections/{id}/sessions/batch/authorize": { + "post": { + "operationId": "PostPaymentCollectionsSessionsBatchAuthorize", + "summary": "Authorize PaymentSessions", + "description": "Authorizes Payment Sessions of a Payment Collection.", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment Collections.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq" + } + } + } + }, + "x-codegen": { + "method": "authorizePaymentSessionsBatch" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.paymentCollections.authorize(payment_id)\n.then(({ payment_collection }) => {\n console.log(payment_collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/payment-collections/{id}/sessions/{session_id}": { + "post": { + "operationId": "PostPaymentCollectionsPaymentCollectionPaymentSessionsSession", + "summary": "Refresh a Payment Session", + "description": "Refreshes a Payment Session to ensure that it is in sync with the Payment Collection.", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the PaymentCollection.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "session_id", + "required": true, + "description": "The id of the Payment Session to be refreshed.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "refreshPaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id)\n.then(({ payment_session }) => {\n console.log(payment_session.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}'\n" + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionsSessionRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/payment-collections/{id}/sessions/{session_id}/authorize": { + "post": { + "operationId": "PostPaymentCollectionsSessionsSessionAuthorize", + "summary": "Authorize Payment Session", + "description": "Authorizes a Payment Session of a Payment Collection.", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Payment Collections.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "session_id", + "required": true, + "description": "The ID of the Payment Session.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "authorizePaymentSession" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.paymentCollections.authorize(payment_id, session_id)\n.then(({ payment_collection }) => {\n console.log(payment_collection.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Payment Collections" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePaymentCollectionsSessionRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/product-categories": { + "get": { + "operationId": "GetProductCategories", + "summary": "List Product Categories", + "description": "Retrieve a list of product categories.", + "x-authenticated": false, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching product category names or handles.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "parent_category_id", + "description": "Returns categories scoped by parent", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "include_descendants_tree", + "description": "Include all nested descendants of category", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many product categories to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of product categories returned.", + "schema": { + "type": "integer", + "default": 100 + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetProductCategoriesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.productCategories.list()\n.then(({ product_categories, limit, offset, count }) => {\n console.log(product_categories.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/product-categories' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreGetProductCategoriesRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/product-categories/{id}": { + "get": { + "operationId": "GetProductCategoriesCategory", + "summary": "Get a Product Category", + "description": "Retrieves a Product Category.", + "x-authenticated": false, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The ID of the Product Category", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each product category.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be retrieved in each product category.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "StoreGetProductCategoriesCategoryParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.productCategories.retrieve(product_category_id)\n .then(({ product_category }) => {\n console.log(product_category.id);\n });\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/product-categories/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Categories" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreGetProductCategoriesCategoryRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/product-tags": { + "get": { + "operationId": "GetProductTags", + "summary": "List Product Tags", + "description": "Retrieve a list of Product Tags.", + "x-authenticated": true, + "x-codegen": { + "method": "list", + "queryParams": "StoreGetProductTagsParams" + }, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of types to return.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "offset", + "description": "The number of items to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "order", + "description": "The field to sort items by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the product tags.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "style": "form", + "explode": false, + "description": "The tag values to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "The tag IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "q", + "description": "A query string to search values for", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting product tags were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting product tags were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.productTags.list()\n.then(({ product_tags }) => {\n console.log(product_tags.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/product-tags'\n" + } + ], + "tags": [ + "Product Tags" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreProductTagsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/product-types": { + "get": { + "operationId": "GetProductTypes", + "summary": "List Product Types", + "description": "Retrieve a list of Product Types.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of types to return.", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "in": "query", + "name": "offset", + "description": "The number of items to skip before the results.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "order", + "description": "The field to sort items by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "discount_condition_id", + "description": "The discount condition id on which to filter the product types.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "style": "form", + "explode": false, + "description": "The type values to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "The type IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "q", + "description": "A query string to search values for", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting product types were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting product types were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetProductTypesParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.productTypes.list()\n.then(({ product_types }) => {\n console.log(product_types.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/product-types' \\\n--header 'Authorization: Bearer {api_token}'\n" + } + ], + "security": [ + { + "api_token": [] + }, + { + "cookie_auth": [] + } + ], + "tags": [ + "Product Types" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreProductTypesListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "401": { + "$ref": "#/components/responses/unauthorized" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/products": { + "get": { + "operationId": "GetProducts", + "summary": "List Products", + "description": "Retrieves a list of Products.", + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching products by title, description, variant's title, variant's sku, and collection's title", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "style": "form", + "explode": false, + "description": "product IDs to search for.", + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + { + "in": "query", + "name": "sales_channel_id", + "style": "form", + "explode": false, + "description": "an array of sales channel IDs to filter the retrieved products by.", + "schema": { + "type": "array", + "items": { + "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": "type_id", + "style": "form", + "explode": false, + "description": "Type IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "tags", + "style": "form", + "explode": false, + "description": "Tag IDs to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "title", + "description": "title to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "description to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "handle to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_giftcard", + "description": "Search for giftcards using is_giftcard=true.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "category_id", + "style": "form", + "explode": false, + "description": "Category ids to filter by.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "include_category_children", + "description": "Include category children when filtering by category_id.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "integer", + "default": 100 + } + }, + { + "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" + } + }, + { + "in": "query", + "name": "order", + "description": "the field used to order the products.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "The id of the Cart to set prices based on.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "The id of the Region to set prices based on.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "currency_code", + "description": "The currency code to use for price selection.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetProductsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.products.list()\n.then(({ products, limit, offset, count }) => {\n console.log(products.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/products'\n" + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreProductsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/products/search": { + "post": { + "operationId": "PostProductsSearch", + "summary": "Search Products", + "description": "Run a search query on products using the search engine installed on Medusa", + "parameters": [ + { + "in": "query", + "name": "q", + "required": true, + "description": "The query to run the search with.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "integer" + } + } + ], + "x-codegen": { + "method": "search", + "queryParams": "StorePostSearchReq" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.products.search({\n q: 'Shirt'\n})\n.then(({ hits }) => {\n console.log(hits.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/products/search?q=Shirt'\n" + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostSearchRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/products/{id}": { + "get": { + "operationId": "GetProductsProduct", + "summary": "Get a Product", + "description": "Retrieves a Product.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "sales_channel_id", + "description": "The sales channel used when fetching the product.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "The ID of the customer's cart.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in the result.", + "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": "currency_code", + "style": "form", + "explode": false, + "description": "The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency.", + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "StoreGetProductsProductParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.products.retrieve(product_id)\n.then(({ product }) => {\n console.log(product.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/products/{id}'\n" + } + ], + "tags": [ + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreProductsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/regions": { + "get": { + "operationId": "GetRegions", + "summary": "List Regions", + "description": "Retrieves a list of Regions.", + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "How many regions to skip in the result.", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of regions returned.", + "schema": { + "type": "integer", + "default": 100 + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting regions were created.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting regions were updated.", + "schema": { + "type": "object", + "properties": { + "lt": { + "type": "string", + "description": "filter by dates less than this date", + "format": "date" + }, + "gt": { + "type": "string", + "description": "filter by dates greater than this date", + "format": "date" + }, + "lte": { + "type": "string", + "description": "filter by dates less than or equal to this date", + "format": "date" + }, + "gte": { + "type": "string", + "description": "filter by dates greater than or equal to this date", + "format": "date" + } + } + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetRegionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.regions.list()\n.then(({ regions }) => {\n console.log(regions.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/regions'\n" + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreRegionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/regions/{id}": { + "get": { + "operationId": "GetRegionsRegion", + "summary": "Get a Region", + "description": "Retrieves a Region.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Region.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.regions.retrieve(region_id)\n.then(({ region }) => {\n console.log(region.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/regions/{id}'\n" + } + ], + "tags": [ + "Regions" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreRegionsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/return-reasons": { + "get": { + "operationId": "GetReturnReasons", + "summary": "List Return Reasons", + "description": "Retrieves a list of Return Reasons.", + "x-codegen": { + "method": "list" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.returnReasons.list()\n.then(({ return_reasons }) => {\n console.log(return_reasons.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/return-reasons'\n" + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreReturnReasonsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/return-reasons/{id}": { + "get": { + "operationId": "GetReturnReasonsReason", + "summary": "Get a Return Reason", + "description": "Retrieves a Return Reason.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return Reason.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieve" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.returnReasons.retrieve(reason_id)\n.then(({ return_reason }) => {\n console.log(return_reason.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/return-reasons/{id}'\n" + } + ], + "tags": [ + "Return Reasons" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreReturnReasonsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/returns": { + "post": { + "operationId": "PostReturns", + "summary": "Create Return", + "description": "Creates a Return for an Order.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostReturnsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.returns.create({\n order_id,\n items: [\n {\n item_id,\n quantity: 1\n }\n ]\n})\n.then((data) => {\n console.log(data.return.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/returns' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"order_id\": \"asfasf\",\n \"items\": [\n {\n \"item_id\": \"assfasf\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "tags": [ + "Returns" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreReturnsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/shipping-options": { + "get": { + "operationId": "GetShippingOptions", + "summary": "Get Shipping Options", + "description": "Retrieves a list of Shipping Options.", + "parameters": [ + { + "in": "query", + "name": "is_return", + "description": "Whether return Shipping Options should be included. By default all Shipping Options are returned.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "product_ids", + "description": "A comma separated list of Product ids to filter Shipping Options by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "the Region to retrieve Shipping Options from.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetShippingOptionsParams" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.shippingOptions.list()\n.then(({ shipping_options }) => {\n console.log(shipping_options.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/shipping-options'\n" + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreShippingOptionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/shipping-options/{cart_id}": { + "get": { + "operationId": "GetShippingOptionsCartId", + "summary": "List for Cart", + "description": "Retrieves a list of Shipping Options available to a cart.", + "parameters": [ + { + "in": "path", + "name": "cart_id", + "required": true, + "description": "The id of the Cart.", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "listCartOptions" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.shippingOptions.listCartOptions(cart_id)\n.then(({ shipping_options }) => {\n console.log(shipping_options.length);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/shipping-options/{cart_id}'\n" + } + ], + "tags": [ + "Shipping Options" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreCartShippingOptionsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/swaps": { + "post": { + "operationId": "PostSwaps", + "summary": "Create a Swap", + "description": "Creates a Swap on an Order by providing some items to return along with some items to send back", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostSwapsReq" + } + } + } + }, + "x-codegen": { + "method": "create" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.swaps.create({\n order_id,\n return_items: [\n {\n item_id,\n quantity: 1\n }\n ],\n additional_items: [\n {\n variant_id,\n quantity: 1\n }\n ]\n})\n.then(({ swap }) => {\n console.log(swap.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request POST 'https://medusa-url.com/store/swaps' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"order_id\": \"asfasf\",\n \"return_items\": [\n {\n \"item_id\": \"asfas\",\n \"quantity\": 1\n }\n ],\n \"additional_items\": [\n {\n \"variant_id\": \"asfas\",\n \"quantity\": 1\n }\n ]\n}'\n" + } + ], + "tags": [ + "Swaps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreSwapsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/swaps/{cart_id}": { + "get": { + "operationId": "GetSwapsSwapCartId", + "summary": "Get by Cart ID", + "description": "Retrieves a Swap by the id of the Cart used to confirm the Swap.", + "parameters": [ + { + "in": "path", + "name": "cart_id", + "required": true, + "description": "The id of the Cart", + "schema": { + "type": "string" + } + } + ], + "x-codegen": { + "method": "retrieveByCartId" + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\nmedusa.swaps.retrieveByCartId(cart_id)\n.then(({ swap }) => {\n console.log(swap.id);\n});\n" + }, + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/swaps/{cart_id}'\n" + } + ], + "tags": [ + "Swaps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreSwapsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/variants": { + "get": { + "operationId": "GetVariants", + "summary": "Get Product Variants", + "description": "Retrieves a list of Product Variants", + "parameters": [ + { + "in": "query", + "name": "ids", + "description": "A comma separated list of Product Variant ids to filter by.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "sales_channel_id", + "description": "A sales channel id for result configuration.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "A comma separated list of Product Variant relations to load.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many product variants to skip in the result.", + "schema": { + "type": "number", + "default": "0" + } + }, + { + "in": "query", + "name": "limit", + "description": "Maximum number of Product Variants to return.", + "schema": { + "type": "number", + "default": "100" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "The id of the Cart to set prices based on.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "The id of the Region to set prices based on.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "currency_code", + "description": "The currency code to use for price selection.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "title", + "style": "form", + "explode": false, + "description": "product variant title to search for.", + "schema": { + "oneOf": [ + { + "type": "string", + "description": "a single title to search by" + }, + { + "type": "array", + "description": "multiple titles to search by", + "items": { + "type": "string" + } + } + ] + } + }, + { + "in": "query", + "name": "inventory_quantity", + "description": "Filter by available inventory quantity", + "schema": { + "oneOf": [ + { + "type": "number", + "description": "a specific number to search by." + }, + { + "type": "object", + "description": "search using less and greater than comparisons.", + "properties": { + "lt": { + "type": "number", + "description": "filter by inventory quantity less than this number" + }, + "gt": { + "type": "number", + "description": "filter by inventory quantity greater than this number" + }, + "lte": { + "type": "number", + "description": "filter by inventory quantity less than or equal to this number" + }, + "gte": { + "type": "number", + "description": "filter by inventory quantity greater than or equal to this number" + } + } + } + ] + } + } + ], + "x-codegen": { + "method": "list", + "queryParams": "StoreGetVariantsParams" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/variants'\n" + } + ], + "tags": [ + "Variants" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreVariantsListRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + }, + "/store/variants/{variant_id}": { + "get": { + "operationId": "GetVariantsVariant", + "summary": "Get a Product Variant", + "description": "Retrieves a Product Variant by id", + "parameters": [ + { + "in": "path", + "name": "variant_id", + "required": true, + "description": "The id of the Product Variant.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "The id of the Cart to set prices based on.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "sales_channel_id", + "description": "A sales channel id for result configuration.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "The id of the Region to set prices based on.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "currency_code", + "style": "form", + "explode": false, + "description": "The 3 character ISO currency code to set prices based on.", + "schema": { + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + } + } + ], + "x-codegen": { + "method": "retrieve", + "queryParams": "StoreGetVariantsVariantParams" + }, + "x-codeSamples": [ + { + "lang": "Shell", + "label": "cURL", + "source": "curl --location --request GET 'https://medusa-url.com/store/variants/{id}'\n" + } + ], + "tags": [ + "Variants" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoreVariantsRes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400_error" + }, + "404": { + "$ref": "#/components/responses/not_found_error" + }, + "409": { + "$ref": "#/components/responses/invalid_state_error" + }, + "422": { + "$ref": "#/components/responses/invalid_request_error" + }, + "500": { + "$ref": "#/components/responses/500_error" + } + } + } + } + }, + "components": { + "responses": { + "default_error": { + "description": "Default Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": "unknown_error", + "message": "An unknown error occurred.", + "type": "unknown_error" + } + } + } + }, + "invalid_state_error": { + "description": "Invalid State Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": "unknown_error", + "message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.", + "type": "QueryRunnerAlreadyReleasedError" + } + } + } + }, + "invalid_request_error": { + "description": "Invalid Request Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "code": "invalid_request_error", + "message": "Discount with code TEST already exists.", + "type": "duplicate_error" + } + } + } + }, + "not_found_error": { + "description": "Not Found Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "Entity with id 1 was not found", + "type": "not_found" + } + } + } + }, + "400_error": { + "description": "Client Error or Multiple Errors", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error" + }, + { + "$ref": "#/components/schemas/MultipleErrors" + } + ] + }, + "examples": { + "not_allowed": { + "$ref": "#/components/examples/not_allowed_error" + }, + "invalid_data": { + "$ref": "#/components/examples/invalid_data_error" + }, + "MultipleErrors": { + "$ref": "#/components/examples/multiple_errors" + } + } + } + } + }, + "500_error": { + "description": "Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "examples": { + "database": { + "$ref": "#/components/examples/database_error" + }, + "unexpected_state": { + "$ref": "#/components/examples/unexpected_state_error" + }, + "invalid_argument": { + "$ref": "#/components/examples/invalid_argument_error" + }, + "default_error": { + "$ref": "#/components/examples/default_error" + } + } + } + } + }, + "unauthorized": { + "description": "User is not authorized. Must log in first", + "content": { + "text/plain": { + "schema": { + "type": "string", + "default": "Unauthorized", + "example": "Unauthorized" + } + } + } + }, + "incorrect_credentials": { + "description": "User does not exist or incorrect credentials", + "content": { + "text/plain": { + "schema": { + "type": "string", + "default": "Unauthorized", + "example": "Unauthorized" + } + } + } + } + }, + "examples": { + "not_allowed_error": { + "summary": "Not Allowed Error", + "value": { + "message": "Discount must be set to dynamic", + "type": "not_allowed" + } + }, + "invalid_data_error": { + "summary": "Invalid Data Error", + "value": { + "message": "first_name must be a string", + "type": "invalid_data" + } + }, + "multiple_errors": { + "summary": "Multiple Errors", + "value": { + "message": "Provided request body contains errors. Please check the data and retry the request", + "errors": [ + { + "message": "first_name must be a string", + "type": "invalid_data" + }, + { + "message": "Discount must be set to dynamic", + "type": "not_allowed" + } + ] + } + }, + "database_error": { + "summary": "Database Error", + "value": { + "code": "api_error", + "message": "An error occured while hashing password", + "type": "database_error" + } + }, + "unexpected_state_error": { + "summary": "Unexpected State Error", + "value": { + "message": "cart.total must be defined", + "type": "unexpected_state" + } + }, + "invalid_argument_error": { + "summary": "Invalid Argument Error", + "value": { + "message": "cart.total must be defined", + "type": "unexpected_state" + } + }, + "default_error": { + "summary": "Default Error", + "value": { + "code": "unknown_error", + "message": "An unknown error occurred.", + "type": "unknown_error" + } + } + }, + "securitySchemes": { + "cookie_auth": { + "type": "apiKey", + "x-displayName": "Cookie Session ID", + "in": "cookie", + "name": "connect.sid", + "description": "Use a cookie session to send authenticated requests.\n\n### How to Obtain the Cookie Session\n\nIf you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the customer is logged in.\n\nIf you're sending requests using cURL, you must set the Session ID in the cookie manually.\n\nTo do that, send a request to [authenticate the customer](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`:\n\n```bash\ncurl -v --location --request POST 'https://medusa-url.com/store/auth' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"email\": \"user@example.com\",\n \"password\": \"supersecret\"\n}'\n```\n\nThe headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this:\n\n```bash\nSet-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM;\n```\n\nCopy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following:\n\n```bash\ncurl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \\\n--header 'Cookie: connect.sid={sid}'\n```\n\nWhere `{sid}` is the value of `connect.sid` that you copied.\n" + } + }, + "schemas": { + "Address": { + "title": "Address", + "description": "An address.", + "type": "object", + "required": [ + "address_1", + "address_2", + "city", + "company", + "country_code", + "created_at", + "customer_id", + "deleted_at", + "first_name", + "id", + "last_name", + "metadata", + "phone", + "postal_code", + "province", + "updated_at" + ], + "properties": { + "id": { + "type": "string", + "description": "ID of the address", + "example": "addr_01G8ZC9VS1XVE149MGH2J7QSSH" + }, + "customer_id": { + "description": "ID of the customer this address belongs to", + "nullable": true, + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "company": { + "description": "Company name", + "nullable": true, + "type": "string", + "example": "Acme" + }, + "first_name": { + "description": "First name", + "nullable": true, + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "Last name", + "nullable": true, + "type": "string", + "example": "Willms" + }, + "address_1": { + "description": "Address line 1", + "nullable": true, + "type": "string", + "example": "14433 Kemmer Court" + }, + "address_2": { + "description": "Address line 2", + "nullable": true, + "type": "string", + "example": "Suite 369" + }, + "city": { + "description": "City", + "nullable": true, + "type": "string", + "example": "South Geoffreyview" + }, + "country_code": { + "description": "The 2 character ISO code of the country in lower case", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + }, + "example": "st" + }, + "country": { + "description": "A country object. Available if the relation `country` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Country" + }, + "province": { + "description": "Province", + "nullable": true, + "type": "string", + "example": "Kentucky" + }, + "postal_code": { + "description": "Postal Code", + "nullable": true, + "type": "string", + "example": 72093 + }, + "phone": { + "description": "Phone Number", + "nullable": true, + "type": "string", + "example": 16128234334802 + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "AddressCreatePayload": { + "type": "object", + "description": "Address fields used when creating an address.", + "required": [ + "first_name", + "last_name", + "address_1", + "city", + "country_code", + "postal_code" + ], + "properties": { + "first_name": { + "description": "First name", + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "Last name", + "type": "string", + "example": "Willms" + }, + "phone": { + "type": "string", + "description": "Phone Number", + "example": 16128234334802 + }, + "company": { + "type": "string" + }, + "address_1": { + "description": "Address line 1", + "type": "string", + "example": "14433 Kemmer Court" + }, + "address_2": { + "description": "Address line 2", + "type": "string", + "example": "Suite 369" + }, + "city": { + "description": "City", + "type": "string", + "example": "South Geoffreyview" + }, + "country_code": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + }, + "example": "st" + }, + "province": { + "description": "Province", + "type": "string", + "example": "Kentucky" + }, + "postal_code": { + "description": "Postal Code", + "type": "string", + "example": 72093 + }, + "metadata": { + "type": "object", + "example": { + "car": "white" + }, + "description": "An optional key-value map with additional details" + } + } + }, + "AddressPayload": { + "type": "object", + "description": "Address fields used when creating/updating an address.", + "properties": { + "first_name": { + "description": "First name", + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "Last name", + "type": "string", + "example": "Willms" + }, + "phone": { + "type": "string", + "description": "Phone Number", + "example": 16128234334802 + }, + "company": { + "type": "string" + }, + "address_1": { + "description": "Address line 1", + "type": "string", + "example": "14433 Kemmer Court" + }, + "address_2": { + "description": "Address line 2", + "type": "string", + "example": "Suite 369" + }, + "city": { + "description": "City", + "type": "string", + "example": "South Geoffreyview" + }, + "country_code": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + }, + "example": "st" + }, + "province": { + "description": "Province", + "type": "string", + "example": "Kentucky" + }, + "postal_code": { + "description": "Postal Code", + "type": "string", + "example": 72093 + }, + "metadata": { + "type": "object", + "example": { + "car": "white" + }, + "description": "An optional key-value map with additional details" + } + } + }, + "BatchJob": { + "title": "Batch Job", + "description": "A Batch Job.", + "type": "object", + "required": [ + "canceled_at", + "completed_at", + "confirmed_at", + "context", + "created_at", + "created_by", + "deleted_at", + "dry_run", + "failed_at", + "id", + "pre_processed_at", + "processing_at", + "result", + "status", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The unique identifier for the batch job.", + "type": "string", + "example": "batch_01G8T782965PYFG0751G0Z38B4" + }, + "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", + "confirmed", + "processing", + "completed", + "canceled", + "failed" + ], + "default": "created" + }, + "created_by": { + "description": "The unique identifier of the user that created the batch job.", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "created_by_user": { + "description": "A user object. Available if the relation `created_by_user` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/User" + }, + "context": { + "description": "The context of the batch job, the type of the batch job determines what the context should contain.", + "nullable": true, + "type": "object", + "example": { + "shape": { + "prices": [ + { + "region": null, + "currency_code": "eur" + } + ], + "dynamicImageColumnCount": 4, + "dynamicOptionColumnCount": 2 + }, + "list_config": { + "skip": 0, + "take": 50, + "order": { + "created_at": "DESC" + }, + "relations": [ + "variants", + "variant.prices", + "images" + ] + } + } + }, + "dry_run": { + "description": "Specify if the job must apply the modifications or not.", + "type": "boolean", + "default": false + }, + "result": { + "description": "The result of the batch job.", + "nullable": true, + "allOf": [ + { + "type": "object", + "example": {} + }, + { + "type": "object", + "properties": { + "count": { + "type": "number" + }, + "advancement_count": { + "type": "number" + }, + "progress": { + "type": "number" + }, + "errors": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "err": { + "type": "array" + } + } + }, + "stat_descriptors": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "file_key": { + "type": "string" + }, + "file_size": { + "type": "number" + } + } + } + ], + "example": { + "errors": [ + { + "err": [], + "code": "unknown", + "message": "Method not implemented." + } + ], + "stat_descriptors": [ + { + "key": "product-export-count", + "name": "Product count to export", + "message": "There will be 8 products exported by this action" + } + ] + } + }, + "pre_processed_at": { + "description": "The date from which the job has been pre-processed.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "processing_at": { + "description": "The date the job is processing at.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "confirmed_at": { + "description": "The date when the confirmation has been done.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date of the completion.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date of the concellation.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "failed_at": { + "description": "The date when the job failed.", + "nullable": true, + "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.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "Cart": { + "title": "Cart", + "description": "Represents a user cart", + "type": "object", + "required": [ + "billing_address_id", + "completed_at", + "context", + "created_at", + "customer_id", + "deleted_at", + "email", + "id", + "idempotency_key", + "metadata", + "payment_authorized_at", + "payment_id", + "payment_session", + "region_id", + "shipping_address_id", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The cart's ID", + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "email": { + "description": "The email associated with the cart", + "nullable": true, + "type": "string", + "format": "email" + }, + "billing_address_id": { + "description": "The billing address's ID", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "billing_address": { + "description": "Available if the relation `billing_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_address_id": { + "description": "The shipping address's ID", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "items": { + "description": "Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "discounts": { + "description": "Available if the relation `discounts` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Discount" + } + }, + "gift_cards": { + "description": "Available if the relation `gift_cards` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + } + }, + "customer_id": { + "description": "The customer's ID", + "nullable": true, + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "A customer object. Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "payment_session": { + "description": "The selected payment session in the cart.", + "nullable": true, + "$ref": "#/components/schemas/PaymentSession" + }, + "payment_sessions": { + "description": "The payment sessions created on the cart.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentSession" + } + }, + "payment_id": { + "description": "The payment's ID if available", + "nullable": true, + "type": "string", + "example": "pay_01G8ZCC5W42ZNY842124G7P5R9" + }, + "payment": { + "description": "Available if the relation `payment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Payment" + }, + "shipping_methods": { + "description": "The shipping methods added to the cart.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "type": { + "description": "The cart's type.", + "type": "string", + "enum": [ + "default", + "swap", + "draft_order", + "payment_link", + "claim" + ], + "default": "default" + }, + "completed_at": { + "description": "The date with timezone at which the cart was completed.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "payment_authorized_at": { + "description": "The date with timezone at which the payment was authorized.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a cart in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "context": { + "description": "The context of the cart which can include info like IP or user agent.", + "nullable": true, + "type": "object", + "example": { + "ip": "::1", + "user_agent": "PostmanRuntime/7.29.2" + } + }, + "sales_channel_id": { + "description": "The sales channel ID the cart is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channel": { + "description": "A sales channel object. Available if the relation `sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + }, + "shipping_total": { + "description": "The total of shipping", + "type": "integer", + "example": 1000 + }, + "discount_total": { + "description": "The total of discount rounded", + "type": "integer", + "example": 800 + }, + "raw_discount_total": { + "description": "The total of discount", + "type": "integer", + "example": 800 + }, + "item_tax_total": { + "description": "The total of items with taxes", + "type": "integer", + "example": 8000 + }, + "shipping_tax_total": { + "description": "The total of shipping with taxes", + "type": "integer", + "example": 1000 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + }, + "refunded_total": { + "description": "The total amount refunded if the order associated with this cart is returned.", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the cart", + "type": "integer", + "example": 8200 + }, + "subtotal": { + "description": "The subtotal of the cart", + "type": "integer", + "example": 8000 + }, + "refundable_amount": { + "description": "The amount that can be refunded", + "type": "integer", + "example": 8200 + }, + "gift_card_total": { + "description": "The total of gift cards", + "type": "integer", + "example": 0 + }, + "gift_card_tax_total": { + "description": "The total of gift cards with taxes", + "type": "integer", + "example": 0 + } + } + }, + "ClaimImage": { + "title": "Claim Image", + "description": "Represents photo documentation of a claim.", + "type": "object", + "required": [ + "claim_item_id", + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "url" + ], + "properties": { + "id": { + "description": "The claim image's ID", + "type": "string", + "example": "cimg_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "claim_item_id": { + "description": "The ID of the claim item associated with the image", + "type": "string" + }, + "claim_item": { + "description": "A claim item object. Available if the relation `claim_item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimItem" + }, + "url": { + "description": "The URL of the image", + "type": "string", + "format": "uri" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ClaimItem": { + "title": "Claim Item", + "description": "Represents a claimed item along with information about the reasons for the claim.", + "type": "object", + "required": [ + "claim_order_id", + "created_at", + "deleted_at", + "id", + "item_id", + "metadata", + "note", + "quantity", + "reason", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The claim item's ID", + "type": "string", + "example": "citm_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "images": { + "description": "Available if the relation `images` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimImage" + } + }, + "claim_order_id": { + "description": "The ID of the claim this item is associated with.", + "type": "string" + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "item_id": { + "description": "The ID of the line item that the claim item refers to.", + "type": "string", + "example": "item_01G8ZM25TN49YV9EQBE2NC27KC" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "variant_id": { + "description": "The ID of the product variant that is claimed.", + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "A variant object. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "reason": { + "description": "The reason for the claim", + "type": "string", + "enum": [ + "missing_item", + "wrong_item", + "production_failure", + "other" + ] + }, + "note": { + "description": "An optional note about the claim, for additional information", + "nullable": true, + "type": "string", + "example": "I don't like it." + }, + "quantity": { + "description": "The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order.", + "type": "integer", + "example": 1 + }, + "tags": { + "description": "User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimTag" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ClaimOrder": { + "title": "Claim Order", + "description": "Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns.", + "type": "object", + "required": [ + "canceled_at", + "created_at", + "deleted_at", + "fulfillment_status", + "id", + "idempotency_key", + "metadata", + "no_notification", + "order_id", + "payment_status", + "refund_amount", + "shipping_address_id", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The claim's ID", + "type": "string", + "example": "claim_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "type": { + "description": "The claim's type", + "type": "string", + "enum": [ + "refund", + "replace" + ] + }, + "payment_status": { + "description": "The status of the claim's payment", + "type": "string", + "enum": [ + "na", + "not_refunded", + "refunded" + ], + "default": "na" + }, + "fulfillment_status": { + "description": "The claim's fulfillment status", + "type": "string", + "enum": [ + "not_fulfilled", + "partially_fulfilled", + "fulfilled", + "partially_shipped", + "shipped", + "partially_returned", + "returned", + "canceled", + "requires_action" + ], + "default": "not_fulfilled" + }, + "claim_items": { + "description": "The items that have been claimed", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimItem" + } + }, + "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/LineItem" + } + }, + "order_id": { + "description": "The ID of the order that the claim comes from.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "return_order": { + "description": "A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "shipping_address_id": { + "description": "The ID of the address that the new items should be shipped to", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_methods": { + "description": "The shipping methods that the claim order will be shipped with.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "fulfillments": { + "description": "The fulfillments of the new items to be shipped", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + } + }, + "refund_amount": { + "description": "The amount that will be refunded in conjunction with the claim", + "nullable": true, + "type": "integer", + "example": 1000 + }, + "canceled_at": { + "description": "The date with timezone at which the claim was canceled.", + "nullable": true, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the cart associated with the claim in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + } + } + }, + "ClaimTag": { + "title": "Claim Tag", + "description": "Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The claim tag's ID", + "type": "string", + "example": "ctag_01G8ZCC5Y63B95V6B5SHBZ91S4" + }, + "value": { + "description": "The value that the claim tag holds", + "type": "string", + "example": "Damaged" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Country": { + "title": "Country", + "description": "Country details", + "type": "object", + "required": [ + "display_name", + "id", + "iso_2", + "iso_3", + "name", + "num_code", + "region_id" + ], + "properties": { + "id": { + "description": "The country's ID", + "type": "string", + "example": 109 + }, + "iso_2": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "example": "it", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "iso_3": { + "description": "The 2 character ISO code of the country in lower case", + "type": "string", + "example": "ita", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "num_code": { + "description": "The numerical ISO code for the country.", + "type": "string", + "example": 380, + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "name": { + "description": "The normalized country name in upper case.", + "type": "string", + "example": "ITALY" + }, + "display_name": { + "description": "The country name appropriate for display.", + "type": "string", + "example": "Italy" + }, + "region_id": { + "description": "The region ID this country is associated with.", + "nullable": true, + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + } + } + }, + "CreateStockLocationInput": { + "title": "Create Stock Location Input", + "description": "Represents the Input to create a Stock Location", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The stock location name" + }, + "address_id": { + "type": "string", + "description": "The Stock location address ID" + }, + "address": { + "description": "Stock location address object", + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationAddressInput" + }, + { + "type": "object" + } + ] + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "Currency": { + "title": "Currency", + "description": "Currency", + "type": "object", + "required": [ + "code", + "name", + "symbol", + "symbol_native" + ], + "properties": { + "code": { + "description": "The 3 character ISO code for the currency.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "symbol": { + "description": "The symbol used to indicate the currency.", + "type": "string", + "example": "$" + }, + "symbol_native": { + "description": "The native symbol used to indicate the currency.", + "type": "string", + "example": "$" + }, + "name": { + "description": "The written name of the currency", + "type": "string", + "example": "US Dollar" + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the currency prices include tax", + "type": "boolean", + "default": false + } + } + }, + "CustomShippingOption": { + "title": "Custom Shipping Option", + "description": "Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option", + "type": "object", + "required": [ + "cart_id", + "created_at", + "deleted_at", + "id", + "metadata", + "price", + "shipping_option_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The custom shipping option's ID", + "type": "string", + "example": "cso_01G8X99XNB77DMFBJFWX6DN9V9" + }, + "price": { + "description": "The custom price set that will override the shipping option's original price", + "type": "integer", + "example": 1000 + }, + "shipping_option_id": { + "description": "The ID of the Shipping Option that the custom shipping option overrides", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "shipping_option": { + "description": "A shipping option object. Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "cart_id": { + "description": "The ID of the Cart that the custom shipping option is attached to", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Customer": { + "title": "Customer", + "description": "Represents a customer", + "type": "object", + "required": [ + "billing_address_id", + "created_at", + "deleted_at", + "email", + "first_name", + "has_account", + "id", + "last_name", + "metadata", + "phone", + "updated_at" + ], + "properties": { + "id": { + "description": "The customer's ID", + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "email": { + "description": "The customer's email", + "type": "string", + "format": "email" + }, + "first_name": { + "description": "The customer's first name", + "nullable": true, + "type": "string", + "example": "Arno" + }, + "last_name": { + "description": "The customer's last name", + "nullable": true, + "type": "string", + "example": "Willms" + }, + "billing_address_id": { + "description": "The customer's billing address ID", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "billing_address": { + "description": "Available if the relation `billing_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_addresses": { + "description": "Available if the relation `shipping_addresses` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "phone": { + "description": "The customer's phone number", + "nullable": true, + "type": "string", + "example": 16128234334802 + }, + "has_account": { + "description": "Whether the customer has an account or not", + "type": "boolean", + "default": false + }, + "orders": { + "description": "Available if the relation `orders` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + } + }, + "groups": { + "description": "The customer groups the customer belongs to. Available if the relation `groups` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "CustomerGroup": { + "title": "Customer Group", + "description": "Represents a customer group", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "name", + "updated_at" + ], + "properties": { + "id": { + "description": "The customer group's ID", + "type": "string", + "example": "cgrp_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "name": { + "description": "The name of the customer group", + "type": "string", + "example": "VIP" + }, + "customers": { + "description": "The customers that belong to the customer group. Available if the relation `customers` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + } + }, + "price_lists": { + "description": "The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PriceList" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Discount": { + "title": "Discount", + "description": "Represents a discount that can be applied to a cart for promotional purposes.", + "type": "object", + "required": [ + "code", + "created_at", + "deleted_at", + "ends_at", + "id", + "is_disabled", + "is_dynamic", + "metadata", + "parent_discount_id", + "rule_id", + "starts_at", + "updated_at", + "usage_count", + "usage_limit", + "valid_duration" + ], + "properties": { + "id": { + "description": "The discount's ID", + "type": "string", + "example": "disc_01F0YESMW10MGHWJKZSDDMN0VN" + }, + "code": { + "description": "A unique code for the discount - this will be used by the customer to apply the discount", + "type": "string", + "example": "10DISC" + }, + "is_dynamic": { + "description": "A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts", + "type": "boolean", + "example": false + }, + "rule_id": { + "description": "The Discount Rule that governs the behaviour of the Discount", + "nullable": true, + "type": "string", + "example": "dru_01F0YESMVK96HVX7N419E3CJ7C" + }, + "rule": { + "description": "Available if the relation `rule` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountRule" + }, + "is_disabled": { + "description": "Whether the Discount has been disabled. Disabled discounts cannot be applied to carts", + "type": "boolean", + "example": false + }, + "parent_discount_id": { + "description": "The Discount that the discount was created from. This will always be a dynamic discount", + "nullable": true, + "type": "string", + "example": "disc_01G8ZH853YPY9B94857DY91YGW" + }, + "parent_discount": { + "description": "Available if the relation `parent_discount` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Discount" + }, + "starts_at": { + "description": "The time at which the discount can be used.", + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The time at which the discount can no longer be used.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "valid_duration": { + "description": "Duration the discount runs between", + "nullable": true, + "type": "string", + "example": "P3Y6M4DT12H30M5S" + }, + "regions": { + "description": "The Regions in which the Discount can be used. Available if the relation `regions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Region" + } + }, + "usage_limit": { + "description": "The maximum number of times that a discount can be used.", + "nullable": true, + "type": "integer", + "example": 100 + }, + "usage_count": { + "description": "The number of times a discount has been used.", + "type": "integer", + "example": 50, + "default": 0 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountCondition": { + "title": "Discount Condition", + "description": "Holds rule conditions for when a discount is applicable", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "discount_rule_id", + "id", + "metadata", + "operator", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The discount condition's ID", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "type": { + "description": "The type of the Condition", + "type": "string", + "enum": [ + "products", + "product_types", + "product_collections", + "product_tags", + "customer_groups" + ] + }, + "operator": { + "description": "The operator of the Condition", + "type": "string", + "enum": [ + "in", + "not_in" + ] + }, + "discount_rule_id": { + "description": "The ID of the discount rule associated with the condition", + "type": "string", + "example": "dru_01F0YESMVK96HVX7N419E3CJ7C" + }, + "discount_rule": { + "description": "Available if the relation `discount_rule` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountRule" + }, + "products": { + "description": "products associated with this condition if type = products. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "product_types": { + "description": "Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + }, + "product_tags": { + "description": "Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductTag" + } + }, + "product_collections": { + "description": "Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCollection" + } + }, + "customer_groups": { + "description": "Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionCustomerGroup": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a customer group", + "type": "object", + "required": [ + "condition_id", + "created_at", + "customer_group_id", + "metadata", + "updated_at" + ], + "properties": { + "customer_group_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "cgrp_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "customer_group": { + "description": "Available if the relation `customer_group` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/CustomerGroup" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProduct": { + "title": "Product Discount Condition", + "description": "Associates a discount condition with a product", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_id", + "updated_at" + ], + "properties": { + "product_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product": { + "description": "Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProductCollection": { + "title": "Product Collection Discount Condition", + "description": "Associates a discount condition with a product collection", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_collection_id", + "updated_at" + ], + "properties": { + "product_collection_id": { + "description": "The ID of the Product Collection", + "type": "string", + "example": "pcol_01F0YESBFAZ0DV6V831JXWH0BG" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_collection": { + "description": "Available if the relation `product_collection` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductCollection" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProductTag": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a product tag", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_tag_id", + "updated_at" + ], + "properties": { + "product_tag_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "ptag_01F0YESHPZYY3H4SJ3A5918SBN" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_tag": { + "description": "Available if the relation `product_tag` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductTag" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountConditionProductType": { + "title": "Product Type Discount Condition", + "description": "Associates a discount condition with a product type", + "type": "object", + "required": [ + "condition_id", + "created_at", + "metadata", + "product_type_id", + "updated_at" + ], + "properties": { + "product_type_id": { + "description": "The ID of the Product Tag", + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "condition_id": { + "description": "The ID of the Discount Condition", + "type": "string", + "example": "discon_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_type": { + "description": "Available if the relation `product_type` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductType" + }, + "discount_condition": { + "description": "Available if the relation `discount_condition` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DiscountCondition" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DiscountRule": { + "title": "Discount Rule", + "description": "Holds the rules that governs how a Discount is calculated when applied to a Cart.", + "type": "object", + "required": [ + "allocation", + "created_at", + "deleted_at", + "description", + "id", + "metadata", + "type", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The discount rule's ID", + "type": "string", + "example": "dru_01F0YESMVK96HVX7N419E3CJ7C" + }, + "type": { + "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.", + "type": "string", + "enum": [ + "fixed", + "percentage", + "free_shipping" + ], + "example": "percentage" + }, + "description": { + "description": "A short description of the discount", + "nullable": true, + "type": "string", + "example": "10 Percent" + }, + "value": { + "description": "The value that the discount represents; this will depend on the type of the discount", + "type": "integer", + "example": 10 + }, + "allocation": { + "description": "The scope that the discount should apply to.", + "nullable": true, + "type": "string", + "enum": [ + "total", + "item" + ], + "example": "total" + }, + "conditions": { + "description": "A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/DiscountCondition" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "DraftOrder": { + "title": "DraftOrder", + "description": "Represents a draft order", + "type": "object", + "required": [ + "canceled_at", + "cart_id", + "completed_at", + "created_at", + "display_id", + "id", + "idempotency_key", + "metadata", + "no_notification_order", + "order_id", + "status", + "updated_at" + ], + "properties": { + "id": { + "description": "The draft order's ID", + "type": "string", + "example": "dorder_01G8TJFKBG38YYFQ035MSVG03C" + }, + "status": { + "description": "The status of the draft order", + "type": "string", + "enum": [ + "open", + "completed" + ], + "default": "open" + }, + "display_id": { + "description": "The draft order's display ID", + "type": "string", + "example": 2 + }, + "cart_id": { + "description": "The ID of the cart associated with the draft order.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "order_id": { + "description": "The ID of the order associated with the draft order.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "canceled_at": { + "description": "The date the draft order was canceled at.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date the draft order was completed at.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification_order": { + "description": "Whether to send the customer notifications regarding order updates.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Error": { + "title": "Response Error", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "A slug code to indicate the type of the error." + }, + "message": { + "type": "string", + "description": "Description of the error that occurred." + }, + "type": { + "type": "string", + "description": "A slug indicating the type of the error." + } + } + }, + "ExtendedStoreDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/Store" + }, + { + "type": "object", + "required": [ + "payment_providers", + "fulfillment_providers", + "feature_flags", + "modules" + ], + "properties": { + "payment_providers": { + "$ref": "#/components/schemas/PaymentProvider" + }, + "fulfillment_providers": { + "$ref": "#/components/schemas/FulfillmentProvider" + }, + "feature_flags": { + "$ref": "#/components/schemas/FeatureFlagsResponse" + }, + "modules": { + "$ref": "#/components/schemas/ModulesResponse" + } + } + } + ] + }, + "FeatureFlagsResponse": { + "type": "array", + "items": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "description": "The key of the feature flag.", + "type": "string" + }, + "value": { + "description": "The value of the feature flag.", + "type": "boolean" + } + } + } + }, + "Fulfillment": { + "title": "Fulfillment", + "description": "Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments.", + "type": "object", + "required": [ + "canceled_at", + "claim_order_id", + "created_at", + "data", + "id", + "idempotency_key", + "location_id", + "metadata", + "no_notification", + "order_id", + "provider_id", + "shipped_at", + "swap_id", + "tracking_numbers", + "updated_at" + ], + "properties": { + "id": { + "description": "The fulfillment's ID", + "type": "string", + "example": "ful_01G8ZRTMQCA76TXNAT81KPJZRF" + }, + "claim_order_id": { + "description": "The id of the Claim that the Fulfillment belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "swap_id": { + "description": "The id of the Swap that the Fulfillment belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "order_id": { + "description": "The id of the Order that the Fulfillment belongs to.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "provider_id": { + "description": "The id of the Fulfillment Provider responsible for handling the fulfillment", + "type": "string", + "example": "manual" + }, + "provider": { + "description": "Available if the relation `provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/FulfillmentProvider" + }, + "location_id": { + "description": "The id of the stock location the fulfillment will be shipped from", + "nullable": true, + "type": "string", + "example": "sloc_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "items": { + "description": "The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentItem" + } + }, + "tracking_links": { + "description": "The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TrackingLink" + } + }, + "tracking_numbers": { + "description": "The tracking numbers that can be used to track the status of the fulfillment.", + "deprecated": true, + "type": "array", + "items": { + "type": "string" + } + }, + "data": { + "description": "This contains all the data necessary for the Fulfillment provider to handle the fulfillment.", + "type": "object", + "example": {} + }, + "shipped_at": { + "description": "The date with timezone at which the Fulfillment was shipped.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be sent.", + "nullable": true, + "type": "boolean", + "example": false + }, + "canceled_at": { + "description": "The date with timezone at which the Fulfillment was canceled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the fulfillment in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "FulfillmentItem": { + "title": "Fulfillment Item", + "description": "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item.", + "type": "object", + "required": [ + "fulfillment_id", + "item_id", + "quantity" + ], + "properties": { + "fulfillment_id": { + "description": "The id of the Fulfillment that the Fulfillment Item belongs to.", + "type": "string", + "example": "ful_01G8ZRTMQCA76TXNAT81KPJZRF" + }, + "item_id": { + "description": "The id of the Line Item that the Fulfillment Item references.", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "fulfillment": { + "description": "A fulfillment object. Available if the relation `fulfillment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Fulfillment" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "quantity": { + "description": "The quantity of the Line Item that is included in the Fulfillment.", + "type": "integer", + "example": 1 + } + } + }, + "FulfillmentProvider": { + "title": "Fulfillment Provider", + "description": "Represents a fulfillment provider plugin and holds its installation status.", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the fulfillment provider as given by the plugin.", + "type": "string", + "example": "manual" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "GiftCard": { + "title": "Gift Card", + "description": "Gift Cards are redeemable and represent a value that can be used towards the payment of an Order.", + "type": "object", + "required": [ + "balance", + "code", + "created_at", + "deleted_at", + "ends_at", + "id", + "is_disabled", + "metadata", + "order_id", + "region_id", + "tax_rate", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The gift card's ID", + "type": "string", + "example": "gift_01G8XKBPBQY2R7RBET4J7E0XQZ" + }, + "code": { + "description": "The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card.", + "type": "string", + "example": "3RFT-MH2C-Y4YZ-XMN4" + }, + "value": { + "description": "The value that the Gift Card represents.", + "type": "integer", + "example": 10 + }, + "balance": { + "description": "The remaining value on the Gift Card.", + "type": "integer", + "example": 10 + }, + "region_id": { + "description": "The id of the Region in which the Gift Card is available.", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "order_id": { + "description": "The id of the Order that the Gift Card was purchased in.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "is_disabled": { + "description": "Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts.", + "type": "boolean", + "default": false + }, + "ends_at": { + "description": "The time at which the Gift Card can no longer be used.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "tax_rate": { + "description": "The gift card's tax rate that will be applied on calculating totals", + "nullable": true, + "type": "number", + "example": 0 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "GiftCardTransaction": { + "title": "Gift Card Transaction", + "description": "Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order", + "type": "object", + "required": [ + "amount", + "created_at", + "gift_card_id", + "id", + "is_taxable", + "order_id", + "tax_rate" + ], + "properties": { + "id": { + "description": "The gift card transaction's ID", + "type": "string", + "example": "gct_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "gift_card_id": { + "description": "The ID of the Gift Card that was used in the transaction.", + "type": "string", + "example": "gift_01G8XKBPBQY2R7RBET4J7E0XQZ" + }, + "gift_card": { + "description": "A gift card object. Available if the relation `gift_card` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/GiftCard" + }, + "order_id": { + "description": "The ID of the Order that the Gift Card was used to pay for.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "amount": { + "description": "The amount that was used from the Gift Card.", + "type": "integer", + "example": 10 + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "is_taxable": { + "description": "Whether the transaction is taxable or not.", + "nullable": true, + "type": "boolean", + "example": false + }, + "tax_rate": { + "description": "The tax rate of the transaction", + "nullable": true, + "type": "number", + "example": 0 + } + } + }, + "IdempotencyKey": { + "title": "Idempotency Key", + "description": "Idempotency Key is used to continue a process in case of any failure that might occur.", + "type": "object", + "required": [ + "created_at", + "id", + "idempotency_key", + "locked_at", + "recovery_point", + "response_code", + "response_body", + "request_method", + "request_params", + "request_path" + ], + "properties": { + "id": { + "description": "The idempotency key's ID", + "type": "string", + "example": "ikey_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "idempotency_key": { + "description": "The unique randomly generated key used to determine the state of a process.", + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "created_at": { + "description": "Date which the idempotency key was locked.", + "type": "string", + "format": "date-time" + }, + "locked_at": { + "description": "Date which the idempotency key was locked.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "request_method": { + "description": "The method of the request", + "nullable": true, + "type": "string", + "example": "POST" + }, + "request_params": { + "description": "The parameters passed to the request", + "nullable": true, + "type": "object", + "example": { + "id": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + } + }, + "request_path": { + "description": "The request's path", + "nullable": true, + "type": "string", + "example": "/store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete" + }, + "response_code": { + "description": "The response's code.", + "nullable": true, + "type": "string", + "example": 200 + }, + "response_body": { + "description": "The response's body", + "nullable": true, + "type": "object", + "example": { + "id": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + } + }, + "recovery_point": { + "description": "Where to continue from.", + "type": "string", + "default": "started" + } + } + }, + "Image": { + "title": "Image", + "description": "Images holds a reference to a URL at which the image file can be found.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "url" + ], + "properties": { + "id": { + "type": "string", + "description": "The image's ID", + "example": "img_01G749BFYR6T8JTVW6SGW3K3E6" + }, + "url": { + "description": "The URL at which the image file can be found.", + "type": "string", + "format": "uri" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "InventoryItemDTO": { + "type": "object", + "required": [ + "sku" + ], + "properties": { + "sku": { + "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.", + "type": "string" + }, + "hs_code": { + "description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "origin_country": { + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "material": { + "description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "type": "string" + }, + "weight": { + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "height": { + "description": "The height of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "width": { + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "length": { + "description": "The length of the Inventory Item. May be used in shipping rate calculations.", + "type": "number" + }, + "requires_shipping": { + "description": "Whether the item requires shipping.", + "type": "boolean" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "InventoryLevelDTO": { + "type": "object", + "required": [ + "inventory_item_id", + "location_id", + "stocked_quantity", + "reserved_quantity", + "incoming_quantity" + ], + "properties": { + "location_id": { + "description": "the item location ID", + "type": "string" + }, + "stocked_quantity": { + "description": "the total stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "reserved_quantity": { + "description": "the reserved stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "incoming_quantity": { + "description": "the incoming stock quantity of an inventory item at the given location ID", + "type": "number" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "Invite": { + "title": "Invite", + "description": "Represents an invite", + "type": "object", + "required": [ + "accepted", + "created_at", + "deleted_at", + "expires_at", + "id", + "metadata", + "role", + "token", + "updated_at", + "user_email" + ], + "properties": { + "id": { + "type": "string", + "description": "The invite's ID", + "example": "invite_01G8TKE4XYCTHSCK2GDEP47RE1" + }, + "user_email": { + "description": "The email of the user being invited.", + "type": "string", + "format": "email" + }, + "role": { + "description": "The user's role.", + "nullable": true, + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ], + "default": "member" + }, + "accepted": { + "description": "Whether the invite was accepted or not.", + "type": "boolean", + "default": false + }, + "token": { + "description": "The token used to accept the invite.", + "type": "string" + }, + "expires_at": { + "description": "The date the invite expires at.", + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "LineItem": { + "title": "Line Item", + "description": "Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims.", + "type": "object", + "required": [ + "allow_discounts", + "cart_id", + "claim_order_id", + "created_at", + "description", + "fulfilled_quantity", + "has_shipping", + "id", + "is_giftcard", + "is_return", + "metadata", + "order_edit_id", + "order_id", + "original_item_id", + "quantity", + "returned_quantity", + "shipped_quantity", + "should_merge", + "swap_id", + "thumbnail", + "title", + "unit_price", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The line item's ID", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "cart_id": { + "description": "The ID of the Cart that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "order_id": { + "description": "The ID of the Order that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "swap_id": { + "description": "The id of the Swap that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "claim_order_id": { + "description": "The id of the Claim that the Line Item belongs to.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "tax_lines": { + "description": "Available if the relation `tax_lines` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItemTaxLine" + } + }, + "adjustments": { + "description": "Available if the relation `adjustments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItemAdjustment" + } + }, + "original_item_id": { + "description": "The id of the original line item", + "nullable": true, + "type": "string" + }, + "order_edit_id": { + "description": "The ID of the order edit to which a cloned item belongs", + "nullable": true, + "type": "string" + }, + "order_edit": { + "description": "The order edit joined. Available if the relation `order_edit` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/OrderEdit" + }, + "title": { + "description": "The title of the Line Item, this should be easily identifiable by the Customer.", + "type": "string", + "example": "Medusa Coffee Mug" + }, + "description": { + "description": "A more detailed description of the contents of the Line Item.", + "nullable": true, + "type": "string", + "example": "One Size" + }, + "thumbnail": { + "description": "A URL string to a small image of the contents of the Line Item.", + "nullable": true, + "type": "string", + "format": "uri", + "example": "https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png" + }, + "is_return": { + "description": "Is the item being returned", + "type": "boolean", + "default": false + }, + "is_giftcard": { + "description": "Flag to indicate if the Line Item is a Gift Card.", + "type": "boolean", + "default": false + }, + "should_merge": { + "description": "Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item.", + "type": "boolean", + "default": true + }, + "allow_discounts": { + "description": "Flag to indicate if the Line Item should be included when doing discount calculations.", + "type": "boolean", + "default": true + }, + "has_shipping": { + "description": "Flag to indicate if the Line Item has fulfillment associated with it.", + "nullable": true, + "type": "boolean", + "example": false + }, + "unit_price": { + "description": "The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to.", + "type": "integer", + "example": 8000 + }, + "variant_id": { + "description": "The id of the Product Variant contained in the Line Item.", + "nullable": true, + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "quantity": { + "description": "The quantity of the content in the Line Item.", + "type": "integer", + "example": 1 + }, + "fulfilled_quantity": { + "description": "The quantity of the Line Item that has been fulfilled.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "returned_quantity": { + "description": "The quantity of the Line Item that has been returned.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "shipped_quantity": { + "description": "The quantity of the Line Item that has been shipped.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "refundable": { + "description": "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.", + "type": "integer", + "example": 0 + }, + "subtotal": { + "description": "The subtotal of the line item", + "type": "integer", + "example": 8000 + }, + "tax_total": { + "description": "The total of tax of the line item", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the line item", + "type": "integer", + "example": 8000 + }, + "original_total": { + "description": "The original total amount of the line item", + "type": "integer", + "example": 8000 + }, + "original_tax_total": { + "description": "The original tax total amount of the line item", + "type": "integer", + "example": 0 + }, + "discount_total": { + "description": "The total of discount of the line item rounded", + "type": "integer", + "example": 0 + }, + "raw_discount_total": { + "description": "The total of discount of the line item", + "type": "integer", + "example": 0 + }, + "gift_card_total": { + "description": "The total of the gift card of the line item", + "type": "integer", + "example": 0 + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Indicates if the line item unit_price include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "LineItemAdjustment": { + "title": "Line Item Adjustment", + "description": "Represents a Line Item Adjustment", + "type": "object", + "required": [ + "amount", + "description", + "discount_id", + "id", + "item_id", + "metadata" + ], + "properties": { + "id": { + "description": "The Line Item Adjustment's ID", + "type": "string", + "example": "lia_01G8TKE4XYCTHSCK2GDEP47RE1" + }, + "item_id": { + "description": "The ID of the line item", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "description": { + "description": "The line item's adjustment description", + "type": "string", + "example": "Adjusted item's price." + }, + "discount_id": { + "description": "The ID of the discount associated with the adjustment", + "nullable": true, + "type": "string", + "example": "disc_01F0YESMW10MGHWJKZSDDMN0VN" + }, + "discount": { + "description": "Available if the relation `discount` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Discount" + }, + "amount": { + "description": "The adjustment amount", + "type": "number", + "example": 1000 + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "LineItemTaxLine": { + "title": "Line Item Tax Line", + "description": "Represents a Line Item Tax Line", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "item_id", + "metadata", + "name", + "rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The line item tax line's ID", + "type": "string", + "example": "litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8" + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number", + "example": 10 + }, + "item_id": { + "description": "The ID of the line item", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ModulesResponse": { + "type": "array", + "items": { + "type": "object", + "required": [ + "module", + "resolution" + ], + "properties": { + "module": { + "description": "The key of the module.", + "type": "string" + }, + "resolution": { + "description": "The resolution path of the module or false if module is not installed.", + "type": "string" + } + } + } + }, + "MoneyAmount": { + "title": "Money Amount", + "description": "Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon.", + "type": "object", + "required": [ + "amount", + "created_at", + "currency_code", + "deleted_at", + "id", + "max_quantity", + "min_quantity", + "price_list_id", + "region_id", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The money amount's ID", + "type": "string", + "example": "ma_01F0YESHRFQNH5S8Q0PK84YYZN" + }, + "currency_code": { + "description": "The 3 character currency code that the Money Amount is given in.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "amount": { + "description": "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.", + "type": "integer", + "example": 100 + }, + "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.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "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.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "price_list_id": { + "description": "The ID of the price list associated with the money amount", + "nullable": true, + "type": "string", + "example": "pl_01G8X3CKJXCG5VXVZ87H9KC09W" + }, + "price_list": { + "description": "Available if the relation `price_list` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/PriceList" + }, + "variant_id": { + "description": "The id of the Product Variant contained in the Line Item.", + "nullable": true, + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "The Product Variant contained in the Line Item. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "region_id": { + "description": "The region's ID", + "nullable": true, + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "MultipleErrors": { + "title": "Multiple Errors", + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Array of errors", + "items": { + "$ref": "#/components/schemas/Error" + } + }, + "message": { + "type": "string", + "default": "Provided request body contains errors. Please check the data and retry the request" + } + } + }, + "Note": { + "title": "Note", + "description": "Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these.", + "type": "object", + "required": [ + "author_id", + "created_at", + "deleted_at", + "id", + "metadata", + "resource_id", + "resource_type", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The note's ID", + "type": "string", + "example": "note_01G8TM8ENBMC7R90XRR1G6H26Q" + }, + "resource_type": { + "description": "The type of resource that the Note refers to.", + "type": "string", + "example": "order" + }, + "resource_id": { + "description": "The ID of the resource that the Note refers to.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "value": { + "description": "The contents of the note.", + "type": "string", + "example": "This order must be fulfilled on Monday" + }, + "author_id": { + "description": "The ID of the author (user)", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "author": { + "description": "Available if the relation `author` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/User" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Notification": { + "title": "Notification", + "description": "Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends.", + "type": "object", + "required": [ + "created_at", + "customer_id", + "data", + "event_name", + "id", + "parent_id", + "provider_id", + "resource_type", + "resource_id", + "to", + "updated_at" + ], + "properties": { + "id": { + "description": "The notification's ID", + "type": "string", + "example": "noti_01G53V9Y6CKMCGBM1P0X7C28RX" + }, + "event_name": { + "description": "The name of the event that the notification was sent for.", + "nullable": true, + "type": "string", + "example": "order.placed" + }, + "resource_type": { + "description": "The type of resource that the Notification refers to.", + "type": "string", + "example": "order" + }, + "resource_id": { + "description": "The ID of the resource that the Notification refers to.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "customer_id": { + "description": "The ID of the Customer that the Notification was sent to.", + "nullable": true, + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "A customer object. Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "to": { + "description": "The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id", + "type": "string", + "example": "user@example.com" + }, + "data": { + "description": "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.", + "type": "object", + "example": {} + }, + "parent_id": { + "description": "The notification's parent ID", + "nullable": true, + "type": "string", + "example": "noti_01G53V9Y6CKMCGBM1P0X7C28RX" + }, + "parent_notification": { + "description": "Available if the relation `parent_notification` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Notification" + }, + "resends": { + "description": "The resends that have been completed after the original Notification. Available if the relation `resends` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Notification" + } + }, + "provider_id": { + "description": "The id of the Notification Provider that handles the Notification.", + "nullable": true, + "type": "string", + "example": "sengrid" + }, + "provider": { + "description": "Available if the relation `provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/NotificationProvider" + }, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "NotificationProvider": { + "title": "Notification Provider", + "description": "Represents a notification provider plugin and holds its installation status.", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the notification provider as given by the plugin.", + "type": "string", + "example": "sendgrid" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "OAuth": { + "title": "OAuth", + "description": "Represent an OAuth app", + "type": "object", + "required": [ + "application_name", + "data", + "display_name", + "id", + "install_url", + "uninstall_url" + ], + "properties": { + "id": { + "description": "The app's ID", + "type": "string", + "example": "example_app" + }, + "display_name": { + "description": "The app's display name", + "type": "string", + "example": "Example app" + }, + "application_name": { + "description": "The app's name", + "type": "string", + "example": "example" + }, + "install_url": { + "description": "The URL to install the app", + "nullable": true, + "type": "string", + "format": "uri" + }, + "uninstall_url": { + "description": "The URL to uninstall the app", + "nullable": true, + "type": "string", + "format": "uri" + }, + "data": { + "description": "Any data necessary to the app.", + "nullable": true, + "type": "object", + "example": {} + } + } + }, + "Order": { + "title": "Order", + "description": "Represents an order", + "type": "object", + "required": [ + "billing_address_id", + "canceled_at", + "cart_id", + "created_at", + "currency_code", + "customer_id", + "draft_order_id", + "display_id", + "email", + "external_id", + "fulfillment_status", + "id", + "idempotency_key", + "metadata", + "no_notification", + "object", + "payment_status", + "region_id", + "shipping_address_id", + "status", + "tax_rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The order's ID", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "status": { + "description": "The order's status", + "type": "string", + "enum": [ + "pending", + "completed", + "archived", + "canceled", + "requires_action" + ], + "default": "pending" + }, + "fulfillment_status": { + "description": "The order's fulfillment status", + "type": "string", + "enum": [ + "not_fulfilled", + "partially_fulfilled", + "fulfilled", + "partially_shipped", + "shipped", + "partially_returned", + "returned", + "canceled", + "requires_action" + ], + "default": "not_fulfilled" + }, + "payment_status": { + "description": "The order's payment status", + "type": "string", + "enum": [ + "not_paid", + "awaiting", + "captured", + "partially_refunded", + "refunded", + "canceled", + "requires_action" + ], + "default": "not_paid" + }, + "display_id": { + "description": "The order's display ID", + "type": "integer", + "example": 2 + }, + "cart_id": { + "description": "The ID of the cart associated with the order", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "customer_id": { + "description": "The ID of the customer associated with the order", + "type": "string", + "example": "cus_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "customer": { + "description": "A customer object. Available if the relation `customer` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Customer" + }, + "email": { + "description": "The email associated with the order", + "type": "string", + "format": "email" + }, + "billing_address_id": { + "description": "The ID of the billing address associated with the order", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "billing_address": { + "description": "Available if the relation `billing_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_address_id": { + "description": "The ID of the shipping address associated with the order", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "currency_code": { + "description": "The 3 character currency code that is used in the order", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "tax_rate": { + "description": "The order's tax rate", + "nullable": true, + "type": "number", + "example": 0 + }, + "discounts": { + "description": "The discounts used in the order. Available if the relation `discounts` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Discount" + } + }, + "gift_cards": { + "description": "The gift cards used in the order. Available if the relation `gift_cards` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + } + }, + "shipping_methods": { + "description": "The shipping methods used in the order. Available if the relation `shipping_methods` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "payments": { + "description": "The payments used in the order. Available if the relation `payments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + } + }, + "fulfillments": { + "description": "The fulfillments used in the order. Available if the relation `fulfillments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + } + }, + "returns": { + "description": "The returns associated with the order. Available if the relation `returns` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Return" + } + }, + "claims": { + "description": "The claims associated with the order. Available if the relation `claims` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaimOrder" + } + }, + "refunds": { + "description": "The refunds associated with the order. Available if the relation `refunds` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Refund" + } + }, + "swaps": { + "description": "The swaps associated with the order. Available if the relation `swaps` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Swap" + } + }, + "draft_order_id": { + "description": "The ID of the draft order this order is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "draft_order": { + "description": "A draft order object. Available if the relation `draft_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/DraftOrder" + }, + "items": { + "description": "The line items that belong to the order. Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "edits": { + "description": "Order edits done on the order. Available if the relation `edits` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderEdit" + } + }, + "gift_card_transactions": { + "description": "The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCardTransaction" + } + }, + "canceled_at": { + "description": "The date the order was canceled on.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the processing of the order in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "external_id": { + "description": "The ID of an external order.", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channel_id": { + "description": "The ID of the sales channel this order is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channel": { + "description": "A sales channel object. Available if the relation `sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "shipping_total": { + "type": "integer", + "description": "The total of shipping", + "example": 1000 + }, + "raw_discount_total": { + "description": "The total of discount", + "type": "integer", + "example": 800 + }, + "discount_total": { + "description": "The total of discount rounded", + "type": "integer", + "example": 800 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + }, + "refunded_total": { + "description": "The total amount refunded if the order is returned.", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the order", + "type": "integer", + "example": 8200 + }, + "subtotal": { + "description": "The subtotal of the order", + "type": "integer", + "example": 8000 + }, + "paid_total": { + "description": "The total amount paid", + "type": "integer", + "example": 8000 + }, + "refundable_amount": { + "description": "The amount that can be refunded", + "type": "integer", + "example": 8200 + }, + "gift_card_total": { + "description": "The total of gift cards", + "type": "integer", + "example": 0 + }, + "gift_card_tax_total": { + "description": "The total of gift cards with taxes", + "type": "integer", + "example": 0 + }, + "returnable_items": { + "description": "The items that are returnable as part of the order, order swaps or order claims", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "OrderEdit": { + "title": "Order Edit", + "description": "Order edit keeps track of order items changes.", + "type": "object", + "required": [ + "canceled_at", + "canceled_by", + "confirmed_by", + "confirmed_at", + "created_at", + "created_by", + "declined_at", + "declined_by", + "declined_reason", + "id", + "internal_note", + "order_id", + "payment_collection_id", + "requested_at", + "requested_by", + "status", + "updated_at" + ], + "properties": { + "id": { + "description": "The order edit's ID", + "type": "string", + "example": "oe_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order_id": { + "description": "The ID of the order that is edited", + "type": "string", + "example": "order_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "order": { + "description": "Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "changes": { + "description": "Available if the relation `changes` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderItemChange" + } + }, + "internal_note": { + "description": "An optional note with additional details about the order edit.", + "nullable": true, + "type": "string", + "example": "Included two more items B to the order." + }, + "created_by": { + "description": "The unique identifier of the user or customer who created the order edit.", + "type": "string" + }, + "requested_by": { + "description": "The unique identifier of the user or customer who requested the order edit.", + "nullable": true, + "type": "string" + }, + "requested_at": { + "description": "The date with timezone at which the edit was requested.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "confirmed_by": { + "description": "The unique identifier of the user or customer who confirmed the order edit.", + "nullable": true, + "type": "string" + }, + "confirmed_at": { + "description": "The date with timezone at which the edit was confirmed.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "declined_by": { + "description": "The unique identifier of the user or customer who declined the order edit.", + "nullable": true, + "type": "string" + }, + "declined_at": { + "description": "The date with timezone at which the edit was declined.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "declined_reason": { + "description": "An optional note why the order edit is declined.", + "nullable": true, + "type": "string" + }, + "canceled_by": { + "description": "The unique identifier of the user or customer who cancelled the order edit.", + "nullable": true, + "type": "string" + }, + "canceled_at": { + "description": "The date with timezone at which the edit was cancelled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "subtotal": { + "description": "The total of subtotal", + "type": "integer", + "example": 8000 + }, + "discount_total": { + "description": "The total of discount", + "type": "integer", + "example": 800 + }, + "shipping_total": { + "description": "The total of the shipping amount", + "type": "integer", + "example": 800 + }, + "gift_card_total": { + "description": "The total of the gift card amount", + "type": "integer", + "example": 800 + }, + "gift_card_tax_total": { + "description": "The total of the gift card tax amount", + "type": "integer", + "example": 800 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + }, + "total": { + "description": "The total amount of the edited order.", + "type": "integer", + "example": 8200 + }, + "difference_due": { + "description": "The difference between the total amount of the order and total amount of edited order.", + "type": "integer", + "example": 8200 + }, + "status": { + "description": "The status of the order edit.", + "type": "string", + "enum": [ + "confirmed", + "declined", + "requested", + "created", + "canceled" + ] + }, + "items": { + "description": "Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "payment_collection_id": { + "description": "The ID of the payment collection", + "nullable": true, + "type": "string", + "example": "paycol_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "payment_collection": { + "description": "Available if the relation `payment_collection` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/PaymentCollection" + }, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "OrderItemChange": { + "title": "Order Item Change", + "description": "Represents an order edit item change", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "line_item_id", + "order_edit_id", + "original_line_item_id", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The order item change's ID", + "type": "string", + "example": "oic_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "type": { + "description": "The order item change's status", + "type": "string", + "enum": [ + "item_add", + "item_remove", + "item_update" + ] + }, + "order_edit_id": { + "description": "The ID of the order edit", + "type": "string", + "example": "oe_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "order_edit": { + "description": "Available if the relation `order_edit` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/OrderEdit" + }, + "original_line_item_id": { + "description": "The ID of the original line item in the order", + "nullable": true, + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "original_line_item": { + "description": "Available if the relation `original_line_item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "line_item_id": { + "description": "The ID of the cloned line item.", + "nullable": true, + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "line_item": { + "description": "Available if the relation `line_item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "Payment": { + "title": "Payment", + "description": "Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded.", + "type": "object", + "required": [ + "amount", + "amount_refunded", + "canceled_at", + "captured_at", + "cart_id", + "created_at", + "currency_code", + "data", + "id", + "idempotency_key", + "metadata", + "order_id", + "provider_id", + "swap_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The payment's ID", + "type": "string", + "example": "pay_01G2SJNT6DEEWDFNAJ4XWDTHKE" + }, + "swap_id": { + "description": "The ID of the Swap that the Payment is used for.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "cart_id": { + "description": "The id of the Cart that the Payment Session is created for.", + "nullable": true, + "type": "string" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "order_id": { + "description": "The ID of the Order that the Payment is used for.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "amount": { + "description": "The amount that the Payment has been authorized for.", + "type": "integer", + "example": 100 + }, + "currency_code": { + "description": "The 3 character ISO currency code that the Payment is completed in.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "amount_refunded": { + "description": "The amount of the original Payment amount that has been refunded back to the Customer.", + "type": "integer", + "default": 0, + "example": 0 + }, + "provider_id": { + "description": "The id of the Payment Provider that is responsible for the Payment", + "type": "string", + "example": "manual" + }, + "data": { + "description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.", + "type": "object", + "example": {} + }, + "captured_at": { + "description": "The date with timezone at which the Payment was captured.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date with timezone at which the Payment was canceled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a payment in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "PaymentCollection": { + "title": "Payment Collection", + "description": "Payment Collection", + "type": "object", + "required": [ + "amount", + "authorized_amount", + "created_at", + "created_by", + "currency_code", + "deleted_at", + "description", + "id", + "metadata", + "region_id", + "status", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The payment collection's ID", + "type": "string", + "example": "paycol_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "type": { + "description": "The type of the payment collection", + "type": "string", + "enum": [ + "order_edit" + ] + }, + "status": { + "description": "The type of the payment collection", + "type": "string", + "enum": [ + "not_paid", + "awaiting", + "authorized", + "partially_authorized", + "canceled" + ] + }, + "description": { + "description": "Description of the payment collection", + "nullable": true, + "type": "string" + }, + "amount": { + "description": "Amount of the payment collection.", + "type": "integer" + }, + "authorized_amount": { + "description": "Authorized amount of the payment collection.", + "nullable": true, + "type": "integer" + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "currency_code": { + "description": "The 3 character ISO code for the currency.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "payment_sessions": { + "description": "Available if the relation `payment_sessions` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentSession" + } + }, + "payments": { + "description": "Available if the relation `payments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + } + }, + "created_by": { + "description": "The ID of the user that created the payment collection.", + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "PaymentProvider": { + "title": "Payment Provider", + "description": "Represents a Payment Provider plugin and holds its installation status.", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the payment provider as given by the plugin.", + "type": "string", + "example": "manual" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "PaymentSession": { + "title": "Payment Session", + "description": "Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc.", + "type": "object", + "required": [ + "amount", + "cart_id", + "created_at", + "data", + "id", + "is_initiated", + "is_selected", + "idempotency_key", + "payment_authorized_at", + "provider_id", + "status", + "updated_at" + ], + "properties": { + "id": { + "description": "The payment session's ID", + "type": "string", + "example": "ps_01G901XNSRM2YS3ASN9H5KG3FZ" + }, + "cart_id": { + "description": "The id of the Cart that the Payment Session is created for.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "provider_id": { + "description": "The id of the Payment Provider that is responsible for the Payment Session", + "type": "string", + "example": "manual" + }, + "is_selected": { + "description": "A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase.", + "nullable": true, + "type": "boolean", + "example": true + }, + "is_initiated": { + "description": "A flag to indicate if a communication with the third party provider has been initiated.", + "type": "boolean", + "default": false, + "example": true + }, + "status": { + "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer.", + "type": "string", + "enum": [ + "authorized", + "pending", + "requires_more", + "error", + "canceled" + ], + "example": "pending" + }, + "data": { + "description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.", + "type": "object", + "example": {} + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a cart in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "amount": { + "description": "The amount that the Payment Session has been authorized for.", + "nullable": true, + "type": "integer", + "example": 100 + }, + "payment_authorized_at": { + "description": "The date with timezone at which the Payment Session was authorized.", + "nullable": true, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "PriceList": { + "title": "Price List", + "description": "Price Lists represents a set of prices that overrides the default price for one or more product variants.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "description", + "ends_at", + "id", + "name", + "starts_at", + "status", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The price list's ID", + "type": "string", + "example": "pl_01G8X3CKJXCG5VXVZ87H9KC09W" + }, + "name": { + "description": "The price list's name", + "type": "string", + "example": "VIP Prices" + }, + "description": { + "description": "The price list's description", + "type": "string", + "example": "Prices for VIP customers" + }, + "type": { + "description": "The type of Price List. This can be one of either `sale` or `override`.", + "type": "string", + "enum": [ + "sale", + "override" + ], + "default": "sale" + }, + "status": { + "description": "The status of the Price List", + "type": "string", + "enum": [ + "active", + "draft" + ], + "default": "draft" + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The date with timezone that the Price List stops being valid.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "customer_groups": { + "description": "The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + } + }, + "prices": { + "description": "The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MoneyAmount" + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the price list prices include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "PricedProduct": { + "title": "Priced Product", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Product" + }, + { + "type": "object", + "properties": { + "variants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedVariant" + } + } + } + } + ] + }, + "PricedShippingOption": { + "title": "Priced Shipping Option", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ShippingOption" + }, + { + "type": "object", + "properties": { + "price_incl_tax": { + "type": "number", + "description": "Price including taxes" + }, + "tax_rates": { + "type": "array", + "description": "An array of applied tax rates", + "items": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "description": "The tax rate value" + }, + "name": { + "type": "string", + "description": "The name of the tax rate" + }, + "code": { + "type": "string", + "description": "The code of the tax rate" + } + } + } + }, + "tax_amount": { + "type": "number", + "description": "The taxes applied." + } + } + } + ] + }, + "PricedVariant": { + "title": "Priced Product Variant", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ProductVariant" + }, + { + "type": "object", + "properties": { + "original_price": { + "type": "number", + "description": "The original price of the variant without any discounted prices applied." + }, + "calculated_price": { + "type": "number", + "description": "The calculated price of the variant. Can be a discounted price." + }, + "original_price_incl_tax": { + "type": "number", + "description": "The original price of the variant including taxes." + }, + "calculated_price_incl_tax": { + "type": "number", + "description": "The calculated price of the variant including taxes." + }, + "original_tax": { + "type": "number", + "description": "The taxes applied on the original price." + }, + "calculated_tax": { + "type": "number", + "description": "The taxes applied on the calculated price." + }, + "tax_rates": { + "type": "array", + "description": "An array of applied tax rates", + "items": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "description": "The tax rate value" + }, + "name": { + "type": "string", + "description": "The name of the tax rate" + }, + "code": { + "type": "string", + "description": "The code of the tax rate" + } + } + } + } + } + } + ] + }, + "Product": { + "title": "Product", + "description": "Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by.", + "type": "object", + "required": [ + "collection_id", + "created_at", + "deleted_at", + "description", + "discountable", + "external_id", + "handle", + "height", + "hs_code", + "id", + "is_giftcard", + "length", + "material", + "metadata", + "mid_code", + "origin_country", + "profile_id", + "status", + "subtitle", + "type_id", + "thumbnail", + "title", + "updated_at", + "weight", + "width" + ], + "properties": { + "id": { + "description": "The product's ID", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "title": { + "description": "A title that can be displayed for easy identification of the Product.", + "type": "string", + "example": "Medusa Coffee Mug" + }, + "subtitle": { + "description": "An optional subtitle that can be used to further specify the Product.", + "nullable": true, + "type": "string" + }, + "description": { + "description": "A short description of the Product.", + "nullable": true, + "type": "string", + "example": "Every programmer's best friend." + }, + "handle": { + "description": "A unique identifier for the Product (e.g. for slug structure).", + "nullable": true, + "type": "string", + "example": "coffee-mug" + }, + "is_giftcard": { + "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.", + "type": "boolean", + "default": false + }, + "status": { + "description": "The status of the product", + "type": "string", + "enum": [ + "draft", + "proposed", + "published", + "rejected" + ], + "default": "draft" + }, + "images": { + "description": "Images of the Product. Available if the relation `images` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Image" + } + }, + "thumbnail": { + "description": "A URL to an image file that can be used to identify the Product.", + "nullable": true, + "type": "string", + "format": "uri" + }, + "options": { + "description": "The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductOption" + } + }, + "variants": { + "description": "The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductVariant" + } + }, + "categories": { + "description": "The product's associated categories. Available if the relation `categories` are expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCategory" + } + }, + "profile_id": { + "description": "The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products.", + "type": "string", + "example": "sp_01G1G5V239ENSZ5MV4JAR737BM" + }, + "profile": { + "description": "Available if the relation `profile` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingProfile" + }, + "weight": { + "description": "The weight of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "length": { + "description": "The length of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "height": { + "description": "The height of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "width": { + "description": "The width of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "hs_code": { + "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "origin_country": { + "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "material": { + "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "collection_id": { + "description": "The Product Collection that the Product belongs to", + "nullable": true, + "type": "string", + "example": "pcol_01F0YESBFAZ0DV6V831JXWH0BG" + }, + "collection": { + "description": "A product collection object. Available if the relation `collection` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductCollection" + }, + "type_id": { + "description": "The Product type that the Product belongs to", + "nullable": true, + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "type": { + "description": "Available if the relation `type` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductType" + }, + "tags": { + "description": "The Product Tags assigned to the Product. Available if the relation `tags` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductTag" + } + }, + "discountable": { + "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.", + "type": "boolean", + "default": true + }, + "external_id": { + "description": "The external ID of the product", + "nullable": true, + "type": "string", + "example": null + }, + "sales_channels": { + "description": "The sales channels the product is associated with. Available if the relation `sales_channels` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SalesChannel" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductCategory": { + "title": "ProductCategory", + "description": "Represents a product category", + "x-resourceId": "ProductCategory", + "type": "object", + "required": [ + "category_children", + "created_at", + "handle", + "id", + "is_active", + "is_internal", + "mpath", + "name", + "parent_category_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The product category's ID", + "type": "string", + "example": "pcat_01G2SG30J8C85S4A5CHM2S1NS2" + }, + "name": { + "description": "The product category's name", + "type": "string", + "example": "Regular Fit" + }, + "handle": { + "description": "A unique string that identifies the Product Category - can for example be used in slug structures.", + "type": "string", + "example": "regular-fit" + }, + "mpath": { + "description": "A string for Materialized Paths - used for finding ancestors and descendents", + "nullable": true, + "type": "string", + "example": "pcat_id1.pcat_id2.pcat_id3" + }, + "is_internal": { + "type": "boolean", + "description": "A flag to make product category an internal category for admins", + "default": false + }, + "is_active": { + "type": "boolean", + "description": "A flag to make product category visible/hidden in the store front", + "default": false + }, + "rank": { + "type": "integer", + "description": "An integer that depicts the rank of category in a tree node", + "default": 0 + }, + "category_children": { + "description": "Available if the relation `category_children` are expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCategory" + } + }, + "parent_category_id": { + "description": "The ID of the parent category.", + "nullable": true, + "type": "string", + "default": null + }, + "parent_category": { + "description": "A product category object. Available if the relation `parent_category` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductCategory" + }, + "products": { + "description": "Products associated with category. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "ProductCollection": { + "title": "Product Collection", + "description": "Product Collections represents a group of Products that are related.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "handle", + "id", + "metadata", + "title", + "updated_at" + ], + "properties": { + "id": { + "description": "The product collection's ID", + "type": "string", + "example": "pcol_01F0YESBFAZ0DV6V831JXWH0BG" + }, + "title": { + "description": "The title that the Product Collection is identified by.", + "type": "string", + "example": "Summer Collection" + }, + "handle": { + "description": "A unique string that identifies the Product Collection - can for example be used in slug structures.", + "nullable": true, + "type": "string", + "example": "summer-collection" + }, + "products": { + "description": "The Products contained in the Product Collection. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductOption": { + "title": "Product Option", + "description": "Product Options define properties that may vary between different variants of a Product. Common Product Options are \"Size\" and \"Color\", but Medusa doesn't limit what Product Options that can be defined.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "product_id", + "title", + "updated_at" + ], + "properties": { + "id": { + "description": "The product option's ID", + "type": "string", + "example": "opt_01F0YESHQBZVKCEXJ24BS6PCX3" + }, + "title": { + "description": "The title that the Product Option is defined by (e.g. `Size`).", + "type": "string", + "example": "Size" + }, + "values": { + "description": "The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductOptionValue" + } + }, + "product_id": { + "description": "The ID of the Product that the Product Option is defined for.", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "product": { + "description": "A product object. Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductOptionValue": { + "title": "Product Option Value", + "description": "A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "option_id", + "updated_at", + "value", + "variant_id" + ], + "properties": { + "id": { + "description": "The product option value's ID", + "type": "string", + "example": "optval_01F0YESHR7S6ECD03RF6W12DSJ" + }, + "value": { + "description": "The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \\\"Size\\\" this value could be `Small`, `Medium` or `Large`).", + "type": "string", + "example": "large" + }, + "option_id": { + "description": "The ID of the Product Option that the Product Option Value is defined for.", + "type": "string", + "example": "opt_01F0YESHQBZVKCEXJ24BS6PCX3" + }, + "option": { + "description": "Available if the relation `option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductOption" + }, + "variant_id": { + "description": "The ID of the Product Variant that the Product Option Value is defined for.", + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "variant": { + "description": "Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductTag": { + "title": "Product Tag", + "description": "Product Tags can be added to Products for easy filtering and grouping.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The product tag's ID", + "type": "string", + "example": "ptag_01G8K2MTMG9168F2B70S1TAVK3" + }, + "value": { + "description": "The value that the Product Tag represents", + "type": "string", + "example": "Pants" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductTaxRate": { + "title": "Product Tax Rate", + "description": "Associates a tax rate with a product to indicate that the product is taxed in a certain way", + "type": "object", + "required": [ + "created_at", + "metadata", + "product_id", + "rate_id", + "updated_at" + ], + "properties": { + "product_id": { + "description": "The ID of the Product", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "product": { + "description": "Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "rate_id": { + "description": "The ID of the Tax Rate", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "tax_rate": { + "description": "Available if the relation `tax_rate` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxRate" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductType": { + "title": "Product Type", + "description": "Product Type can be added to Products for filtering and reporting purposes.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The product type's ID", + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "value": { + "description": "The value that the Product Type represents.", + "type": "string", + "example": "Clothing" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductTypeTaxRate": { + "title": "Product Type Tax Rate", + "description": "Associates a tax rate with a product type to indicate that the product type is taxed in a certain way", + "type": "object", + "required": [ + "created_at", + "metadata", + "product_type_id", + "rate_id", + "updated_at" + ], + "properties": { + "product_type_id": { + "description": "The ID of the Product type", + "type": "string", + "example": "ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "product_type": { + "description": "Available if the relation `product_type` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductType" + }, + "rate_id": { + "description": "The id of the Tax Rate", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "tax_rate": { + "description": "Available if the relation `tax_rate` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxRate" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductVariant": { + "title": "Product Variant", + "description": "Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations.", + "type": "object", + "required": [ + "allow_backorder", + "barcode", + "created_at", + "deleted_at", + "ean", + "height", + "hs_code", + "id", + "inventory_quantity", + "length", + "manage_inventory", + "material", + "metadata", + "mid_code", + "origin_country", + "product_id", + "sku", + "title", + "upc", + "updated_at", + "weight", + "width" + ], + "properties": { + "id": { + "description": "The product variant's ID", + "type": "string", + "example": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6" + }, + "title": { + "description": "A title that can be displayed for easy identification of the Product Variant.", + "type": "string", + "example": "Small" + }, + "product_id": { + "description": "The ID of the Product that the Product Variant belongs to.", + "type": "string", + "example": "prod_01G1G5V2MBA328390B5AXJ610F" + }, + "product": { + "description": "A product object. Available if the relation `product` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Product" + }, + "prices": { + "description": "The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MoneyAmount" + } + }, + "sku": { + "description": "The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems.", + "nullable": true, + "type": "string", + "example": "shirt-123" + }, + "barcode": { + "description": "A generic field for a GTIN number that can be used to identify the Product Variant.", + "nullable": true, + "type": "string", + "example": null + }, + "ean": { + "description": "An EAN barcode number that can be used to identify the Product Variant.", + "nullable": true, + "type": "string", + "example": null + }, + "upc": { + "description": "A UPC barcode number that can be used to identify the Product Variant.", + "nullable": true, + "type": "string", + "example": null + }, + "variant_rank": { + "description": "The ranking of this variant", + "nullable": true, + "type": "number", + "default": 0 + }, + "inventory_quantity": { + "description": "The current quantity of the item that is stocked.", + "type": "integer", + "example": 100 + }, + "allow_backorder": { + "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.", + "type": "boolean", + "default": false + }, + "manage_inventory": { + "description": "Whether Medusa should manage inventory for the Product Variant.", + "type": "boolean", + "default": true + }, + "hs_code": { + "description": "The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "origin_country": { + "description": "The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "mid_code": { + "description": "The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "material": { + "description": "The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "nullable": true, + "type": "string", + "example": null + }, + "weight": { + "description": "The weight of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "length": { + "description": "The length of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "height": { + "description": "The height of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "width": { + "description": "The width of the Product Variant. May be used in shipping rate calculations.", + "nullable": true, + "type": "number", + "example": null + }, + "options": { + "description": "The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductOptionValue" + } + }, + "inventory_items": { + "description": "The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductVariantInventoryItem" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ProductVariantInventoryItem": { + "title": "Product Variant Inventory Item", + "description": "Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "inventory_item_id", + "required_quantity", + "updated_at", + "variant_id" + ], + "properties": { + "id": { + "description": "The product variant inventory item's ID", + "type": "string", + "example": "pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "inventory_item_id": { + "description": "The id of the inventory item", + "type": "string" + }, + "variant_id": { + "description": "The id of the variant.", + "type": "string" + }, + "variant": { + "description": "A ProductVariant object. Available if the relation `variant` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ProductVariant" + }, + "required_quantity": { + "description": "The quantity of an inventory item required for one quantity of the variant.", + "type": "integer", + "default": 1 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "PublishableApiKey": { + "title": "Publishable API key", + "description": "Publishable API key defines scopes (i.e. resources) that are available within a request.", + "type": "object", + "required": [ + "created_at", + "created_by", + "id", + "revoked_by", + "revoked_at", + "title", + "updated_at" + ], + "properties": { + "id": { + "description": "The key's ID", + "type": "string", + "example": "pk_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "created_by": { + "description": "The unique identifier of the user that created the key.", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "revoked_by": { + "description": "The unique identifier of the user that revoked the key.", + "nullable": true, + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "revoked_at": { + "description": "The date with timezone at which the key was revoked.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "title": { + "description": "The key's title.", + "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 updated.", + "type": "string", + "format": "date-time" + } + } + }, + "PublishableApiKeySalesChannel": { + "title": "Publishable API key sales channel", + "description": "Holds mapping between Publishable API keys and Sales Channels", + "type": "object", + "required": [ + "publishable_key_id", + "sales_channel_id" + ], + "properties": { + "sales_channel_id": { + "description": "The sales channel's ID", + "type": "string", + "example": "sc_01G1G5V21KADXNGH29BJMAJ4B4" + }, + "publishable_key_id": { + "description": "The publishable API key's ID", + "type": "string", + "example": "pak_01G1G5V21KADXNGH29BJMAJ4B4" + } + } + }, + "Refund": { + "title": "Refund", + "description": "Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator.", + "type": "object", + "required": [ + "amount", + "created_at", + "id", + "idempotency_key", + "metadata", + "note", + "order_id", + "payment_id", + "reason", + "updated_at" + ], + "properties": { + "id": { + "description": "The refund's ID", + "type": "string", + "example": "ref_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "order_id": { + "description": "The id of the Order that the Refund is related to.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "payment_id": { + "description": "The payment's ID if available", + "nullable": true, + "type": "string", + "example": "pay_01G8ZCC5W42ZNY842124G7P5R9" + }, + "payment": { + "description": "Available if the relation `payment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Payment" + }, + "amount": { + "description": "The amount that has be refunded to the Customer.", + "type": "integer", + "example": 1000 + }, + "note": { + "description": "An optional note explaining why the amount was refunded.", + "nullable": true, + "type": "string", + "example": "I didn't like it" + }, + "reason": { + "description": "The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return.", + "type": "string", + "enum": [ + "discount", + "return", + "swap", + "claim", + "other" + ], + "example": "return" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the refund in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "Region": { + "title": "Region", + "description": "Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries.", + "type": "object", + "required": [ + "automatic_taxes", + "created_at", + "currency_code", + "deleted_at", + "gift_cards_taxable", + "id", + "metadata", + "name", + "tax_code", + "tax_provider_id", + "tax_rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "name": { + "description": "The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name.", + "type": "string", + "example": "EU" + }, + "currency_code": { + "description": "The 3 character currency code that the Region uses.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "currency": { + "description": "Available if the relation `currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "tax_rate": { + "description": "The tax rate that should be charged on purchases in the Region.", + "type": "number", + "example": 0 + }, + "tax_rates": { + "description": "The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxRate" + } + }, + "tax_code": { + "description": "The tax code used on purchases in the Region. This may be used by other systems for accounting purposes.", + "nullable": true, + "type": "string", + "example": null + }, + "gift_cards_taxable": { + "description": "Whether the gift cards are taxable or not in this region.", + "type": "boolean", + "default": true + }, + "automatic_taxes": { + "description": "Whether taxes should be automated in this region.", + "type": "boolean", + "default": true + }, + "countries": { + "description": "The countries that are included in the Region. Available if the relation `countries` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Country" + } + }, + "tax_provider_id": { + "description": "The ID of the tax provider used in this region", + "nullable": true, + "type": "string", + "example": null + }, + "tax_provider": { + "description": "Available if the relation `tax_provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxProvider" + }, + "payment_providers": { + "description": "The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentProvider" + } + }, + "fulfillment_providers": { + "description": "The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentProvider" + } + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the prices for the region include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ReservationItemDTO": { + "title": "Reservation item", + "description": "Represents a reservation of an inventory item at a stock location", + "type": "object", + "required": [ + "id", + "location_id", + "inventory_item_id", + "quantity" + ], + "properties": { + "id": { + "description": "The id of the reservation item", + "type": "string" + }, + "location_id": { + "description": "The id of the location of the reservation", + "type": "string" + }, + "inventory_item_id": { + "description": "The id of the inventory item the reservation relates to", + "type": "string" + }, + "quantity": { + "description": "The id of the reservation item", + "type": "number" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "Return": { + "title": "Return", + "description": "Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap.", + "type": "object", + "required": [ + "claim_order_id", + "created_at", + "id", + "idempotency_key", + "location_id", + "metadata", + "no_notification", + "order_id", + "received_at", + "refund_amount", + "shipping_data", + "status", + "swap_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The return's ID", + "type": "string", + "example": "ret_01F0YET7XPCMF8RZ0Y151NZV2V" + }, + "status": { + "description": "Status of the Return.", + "type": "string", + "enum": [ + "requested", + "received", + "requires_action", + "canceled" + ], + "default": "requested" + }, + "items": { + "description": "The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ReturnItem" + } + }, + "swap_id": { + "description": "The ID of the Swap that the Return is a part of.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "claim_order_id": { + "description": "The ID of the Claim that the Return is a part of.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "order_id": { + "description": "The ID of the Order that the Return is made from.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "shipping_method": { + "description": "The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingMethod" + }, + "shipping_data": { + "description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.", + "nullable": true, + "type": "object", + "example": {} + }, + "location_id": { + "description": "The id of the stock location the return will be added back.", + "nullable": true, + "type": "string", + "example": "sloc_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "refund_amount": { + "description": "The amount that should be refunded as a result of the return.", + "type": "integer", + "example": 1000 + }, + "no_notification": { + "description": "When set to true, no notification will be sent related to this return.", + "nullable": true, + "type": "boolean", + "example": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the return in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "received_at": { + "description": "The date with timezone at which the return was received.", + "nullable": true, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ReturnItem": { + "title": "Return Item", + "description": "Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned.", + "type": "object", + "required": [ + "is_requested", + "item_id", + "metadata", + "note", + "quantity", + "reason_id", + "received_quantity", + "requested_quantity", + "return_id" + ], + "properties": { + "return_id": { + "description": "The id of the Return that the Return Item belongs to.", + "type": "string", + "example": "ret_01F0YET7XPCMF8RZ0Y151NZV2V" + }, + "item_id": { + "description": "The id of the Line Item that the Return Item references.", + "type": "string", + "example": "item_01G8ZC9GWT6B2GP5FSXRXNFNGN" + }, + "return_order": { + "description": "Available if the relation `return_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "item": { + "description": "Available if the relation `item` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/LineItem" + }, + "quantity": { + "description": "The quantity of the Line Item that is included in the Return.", + "type": "integer", + "example": 1 + }, + "is_requested": { + "description": "Whether the Return Item was requested initially or received unexpectedly in the warehouse.", + "type": "boolean", + "default": true + }, + "requested_quantity": { + "description": "The quantity that was originally requested to be returned.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "received_quantity": { + "description": "The quantity that was received in the warehouse.", + "nullable": true, + "type": "integer", + "example": 1 + }, + "reason_id": { + "description": "The ID of the reason for returning the item.", + "nullable": true, + "type": "string", + "example": "rr_01G8X82GCCV2KSQHDBHSSAH5TQ" + }, + "reason": { + "description": "Available if the relation `reason` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ReturnReason" + }, + "note": { + "description": "An optional note with additional details about the Return.", + "nullable": true, + "type": "string", + "example": "I didn't like it." + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ReturnReason": { + "title": "Return Reason", + "description": "A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "description", + "id", + "label", + "metadata", + "parent_return_reason_id", + "updated_at", + "value" + ], + "properties": { + "id": { + "description": "The return reason's ID", + "type": "string", + "example": "rr_01G8X82GCCV2KSQHDBHSSAH5TQ" + }, + "value": { + "description": "The value to identify the reason by.", + "type": "string", + "example": "damaged" + }, + "label": { + "description": "A text that can be displayed to the Customer as a reason.", + "type": "string", + "example": "Damaged goods" + }, + "description": { + "description": "A description of the Reason.", + "nullable": true, + "type": "string", + "example": "Items that are damaged" + }, + "parent_return_reason_id": { + "description": "The ID of the parent reason.", + "nullable": true, + "type": "string", + "example": null + }, + "parent_return_reason": { + "description": "Available if the relation `parent_return_reason` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ReturnReason" + }, + "return_reason_children": { + "description": "Available if the relation `return_reason_children` is expanded.", + "$ref": "#/components/schemas/ReturnReason" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "SalesChannel": { + "title": "Sales Channel", + "description": "A Sales Channel", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "description", + "id", + "is_disabled", + "name", + "updated_at" + ], + "properties": { + "id": { + "description": "The sales channel's ID", + "type": "string", + "example": "sc_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "name": { + "description": "The name of the sales channel.", + "type": "string", + "example": "Market" + }, + "description": { + "description": "The description of the sales channel.", + "nullable": true, + "type": "string", + "example": "Multi-vendor market" + }, + "is_disabled": { + "description": "Specify if the sales channel is enabled or disabled.", + "type": "boolean", + "default": false + }, + "locations": { + "description": "The Stock Locations related to the sales channel. Available if the relation `locations` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SalesChannelLocation" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "SalesChannelLocation": { + "title": "Sales Channel Stock Location", + "description": "Sales Channel Stock Location link sales channels with stock locations.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "location_id", + "sales_channel_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The Sales Channel Stock Location's ID", + "type": "string", + "example": "scloc_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "sales_channel_id": { + "description": "The id of the Sales Channel", + "type": "string", + "example": "sc_01G8X9A7ESKAJXG2H0E6F1MW7A" + }, + "location_id": { + "description": "The id of the Location Stock.", + "type": "string" + }, + "sales_channel": { + "description": "The sales channel the location is associated with. Available if the relation `sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "ShippingMethod": { + "title": "Shipping Method", + "description": "Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment.", + "type": "object", + "required": [ + "cart_id", + "claim_order_id", + "data", + "id", + "order_id", + "price", + "return_id", + "shipping_option_id", + "swap_id" + ], + "properties": { + "id": { + "description": "The shipping method's ID", + "type": "string", + "example": "sm_01F0YET7DR2E7CYVSDHM593QG2" + }, + "shipping_option_id": { + "description": "The id of the Shipping Option that the Shipping Method is built from.", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "order_id": { + "description": "The id of the Order that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "claim_order_id": { + "description": "The id of the Claim that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": null + }, + "claim_order": { + "description": "A claim order object. Available if the relation `claim_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ClaimOrder" + }, + "cart_id": { + "description": "The id of the Cart that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "swap_id": { + "description": "The id of the Swap that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": null + }, + "swap": { + "description": "A swap object. Available if the relation `swap` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Swap" + }, + "return_id": { + "description": "The id of the Return that the Shipping Method is used on.", + "nullable": true, + "type": "string", + "example": null + }, + "return_order": { + "description": "A return object. Available if the relation `return_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "shipping_option": { + "description": "Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "tax_lines": { + "description": "Available if the relation `tax_lines` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethodTaxLine" + } + }, + "price": { + "description": "The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of.", + "type": "integer", + "example": 200 + }, + "data": { + "description": "Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id.", + "type": "object", + "example": {} + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Indicates if the shipping method price include tax", + "type": "boolean", + "default": false + }, + "subtotal": { + "description": "The subtotal of the shipping", + "type": "integer", + "example": 8000 + }, + "total": { + "description": "The total amount of the shipping", + "type": "integer", + "example": 8200 + }, + "tax_total": { + "description": "The total of tax", + "type": "integer", + "example": 0 + } + } + }, + "ShippingMethodTaxLine": { + "title": "Shipping Method Tax Line", + "description": "Shipping Method Tax Line", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "shipping_method_id", + "metadata", + "name", + "rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The line item tax line's ID", + "type": "string", + "example": "smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8" + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number", + "example": 10 + }, + "shipping_method_id": { + "description": "The ID of the line item", + "type": "string", + "example": "sm_01F0YET7DR2E7CYVSDHM593QG2" + }, + "shipping_method": { + "description": "Available if the relation `shipping_method` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingMethod" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ShippingOption": { + "title": "Shipping Option", + "description": "Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information.", + "type": "object", + "required": [ + "admin_only", + "amount", + "created_at", + "data", + "deleted_at", + "id", + "is_return", + "metadata", + "name", + "price_type", + "profile_id", + "provider_id", + "region_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The shipping option's ID", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "name": { + "description": "The name given to the Shipping Option - this may be displayed to the Customer.", + "type": "string", + "example": "PostFake Standard" + }, + "region_id": { + "description": "The region's ID", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "profile_id": { + "description": "The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products.", + "type": "string", + "example": "sp_01G1G5V239ENSZ5MV4JAR737BM" + }, + "profile": { + "description": "Available if the relation `profile` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingProfile" + }, + "provider_id": { + "description": "The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option.", + "type": "string", + "example": "manual" + }, + "provider": { + "description": "Available if the relation `provider` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/FulfillmentProvider" + }, + "price_type": { + "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.", + "type": "string", + "enum": [ + "flat_rate", + "calculated" + ], + "example": "flat_rate" + }, + "amount": { + "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.", + "nullable": true, + "type": "integer", + "example": 200 + }, + "is_return": { + "description": "Flag to indicate if the Shipping Option can be used for Return shipments.", + "type": "boolean", + "default": false + }, + "admin_only": { + "description": "Flag to indicate if the Shipping Option usage is restricted to admin users.", + "type": "boolean", + "default": false + }, + "requirements": { + "description": "The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingOptionRequirement" + } + }, + "data": { + "description": "The data needed for the Fulfillment Provider to identify the Shipping Option.", + "type": "object", + "example": {} + }, + "includes_tax": { + "description": "[EXPERIMENTAL] Does the shipping option price include tax", + "type": "boolean", + "default": false + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ShippingOptionRequirement": { + "title": "Shipping Option Requirement", + "description": "A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart.", + "type": "object", + "required": [ + "amount", + "deleted_at", + "id", + "shipping_option_id", + "type" + ], + "properties": { + "id": { + "description": "The shipping option requirement's ID", + "type": "string", + "example": "sor_01G1G5V29AB4CTNDRFSRWSRKWD" + }, + "shipping_option_id": { + "description": "The id of the Shipping Option that the hipping option requirement belongs to", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "shipping_option": { + "description": "Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "type": { + "description": "The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available.", + "type": "string", + "enum": [ + "min_subtotal", + "max_subtotal" + ], + "example": "min_subtotal" + }, + "amount": { + "description": "The amount to compare the Cart subtotal to.", + "type": "integer", + "example": 100 + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + } + } + }, + "ShippingProfile": { + "title": "Shipping Profile", + "description": "Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "id", + "metadata", + "name", + "type", + "updated_at" + ], + "properties": { + "id": { + "description": "The shipping profile's ID", + "type": "string", + "example": "sp_01G1G5V239ENSZ5MV4JAR737BM" + }, + "name": { + "description": "The name given to the Shipping profile - this may be displayed to the Customer.", + "type": "string", + "example": "Default Shipping Profile" + }, + "type": { + "description": "The type of the Shipping Profile, may be `default`, `gift_card` or `custom`.", + "type": "string", + "enum": [ + "default", + "gift_card", + "custom" + ], + "example": "default" + }, + "products": { + "description": "The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "shipping_options": { + "description": "The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingOption" + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "ShippingTaxRate": { + "title": "Shipping Tax Rate", + "description": "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way", + "type": "object", + "required": [ + "created_at", + "metadata", + "rate_id", + "shipping_option_id", + "updated_at" + ], + "properties": { + "shipping_option_id": { + "description": "The ID of the Shipping Option", + "type": "string", + "example": "so_01G1G5V27GYX4QXNARRQCW1N8T" + }, + "shipping_option": { + "description": "Available if the relation `shipping_option` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/ShippingOption" + }, + "rate_id": { + "description": "The ID of the Tax Rate", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "tax_rate": { + "description": "Available if the relation `tax_rate` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/TaxRate" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "StagedJob": { + "title": "Staged Job", + "description": "A staged job resource", + "type": "object", + "required": [ + "data", + "event_name", + "id", + "options" + ], + "properties": { + "id": { + "description": "The staged job's ID", + "type": "string", + "example": "job_01F0YET7BZTARY9MKN1SJ7AAXF" + }, + "event_name": { + "description": "The name of the event", + "type": "string", + "example": "order.placed" + }, + "data": { + "description": "Data necessary for the job", + "type": "object", + "example": {} + }, + "option": { + "description": "The staged job's option", + "type": "object", + "example": {} + } + } + }, + "StockLocationAddressDTO": { + "title": "Stock Location Address", + "description": "Represents a Stock Location Address", + "type": "object", + "required": [ + "address_1", + "country_code", + "created_at", + "updated_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The stock location address' ID", + "example": "laddr_51G4ZW853Y6TFXWPG5ENJ81X42" + }, + "address_1": { + "type": "string", + "description": "Stock location address", + "example": "35, Jhon Doe Ave" + }, + "address_2": { + "type": "string", + "description": "Stock location address' complement", + "example": "apartment 4432" + }, + "company": { + "type": "string", + "description": "Stock location company' name", + "example": "Medusa" + }, + "city": { + "type": "string", + "description": "Stock location address' city", + "example": "Mexico city" + }, + "country_code": { + "type": "string", + "description": "Stock location address' country", + "example": "MX" + }, + "phone": { + "type": "string", + "description": "Stock location address' phone number", + "example": "+1 555 61646" + }, + "postal_code": { + "type": "string", + "description": "Stock location address' postal code", + "example": "HD3-1G8" + }, + "province": { + "type": "string", + "description": "Stock location address' province", + "example": "Sinaloa" + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "StockLocationAddressInput": { + "title": "Stock Location Address Input", + "description": "Represents a Stock Location Address Input", + "type": "object", + "required": [ + "address_1", + "country_code" + ], + "properties": { + "address_1": { + "type": "string", + "description": "Stock location address", + "example": "35, Jhon Doe Ave" + }, + "address_2": { + "type": "string", + "description": "Stock location address' complement", + "example": "apartment 4432" + }, + "city": { + "type": "string", + "description": "Stock location address' city", + "example": "Mexico city" + }, + "country_code": { + "type": "string", + "description": "Stock location address' country", + "example": "MX" + }, + "phone": { + "type": "string", + "description": "Stock location address' phone number", + "example": "+1 555 61646" + }, + "postal_code": { + "type": "string", + "description": "Stock location address' postal code", + "example": "HD3-1G8" + }, + "province": { + "type": "string", + "description": "Stock location address' province", + "example": "Sinaloa" + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "StockLocationDTO": { + "title": "Stock Location", + "description": "Represents a Stock Location", + "type": "object", + "required": [ + "id", + "name", + "address_id", + "created_at", + "updated_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The stock location's ID", + "example": "sloc_51G4ZW853Y6TFXWPG5ENJ81X42" + }, + "address_id": { + "type": "string", + "description": "Stock location address' ID", + "example": "laddr_05B2ZE853Y6FTXWPW85NJ81A44" + }, + "name": { + "type": "string", + "description": "The name of the stock location", + "example": "Main Warehouse" + }, + "address": { + "description": "The Address of the Stock Location", + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationAddressDTO" + }, + { + "type": "object" + } + ] + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + }, + "created_at": { + "type": "string", + "description": "The date with timezone at which the resource was created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The date with timezone at which the resource was updated.", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "description": "The date with timezone at which the resource was deleted.", + "format": "date-time" + } + } + }, + "StockLocationExpandedDTO": { + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationDTO" + }, + { + "type": "object", + "properties": { + "sales_channels": { + "$ref": "#/components/schemas/SalesChannel" + } + } + } + ] + }, + "Store": { + "title": "Store", + "description": "Holds settings for the Store, such as name, currencies, etc.", + "type": "object", + "required": [ + "created_at", + "default_currency_code", + "default_location_id", + "id", + "invite_link_template", + "metadata", + "name", + "payment_link_template", + "swap_link_template", + "updated_at" + ], + "properties": { + "id": { + "description": "The store's ID", + "type": "string", + "example": "store_01G1G5V21KADXNGH29BJMAJ4B4" + }, + "name": { + "description": "The name of the Store - this may be displayed to the Customer.", + "type": "string", + "example": "Medusa Store" + }, + "default_currency_code": { + "description": "The 3 character currency code that is the default of the store.", + "type": "string", + "example": "usd", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_4217#Active_codes", + "description": "See a list of codes." + } + }, + "default_currency": { + "description": "Available if the relation `default_currency` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Currency" + }, + "currencies": { + "description": "The currencies that are enabled for the Store. Available if the relation `currencies` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Currency" + } + }, + "swap_link_template": { + "description": "A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link.", + "nullable": true, + "type": "string", + "example": null + }, + "payment_link_template": { + "description": "A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link.", + "nullable": true, + "type": "string", + "example": null + }, + "invite_link_template": { + "description": "A template to generate Invite links from", + "nullable": true, + "type": "string", + "example": null + }, + "default_location_id": { + "description": "The location ID the store is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "default_sales_channel_id": { + "description": "The sales channel ID the cart is associated with.", + "nullable": true, + "type": "string", + "example": null + }, + "default_sales_channel": { + "description": "A sales channel object. Available if the relation `default_sales_channel` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/SalesChannel" + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "StoreAuthRes": { + "type": "object", + "x-expanded-relations": { + "field": "customer", + "relations": [ + "orders", + "orders.items", + "shipping_addresses" + ] + }, + "required": [ + "customer" + ], + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer" + } + } + }, + "StoreCartShippingOptionsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "shipping_options", + "implicit": [ + "profile", + "requirements" + ] + }, + "required": [ + "shipping_options" + ], + "properties": { + "shipping_options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedShippingOption" + } + } + } + }, + "StoreCartsRes": { + "type": "object", + "x-expanded-relations": { + "field": "cart", + "relations": [ + "billing_address", + "discounts", + "discounts.rule", + "gift_cards", + "items", + "items.adjustments", + "items.variant", + "payment", + "payment_sessions", + "region", + "region.countries", + "region.payment_providers", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers", + "shipping_methods.shipping_option" + ], + "implicit": [ + "items", + "items.variant", + "items.variant.product", + "items.tax_lines", + "items.adjustments", + "gift_cards", + "discounts", + "discounts.rule", + "shipping_methods", + "shipping_methods.tax_lines", + "shipping_address", + "region", + "region.tax_rates" + ], + "totals": [ + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "item_tax_total", + "refundable_amount", + "refunded_total", + "shipping_tax_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total" + ] + }, + "required": [ + "cart" + ], + "properties": { + "cart": { + "$ref": "#/components/schemas/Cart" + } + } + }, + "StoreCollectionsListRes": { + "type": "object", + "required": [ + "collections", + "count", + "offset", + "limit" + ], + "properties": { + "collections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCollection" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "StoreCollectionsRes": { + "type": "object", + "required": [ + "collection" + ], + "properties": { + "collection": { + "$ref": "#/components/schemas/ProductCollection" + } + } + }, + "StoreCompleteCartRes": { + "type": "object", + "required": [ + "type", + "data" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the data property.", + "enum": [ + "order", + "cart", + "swap" + ] + }, + "data": { + "type": "object", + "description": "The data of the result object. Its type depends on the type field.", + "oneOf": [ + { + "type": "object", + "allOf": [ + { + "description": "Cart was successfully authorized and order was placed successfully." + }, + { + "$ref": "#/components/schemas/Order" + } + ] + }, + { + "type": "object", + "allOf": [ + { + "description": "Cart was successfully authorized but requires further actions." + }, + { + "$ref": "#/components/schemas/Cart" + } + ] + }, + { + "type": "object", + "allOf": [ + { + "description": "When cart is used for a swap and it has been completed successfully." + }, + { + "$ref": "#/components/schemas/Swap" + } + ] + } + ] + } + } + }, + "StoreCustomersListOrdersRes": { + "type": "object", + "x-expanded-relations": { + "field": "orders", + "relations": [ + "customer", + "discounts", + "discounts.rule", + "fulfillments", + "fulfillments.tracking_links", + "items", + "items.variant", + "payments", + "region", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers", + "shipping_methods.shipping_option" + ], + "implicit": [ + "claims", + "claims.additional_items", + "claims.additional_items.adjustments", + "claims.additional_items.refundable", + "claims.additional_items.tax_lines", + "customer", + "discounts", + "discounts.rule", + "gift_card_transactions", + "gift_card_transactions.gift_card", + "gift_cards", + "items", + "items.adjustments", + "items.refundable", + "items.tax_lines", + "items.variant", + "items.variant.product", + "refunds", + "region", + "shipping_address", + "shipping_methods", + "shipping_methods.tax_lines", + "swaps", + "swaps.additional_items", + "swaps.additional_items.adjustments", + "swaps.additional_items.refundable", + "swaps.additional_items.tax_lines" + ], + "totals": [ + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "paid_total", + "refundable_amount", + "refunded_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "claims.additional_items.discount_total", + "claims.additional_items.gift_card_total", + "claims.additional_items.original_tax_total", + "claims.additional_items.original_total", + "claims.additional_items.refundable", + "claims.additional_items.subtotal", + "claims.additional_items.tax_total", + "claims.additional_items.total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total", + "swaps.additional_items.discount_total", + "swaps.additional_items.gift_card_total", + "swaps.additional_items.original_tax_total", + "swaps.additional_items.original_total", + "swaps.additional_items.refundable", + "swaps.additional_items.subtotal", + "swaps.additional_items.tax_total", + "swaps.additional_items.total" + ] + }, + "required": [ + "orders", + "count", + "offset", + "limit" + ], + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + } + }, + "count": { + "description": "The total number of items available", + "type": "integer" + }, + "offset": { + "description": "The number of items skipped before these items", + "type": "integer" + }, + "limit": { + "description": "The number of items per page", + "type": "integer" + } + } + }, + "StoreCustomersListPaymentMethodsRes": { + "type": "object", + "required": [ + "payment_methods" + ], + "properties": { + "payment_methods": { + "type": "array", + "items": { + "type": "object", + "required": [ + "provider_id", + "data" + ], + "properties": { + "provider_id": { + "description": "The id of the Payment Provider where the payment method is saved.", + "type": "string" + }, + "data": { + "description": "The data needed for the Payment Provider to use the saved payment method.", + "type": "object" + } + } + } + } + } + }, + "StoreCustomersRes": { + "type": "object", + "x-expanded-relations": { + "field": "customer", + "relations": [ + "billing_address", + "shipping_addresses" + ] + }, + "required": [ + "customer" + ], + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer" + } + } + }, + "StoreCustomersResetPasswordRes": { + "type": "object", + "required": [ + "customer" + ], + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer" + } + } + }, + "StoreGetAuthEmailRes": { + "type": "object", + "required": [ + "exists" + ], + "properties": { + "exists": { + "description": "Whether email exists or not.", + "type": "boolean" + } + } + }, + "StoreGetProductCategoriesCategoryRes": { + "type": "object", + "x-expanded-relations": { + "field": "product_category", + "relations": [ + "category_children", + "parent_category" + ] + }, + "required": [ + "product_category" + ], + "properties": { + "product_category": { + "$ref": "#/components/schemas/ProductCategory" + } + } + }, + "StoreGetProductCategoriesRes": { + "type": "object", + "x-expanded-relations": { + "field": "product_categories", + "relations": [ + "category_children", + "parent_category" + ] + }, + "required": [ + "product_categories", + "count", + "offset", + "limit" + ], + "properties": { + "product_categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductCategory" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "StoreGiftCardsRes": { + "type": "object", + "required": [ + "gift_card" + ], + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard" + } + } + }, + "StoreOrderEditsRes": { + "type": "object", + "x-expanded-relations": { + "field": "order_edit", + "relations": [ + "changes", + "changes.line_item", + "changes.line_item.variant", + "changes.original_line_item", + "changes.original_line_item.variant", + "items", + "items.adjustments", + "items.tax_lines", + "items.variant", + "payment_collection" + ], + "implicit": [ + "items", + "items.tax_lines", + "items.adjustments", + "items.variant" + ], + "totals": [ + "difference_due", + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total" + ] + }, + "required": [ + "order_edit" + ], + "properties": { + "order_edit": { + "$ref": "#/components/schemas/OrderEdit" + } + } + }, + "StoreOrdersRes": { + "type": "object", + "required": [ + "order" + ], + "x-expanded-relations": { + "field": "order", + "relations": [ + "customer", + "discounts", + "discounts.rule", + "fulfillments", + "fulfillments.tracking_links", + "items", + "items.variant", + "payments", + "region", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "fulfillments.items", + "region.fulfillment_providers", + "region.payment_providers", + "shipping_methods.shipping_option" + ], + "implicit": [ + "claims", + "claims.additional_items", + "claims.additional_items.adjustments", + "claims.additional_items.refundable", + "claims.additional_items.tax_lines", + "discounts", + "discounts.rule", + "gift_card_transactions", + "gift_card_transactions.gift_card", + "gift_cards", + "items", + "items.adjustments", + "items.refundable", + "items.tax_lines", + "items.variant", + "items.variant.product", + "refunds", + "region", + "shipping_methods", + "shipping_methods.tax_lines", + "swaps", + "swaps.additional_items", + "swaps.additional_items.adjustments", + "swaps.additional_items.refundable", + "swaps.additional_items.tax_lines" + ], + "totals": [ + "discount_total", + "gift_card_tax_total", + "gift_card_total", + "paid_total", + "refundable_amount", + "refunded_total", + "shipping_total", + "subtotal", + "tax_total", + "total", + "claims.additional_items.discount_total", + "claims.additional_items.gift_card_total", + "claims.additional_items.original_tax_total", + "claims.additional_items.original_total", + "claims.additional_items.refundable", + "claims.additional_items.subtotal", + "claims.additional_items.tax_total", + "claims.additional_items.total", + "items.discount_total", + "items.gift_card_total", + "items.original_tax_total", + "items.original_total", + "items.refundable", + "items.subtotal", + "items.tax_total", + "items.total", + "swaps.additional_items.discount_total", + "swaps.additional_items.gift_card_total", + "swaps.additional_items.original_tax_total", + "swaps.additional_items.original_total", + "swaps.additional_items.refundable", + "swaps.additional_items.subtotal", + "swaps.additional_items.tax_total", + "swaps.additional_items.total" + ] + }, + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + } + } + }, + "StorePaymentCollectionSessionsReq": { + "type": "object", + "required": [ + "provider_id" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "The ID of the Payment Provider." + } + } + }, + "StorePaymentCollectionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "payment_collection", + "relations": [ + "payment_sessions", + "region" + ], + "eager": [ + "region.fulfillment_providers", + "region.payment_providers" + ] + }, + "required": [ + "payment_collection" + ], + "properties": { + "payment_collection": { + "$ref": "#/components/schemas/PaymentCollection" + } + } + }, + "StorePaymentCollectionsSessionRes": { + "type": "object", + "required": [ + "payment_session" + ], + "properties": { + "payment_session": { + "$ref": "#/components/schemas/PaymentSession" + } + } + }, + "StorePostAuthReq": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email." + }, + "password": { + "type": "string", + "description": "The Customer's password." + } + } + }, + "StorePostCartReq": { + "type": "object", + "properties": { + "region_id": { + "type": "string", + "description": "The ID of the Region to create the Cart in." + }, + "sales_channel_id": { + "type": "string", + "description": "[EXPERIMENTAL] The ID of the Sales channel to create the Cart in." + }, + "country_code": { + "type": "string", + "description": "The 2 character ISO country code to create the Cart in.", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "items": { + "description": "An optional array of `variant_id`, `quantity` pairs to generate Line Items from.", + "type": "array", + "items": { + "type": "object", + "required": [ + "variant_id", + "quantity" + ], + "properties": { + "variant_id": { + "description": "The id of the Product Variant to generate a Line Item from.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Product Variant to add", + "type": "integer" + } + } + } + }, + "context": { + "description": "An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`", + "type": "object", + "example": { + "ip": "::1", + "user_agent": "Chrome" + } + } + } + }, + "StorePostCartsCartLineItemsItemReq": { + "type": "object", + "required": [ + "quantity" + ], + "properties": { + "quantity": { + "type": "number", + "description": "The quantity to set the Line Item to." + } + } + }, + "StorePostCartsCartLineItemsReq": { + "type": "object", + "required": [ + "variant_id", + "quantity" + ], + "properties": { + "variant_id": { + "type": "string", + "description": "The id of the Product Variant to generate the Line Item from." + }, + "quantity": { + "type": "number", + "description": "The quantity of the Product Variant to add to the Line Item." + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details about the Line Item." + } + } + }, + "StorePostCartsCartPaymentSessionReq": { + "type": "object", + "required": [ + "provider_id" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "The ID of the Payment Provider." + } + } + }, + "StorePostCartsCartPaymentSessionUpdateReq": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "description": "The data to update the payment session with." + } + } + }, + "StorePostCartsCartReq": { + "type": "object", + "properties": { + "region_id": { + "type": "string", + "description": "The id of the Region to create the Cart in." + }, + "country_code": { + "type": "string", + "description": "The 2 character ISO country code to create the Cart in.", + "externalDocs": { + "url": "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements", + "description": "See a list of codes." + } + }, + "email": { + "type": "string", + "description": "An email to be used on the Cart.", + "format": "email" + }, + "sales_channel_id": { + "type": "string", + "description": "The ID of the Sales channel to update the Cart with." + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload", + "description": "A full billing address object." + }, + { + "type": "string", + "description": "The billing address ID" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload", + "description": "A full shipping address object." + }, + { + "type": "string", + "description": "The shipping address ID" + } + ] + }, + "gift_cards": { + "description": "An array of Gift Card codes to add to the Cart.", + "type": "array", + "items": { + "type": "object", + "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": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "description": "The code that a Discount is identifed by.", + "type": "string" + } + } + } + }, + "customer_id": { + "description": "The ID of the Customer to associate the Cart with.", + "type": "string" + }, + "context": { + "description": "An optional object to provide context to the Cart.", + "type": "object", + "example": { + "ip": "::1", + "user_agent": "Chrome" + } + } + } + }, + "StorePostCartsCartShippingMethodReq": { + "type": "object", + "required": [ + "option_id" + ], + "properties": { + "option_id": { + "type": "string", + "description": "ID of the shipping option to create the method from" + }, + "data": { + "type": "object", + "description": "Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send." + } + } + }, + "StorePostCustomersCustomerAcceptClaimReq": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "description": "The invite token provided by the admin.", + "type": "string" + } + } + }, + "StorePostCustomersCustomerAddressesAddressReq": { + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload" + } + ] + }, + "StorePostCustomersCustomerAddressesReq": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The Address to add to the Customer.", + "$ref": "#/components/schemas/AddressCreatePayload" + } + } + }, + "StorePostCustomersCustomerOrderClaimReq": { + "type": "object", + "required": [ + "order_ids" + ], + "properties": { + "order_ids": { + "description": "The ids of the orders to claim", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "StorePostCustomersCustomerPasswordTokenReq": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "description": "The email of the customer.", + "type": "string", + "format": "email" + } + } + }, + "StorePostCustomersCustomerReq": { + "type": "object", + "properties": { + "first_name": { + "description": "The Customer's first name.", + "type": "string" + }, + "last_name": { + "description": "The Customer's last name.", + "type": "string" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/AddressPayload", + "description": "The full billing address object" + }, + { + "type": "string", + "description": "The ID of an existing billing address" + } + ] + }, + "password": { + "description": "The Customer's password.", + "type": "string" + }, + "phone": { + "description": "The Customer's phone number.", + "type": "string" + }, + "email": { + "description": "The email of the customer.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the customer.", + "type": "object" + } + } + }, + "StorePostCustomersReq": { + "type": "object", + "required": [ + "first_name", + "last_name", + "email", + "password" + ], + "properties": { + "first_name": { + "description": "The Customer's first name.", + "type": "string" + }, + "last_name": { + "description": "The Customer's last name.", + "type": "string" + }, + "email": { + "description": "The email of the customer.", + "type": "string", + "format": "email" + }, + "password": { + "description": "The Customer's password.", + "type": "string", + "format": "password" + }, + "phone": { + "description": "The Customer's phone number.", + "type": "string" + } + } + }, + "StorePostCustomersResetPasswordReq": { + "type": "object", + "required": [ + "email", + "password", + "token" + ], + "properties": { + "email": { + "description": "The email of the customer.", + "type": "string", + "format": "email" + }, + "password": { + "description": "The Customer's password.", + "type": "string", + "format": "password" + }, + "token": { + "description": "The reset password token", + "type": "string" + } + } + }, + "StorePostOrderEditsOrderEditDecline": { + "type": "object", + "properties": { + "declined_reason": { + "type": "string", + "description": "The reason for declining the OrderEdit." + } + } + }, + "StorePostPaymentCollectionsBatchSessionsAuthorizeReq": { + "type": "object", + "required": [ + "session_ids" + ], + "properties": { + "session_ids": { + "description": "List of Payment Session IDs to authorize.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "StorePostPaymentCollectionsBatchSessionsReq": { + "type": "object", + "required": [ + "sessions" + ], + "properties": { + "sessions": { + "description": "An array of payment sessions related to the Payment Collection. If the session_id is not provided, existing sessions not present will be deleted and the provided ones will be created.", + "type": "array", + "items": { + "type": "object", + "required": [ + "provider_id", + "amount" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "The ID of the Payment Provider." + }, + "amount": { + "type": "integer", + "description": "The amount ." + }, + "session_id": { + "type": "string", + "description": "The ID of the Payment Session to be updated." + } + } + } + } + } + }, + "StorePostReturnsReq": { + "type": "object", + "required": [ + "order_id", + "items" + ], + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the Order to create the Return from." + }, + "items": { + "description": "The items to include in the Return.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of the Line Item from the Order.", + "type": "string" + }, + "quantity": { + "description": "The quantity to return.", + "type": "integer" + }, + "reason_id": { + "description": "The ID of the return reason.", + "type": "string" + }, + "note": { + "description": "A note to add to the item returned.", + "type": "string" + } + } + } + }, + "return_shipping": { + "description": "If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves.", + "type": "object", + "required": [ + "option_id" + ], + "properties": { + "option_id": { + "type": "string", + "description": "The ID of the Shipping Option to create the Shipping Method from." + } + } + } + } + }, + "StorePostSearchRes": { + "allOf": [ + { + "type": "object", + "required": [ + "hits" + ], + "properties": { + "hits": { + "description": "Array of results. The format of the items depends on the search engine installed on the server.", + "type": "array" + } + } + }, + { + "type": "object" + } + ] + }, + "StorePostSwapsReq": { + "type": "object", + "required": [ + "order_id", + "return_items", + "additional_items" + ], + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the Order to create the Swap for." + }, + "return_items": { + "description": "The items to include in the Return.", + "type": "array", + "items": { + "type": "object", + "required": [ + "item_id", + "quantity" + ], + "properties": { + "item_id": { + "description": "The ID of the Line Item from the Order.", + "type": "string" + }, + "quantity": { + "description": "The quantity to swap.", + "type": "integer" + }, + "reason_id": { + "description": "The ID of the reason of this return.", + "type": "string" + }, + "note": { + "description": "The note to add to the item being swapped.", + "type": "string" + } + } + } + }, + "return_shipping_option": { + "type": "string", + "description": "The ID of the Shipping Option to create the Shipping Method from." + }, + "additional_items": { + "description": "The items to exchange the returned items to.", + "type": "array", + "items": { + "type": "object", + "required": [ + "variant_id", + "quantity" + ], + "properties": { + "variant_id": { + "description": "The ID of the Product Variant to send.", + "type": "string" + }, + "quantity": { + "description": "The quantity to send of the variant.", + "type": "integer" + } + } + } + } + } + }, + "StoreProductTagsListRes": { + "type": "object", + "required": [ + "product_tags", + "count", + "offset", + "limit" + ], + "properties": { + "product_tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductTag" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "StoreProductTypesListRes": { + "type": "object", + "required": [ + "product_types", + "count", + "offset", + "limit" + ], + "properties": { + "product_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "StoreProductsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "products", + "relations": [ + "collection", + "images", + "options", + "options.values", + "tags", + "type", + "variants", + "variants.options", + "variants.prices" + ] + }, + "required": [ + "products", + "count", + "offset", + "limit" + ], + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedProduct" + } + }, + "count": { + "type": "integer", + "description": "The total number of items available" + }, + "offset": { + "type": "integer", + "description": "The number of items skipped before these items" + }, + "limit": { + "type": "integer", + "description": "The number of items per page" + } + } + }, + "StoreProductsRes": { + "type": "object", + "x-expanded-relations": { + "field": "product", + "relations": [ + "collection", + "images", + "options", + "options.values", + "tags", + "type", + "variants", + "variants.options", + "variants.prices" + ] + }, + "required": [ + "product" + ], + "properties": { + "product": { + "$ref": "#/components/schemas/PricedProduct" + } + } + }, + "StoreRegionsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "regions", + "relations": [ + "countries", + "payment_providers", + "fulfillment_providers" + ], + "eager": [ + "payment_providers", + "fulfillment_providers" + ] + }, + "required": [ + "regions" + ], + "properties": { + "regions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Region" + } + } + } + }, + "StoreRegionsRes": { + "type": "object", + "x-expanded-relations": { + "field": "region", + "relations": [ + "countries", + "payment_providers", + "fulfillment_providers" + ], + "eager": [ + "payment_providers", + "fulfillment_providers" + ] + }, + "required": [ + "region" + ], + "properties": { + "region": { + "$ref": "#/components/schemas/Region" + } + } + }, + "StoreReturnReasonsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "return_reasons", + "relations": [ + "parent_return_reason", + "return_reason_children" + ] + }, + "required": [ + "return_reasons" + ], + "properties": { + "return_reasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReturnReason" + } + } + } + }, + "StoreReturnReasonsRes": { + "type": "object", + "x-expanded-relations": { + "field": "return_reason", + "relations": [ + "parent_return_reason", + "return_reason_children" + ] + }, + "required": [ + "return_reason" + ], + "properties": { + "return_reason": { + "$ref": "#/components/schemas/ReturnReason" + } + } + }, + "StoreReturnsRes": { + "type": "object", + "x-expanded-relations": { + "field": "return", + "relations": [ + "items", + "items.reason" + ], + "eager": [ + "items" + ] + }, + "required": [ + "return" + ], + "properties": { + "return": { + "$ref": "#/components/schemas/Return" + } + } + }, + "StoreShippingOptionsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "shipping_options", + "relations": [ + "requirements" + ] + }, + "required": [ + "shipping_options" + ], + "properties": { + "shipping_options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedShippingOption" + } + } + } + }, + "StoreSwapsRes": { + "type": "object", + "x-expanded-relations": { + "field": "swap", + "relations": [ + "additional_items", + "additional_items.variant", + "cart", + "fulfillments", + "order", + "payment", + "return_order", + "return_order.shipping_method", + "shipping_address", + "shipping_methods" + ], + "eager": [ + "fulfillments.items" + ] + }, + "required": [ + "swap" + ], + "properties": { + "swap": { + "$ref": "#/components/schemas/Swap" + } + } + }, + "StoreVariantsListRes": { + "type": "object", + "x-expanded-relations": { + "field": "variants", + "relations": [ + "prices", + "options", + "product" + ] + }, + "required": [ + "variants" + ], + "properties": { + "variants": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PricedVariant" + } + } + } + }, + "StoreVariantsRes": { + "type": "object", + "x-expanded-relations": { + "field": "variant", + "relations": [ + "prices", + "options", + "product" + ] + }, + "required": [ + "variant" + ], + "properties": { + "variant": { + "$ref": "#/components/schemas/PricedVariant" + } + } + }, + "Swap": { + "title": "Swap", + "description": "Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference.", + "type": "object", + "required": [ + "allow_backorder", + "canceled_at", + "cart_id", + "confirmed_at", + "created_at", + "deleted_at", + "difference_due", + "fulfillment_status", + "id", + "idempotency_key", + "metadata", + "no_notification", + "order_id", + "payment_status", + "shipping_address_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The swap's ID", + "type": "string", + "example": "swap_01F0YET86Y9G92D3YDR9Y6V676" + }, + "fulfillment_status": { + "description": "The status of the Fulfillment of the Swap.", + "type": "string", + "enum": [ + "not_fulfilled", + "fulfilled", + "shipped", + "partially_shipped", + "canceled", + "requires_action" + ], + "example": "not_fulfilled" + }, + "payment_status": { + "description": "The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.", + "type": "string", + "enum": [ + "not_paid", + "awaiting", + "captured", + "confirmed", + "canceled", + "difference_refunded", + "partially_refunded", + "refunded", + "requires_action" + ], + "example": "not_paid" + }, + "order_id": { + "description": "The ID of the Order where the Line Items to be returned where purchased.", + "type": "string", + "example": "order_01G8TJSYT9M6AVS5N4EMNFS1EK" + }, + "order": { + "description": "An order object. Available if the relation `order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Order" + }, + "additional_items": { + "description": "The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/LineItem" + } + }, + "return_order": { + "description": "A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Return" + }, + "fulfillments": { + "description": "The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + } + }, + "payment": { + "description": "The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Payment" + }, + "difference_due": { + "description": "The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products.", + "nullable": true, + "type": "integer", + "example": 0 + }, + "shipping_address_id": { + "description": "The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order.", + "nullable": true, + "type": "string", + "example": "addr_01G8ZH853YPY9B94857DY91YGW" + }, + "shipping_address": { + "description": "Available if the relation `shipping_address` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Address" + }, + "shipping_methods": { + "description": "The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShippingMethod" + } + }, + "cart_id": { + "description": "The id of the Cart that the Customer will use to confirm the Swap.", + "nullable": true, + "type": "string", + "example": "cart_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "cart": { + "description": "A cart object. Available if the relation `cart` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Cart" + }, + "confirmed_at": { + "description": "The date with timezone at which the Swap was confirmed by the Customer.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date with timezone at which the Swap was canceled.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "no_notification": { + "description": "If set to true, no notification will be sent related to this swap", + "nullable": true, + "type": "boolean", + "example": false + }, + "allow_backorder": { + "description": "If true, swaps can be completed with items out of stock", + "type": "boolean", + "default": false + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of the swap in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "TaxLine": { + "title": "Tax Line", + "description": "Line item that specifies an amount of tax to add to a line item.", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "metadata", + "name", + "rate", + "updated_at" + ], + "properties": { + "id": { + "description": "The tax line's ID", + "type": "string", + "example": "tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8" + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number", + "example": 10 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "TaxProvider": { + "title": "Tax Provider", + "description": "The tax service used to calculate taxes", + "type": "object", + "required": [ + "id", + "is_installed" + ], + "properties": { + "id": { + "description": "The id of the tax provider as given by the plugin.", + "type": "string", + "example": "manual" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean", + "default": true + } + } + }, + "TaxRate": { + "title": "Tax Rate", + "description": "A Tax Rate can be used to associate a certain rate to charge on products within a given Region", + "type": "object", + "required": [ + "code", + "created_at", + "id", + "metadata", + "name", + "rate", + "region_id", + "updated_at" + ], + "properties": { + "id": { + "description": "The tax rate's ID", + "type": "string", + "example": "txr_01G8XDBAWKBHHJRKH0AV02KXBR" + }, + "rate": { + "description": "The numeric rate to charge", + "nullable": true, + "type": "number", + "example": 10 + }, + "code": { + "description": "A code to identify the tax type by", + "nullable": true, + "type": "string", + "example": "tax01" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string", + "example": "Tax Example" + }, + "region_id": { + "description": "The id of the Region that the rate belongs to", + "type": "string", + "example": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G" + }, + "region": { + "description": "A region object. Available if the relation `region` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Region" + }, + "products": { + "description": "The products that belong to this tax rate. Available if the relation `products` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "product_types": { + "description": "The product types that belong to this tax rate. Available if the relation `product_types` is expanded.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductType" + } + }, + "shipping_options": { + "type": "array", + "description": "The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded.", + "items": { + "$ref": "#/components/schemas/ShippingOption" + } + }, + "product_count": { + "description": "The count of products", + "type": "integer", + "example": 10 + }, + "product_type_count": { + "description": "The count of product types", + "type": "integer", + "example": 2 + }, + "shipping_option_count": { + "description": "The count of shipping options", + "type": "integer", + "example": 1 + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "TrackingLink": { + "title": "Tracking Link", + "description": "Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment.", + "type": "object", + "required": [ + "created_at", + "deleted_at", + "fulfillment_id", + "id", + "idempotency_key", + "metadata", + "tracking_number", + "updated_at", + "url" + ], + "properties": { + "id": { + "description": "The tracking link's ID", + "type": "string", + "example": "tlink_01G8ZH853Y6TFXWPG5EYE81X63" + }, + "url": { + "description": "The URL at which the status of the shipment can be tracked.", + "nullable": true, + "type": "string", + "format": "uri" + }, + "tracking_number": { + "description": "The tracking number given by the shipping carrier.", + "type": "string", + "format": "RH370168054CN" + }, + "fulfillment_id": { + "description": "The id of the Fulfillment that the Tracking Link references.", + "type": "string", + "example": "ful_01G8ZRTMQCA76TXNAT81KPJZRF" + }, + "fulfillment": { + "description": "Available if the relation `fulfillment` is expanded.", + "nullable": true, + "$ref": "#/components/schemas/Fulfillment" + }, + "idempotency_key": { + "description": "Randomly generated key used to continue the completion of a process in case of failure.", + "nullable": true, + "type": "string", + "externalDocs": { + "url": "https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key", + "description": "Learn more how to use the idempotency key." + } + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + }, + "UpdateStockLocationInput": { + "title": "Update Stock Location Input", + "description": "Represents the Input to update a Stock Location", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The stock location name" + }, + "address_id": { + "type": "string", + "description": "The Stock location address ID" + }, + "address": { + "description": "Stock location address object", + "allOf": [ + { + "$ref": "#/components/schemas/StockLocationAddressInput" + }, + { + "type": "object" + } + ] + }, + "metadata": { + "type": "object", + "description": "An optional key-value map with additional details", + "example": { + "car": "white" + } + } + } + }, + "User": { + "title": "User", + "description": "Represents a User who can manage store settings.", + "type": "object", + "required": [ + "api_token", + "created_at", + "deleted_at", + "email", + "first_name", + "id", + "last_name", + "metadata", + "role", + "updated_at" + ], + "properties": { + "id": { + "description": "The user's ID", + "type": "string", + "example": "usr_01G1G5V26F5TB3GPAPNJ8X1S3V" + }, + "role": { + "description": "The user's role", + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ], + "default": "member" + }, + "email": { + "description": "The email of the User", + "type": "string", + "format": "email" + }, + "first_name": { + "description": "The first name of the User", + "nullable": true, + "type": "string", + "example": "Levi" + }, + "last_name": { + "description": "The last name of the User", + "nullable": true, + "type": "string", + "example": "Bogan" + }, + "api_token": { + "description": "An API token associated with the user.", + "nullable": true, + "type": "string", + "example": null + }, + "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 updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "nullable": true, + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional details", + "nullable": true, + "type": "object", + "example": { + "car": "white" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/api/store.oas.yaml b/docs/api/store.oas.yaml new file mode 100644 index 0000000000..eb940ba47a --- /dev/null +++ b/docs/api/store.oas.yaml @@ -0,0 +1,12229 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Medusa Storefront API + description: | + API reference for Medusa's Storefront endpoints. All endpoints are prefixed with `/store`. + + ## Authentication + + To send requests as an authenticated customer, you must use the Cookie Session ID. + + + + ## Expanding Fields + + In many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response. + + Please note that the relations you pass to `expand` replace any relations that are expanded by default in the request. + + ### Expanding One Relation + + For example, when you retrieve a product, you can retrieve its collection by passing to the `expand` query parameter the value `collection`: + + ```bash + curl "http://localhost:9000/store/products/prod_01GDJGP2XPQT2N3JHZQFMH5V45?expand=collection" + ``` + + ### Expanding Multiple Relations + + You can expand more than one relation by separating the relations in the `expand` query parameter with a comma. + + For example, to retrieve both the variants and the collection of a product, pass to the `expand` query parameter the value `variants,collection`: + + ```bash + curl "http://localhost:9000/store/products/prod_01GDJGP2XPQT2N3JHZQFMH5V45?expand=variants,collection" + ``` + + ### Prevent Expanding Relations + + Some requests expand relations by default. You can prevent that by passing an empty expand value to retrieve an entity without any extra relations. + + For example: + + ```bash + curl "http://localhost:9000/store/products/prod_01GDJGP2XPQT2N3JHZQFMH5V45?expand" + ``` + + This would retrieve the product with only its properties, without any relations like `collection`. + + ## Selecting Fields + + In many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response. + + Please note that if you pass a `fields` query parameter, only the fields you pass in the value along with the `id` of the entity will be returned in the response. + + Also, the `fields` query parameter does not affect the expanded relations. You'll have to use the `expand` parameter instead. + + ### Selecting One Field + + For example, when you retrieve a list of products, you can retrieve only the titles of the products by passing `title` as a value to the `fields` query parameter: + + ```bash + curl "http://localhost:9000/store/products?fields=title" + ``` + + As mentioned above, the expanded relations such as `variants` will still be returned as they're not affected by the `fields` parameter. + + You can ensure that only the `title` field is returned by passing an empty value to the `expand` query parameter. For example: + + ```bash + curl "http://localhost:9000/store/products?fields=title&expand" + ``` + + ### Selecting Multiple Fields + + You can pass more than one field by seperating the field names in the `fields` query parameter with a comma. + + For example, to select the `title` and `handle` of a product: + + ```bash + curl "http://localhost:9000/store/products?fields=title,handle" + ``` + + ### Retrieve Only the ID + + You can pass an empty `fields` query parameter to return only the ID of an entity. For example: + + ```bash + curl "http://localhost:9000/store/products?fields" + ``` + + You can also pair with an empty `expand` query parameter to ensure that the relations aren't retrieved as well. For example: + + ```bash + curl "http://localhost:9000/store/products?fields&expand" + ``` + + ## Query Parameter Types + + This section covers how to pass some common data types as query parameters. This is useful if you're sending requests to the API endpoints and not using our JS Client. For example, when using cURL or Postman. + + ### Strings + + You can pass a string value in the form of `=`. + + For example: + + ```bash + curl "http://localhost:9000/store/products?title=Shirt" + ``` + + If the string has any characters other than letters and numbers, you must encode them. + + For example, if the string has spaces, you can encode the space with `+` or `%20`: + + ```bash + curl "http://localhost:9000/store/products?title=Blue%20Shirt" + ``` + + You can use tools like [this one](https://www.urlencoder.org/) to learn how a value can be encoded. + + ### Integers + + You can pass an integer value in the form of `=`. + + For example: + + ```bash + curl "http://localhost:9000/store/products?offset=1" + ``` + + ### Boolean + + You can pass a boolean value in the form of `=`. + + For example: + + ```bash + curl "http://localhost:9000/store/products?is_giftcard=true" + ``` + + ### Date and DateTime + + You can pass a date value in the form `=`. The date must be in the format `YYYY-MM-DD`. + + For example: + + ```bash + curl -g "http://localhost:9000/store/products?created_at[lt]=2023-02-17" + ``` + + You can also pass the time using the format `YYYY-MM-DDTHH:MM:SSZ`. Please note that the `T` and `Z` here are fixed. + + For example: + + ```bash + curl -g "http://localhost:9000/store/products?created_at[lt]=2023-02-17T07:22:30Z" + ``` + + ### Array + + Each array value must be passed as a separate query parameter in the form `[]=`. You can also specify the index of each parameter in the brackets `[0]=`. + + For example: + + ```bash + curl -g "http://localhost:9000/store/products?sales_channel_id[]=sc_01GPGVB42PZ7N3YQEP2WDM7PC7&sales_channel_id[]=sc_234PGVB42PZ7N3YQEP2WDM7PC7" + ``` + + Note that the `-g` parameter passed to `curl` disables errors being thrown for using the brackets. Read more [here](https://curl.se/docs/manpage.html#-g). + + ### Object + + Object parameters must be passed as separate query parameters in the form `[]=`. + + For example: + + ```bash + curl -g "http://localhost:9000/store/products?created_at[lt]=2023-02-17&created_at[gt]=2022-09-17" + ``` + + ## Pagination + + ### Query Parameters + + In listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`. + + `limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities. + + You can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on. + + For example, to limit the number of products returned in the List Products endpoint: + + ```bash + curl "http://localhost:9000/store/products?limit=5" + ``` + + ### Response Fields + + In the response of listing endpoints, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`. + + Similar to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result. + + `count` is the total number of available items of this entity. It can be used to determine how many pages are there. + + For example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + license: + name: MIT + url: https://github.com/medusajs/medusa/blob/master/LICENSE +tags: + - name: Auth + description: Auth endpoints that allow authorization of customers and manages their sessions. + - name: Carts + description: Cart endpoints that allow handling carts in Medusa. + - name: Collections + description: Collection endpoints that allow handling collections in Medusa. + - name: Customers + description: Customer endpoints that allow handling customers in Medusa. + - name: Gift Cards + description: Gift Card endpoints that allow handling gift cards in Medusa. + - name: Orders + description: Order endpoints that allow handling orders in Medusa. + - name: Products + description: Product endpoints that allow handling products in Medusa. + - name: Product Variants + description: Product Variant endpoints that allow handling product variants in Medusa. + - name: Regions + description: Region endpoints that allow handling regions in Medusa. + - name: Return Reasons + description: Return Reason endpoints that allow handling return reasons in Medusa. + - name: Returns + description: Return endpoints that allow handling returns in Medusa. + - name: Shipping Options + description: Shipping Option endpoints that allow handling shipping options in Medusa. + - name: Swaps + description: Swap endpoints that allow handling swaps in Medusa. +servers: + - url: https://api.medusa-commerce.com +paths: + /store/auth: + get: + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.auth.getSession() + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostAuth + summary: Customer Login + description: Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostAuthReq' + x-codegen: + method: authenticate + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.auth.authenticate({ + email: 'user@example.com', + password: 'user@example.com' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteAuth + summary: Customer Log out + description: Destroys a Customer's authenticated session. + x-authenticated: true + x-codegen: + method: deleteSession + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/auth/{email}: + get: + operationId: GetAuthEmail + summary: Check if email exists + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + schema: + type: string + format: email + required: true + description: The email to check if exists. + x-codegen: + method: exists + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.auth.exists('user@example.com') + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/auth/user@example.com' \ + --header 'Cookie: connect.sid={sid}' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetAuthEmailRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts: + post: + summary: Create a Cart + operationId: PostCart + description: Creates a Cart within the given region and with the initial items. If no `region_id` is provided the cart will be associated with the first Region available. If no items are provided the cart will be empty after creation. If a user is logged in the cart's customer id and email will be set. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.create() + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Carts + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}: + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.retrieve(cart_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/carts/{id}' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.update(cart_id, { + email: 'user@example.com' + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/complete: + post: + summary: Complete a Cart + operationId: PostCartsCartComplete + description: Completes a cart. The following steps will be performed. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header `Idempotency-Key`. If not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + x-codegen: + method: complete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.complete(cart_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/complete' + tags: + - Carts + responses: + '200': + description: If a cart was successfully authorized, but requires further action from the user the response body will contain the cart with an updated payment session. If the Cart was successfully completed the response body will contain the newly created Order. + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCompleteCartRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/discounts/{code}: + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string + x-codegen: + method: deleteDiscount + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.deleteDiscount(cart_id, code) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/line-items: + post: + operationId: PostCartsCartLineItems + summary: Add a Line Item + description: Generates a Line Item with a given Product Variant and adds it to the Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart to add the Line Item to. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsReq' + x-codegen: + method: createLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/line-items/{line_id}: + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 1 + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codegen: + method: deleteLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.lineItems.delete(cart_id, line_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/payment-session: + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: Selects a Payment Session as the session intended to be used towards the completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionReq' + x-codegen: + method: setPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/payment-sessions: + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: Creates Payment Sessions for each of the available Payment Providers in the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: createPaymentSessions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.createPaymentSessions(cart_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/payment-sessions/{provider_id}: + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the payment provider. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionUpdateReq' + x-codegen: + method: updatePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + + } + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "data": {} + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: Deletes a Payment Session on a Cart. May be useful if a payment has failed. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the Payment Provider used to create the Payment Session to be deleted. + schema: + type: string + x-codegen: + method: deletePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.deletePaymentSession(cart_id, 'manual') + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/payment-sessions/{provider_id}/refresh: + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the Payment Provider that created the Payment Session to be refreshed. + schema: + type: string + x-codegen: + method: refreshPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.refreshPaymentSession(cart_id, 'manual') + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/shipping-methods: + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + parameters: + - in: path + name: id + required: true + description: The cart ID. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartShippingMethodReq' + x-codegen: + method: addShippingMethod + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.addShippingMethod(cart_id, { + option_id + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "option_id": "{option_id}", + }' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/carts/{id}/taxes: + post: + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: Calculates taxes for a cart. Depending on the cart's region this may involve making 3rd party API calls to a Tax Provider service. + parameters: + - in: path + name: id + required: true + description: The Cart ID. + schema: + type: string + x-codegen: + method: calculateTaxes + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/taxes' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + parameters: + - in: query + name: offset + description: The number of collections to skip before starting to collect the collections set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return + schema: + type: integer + default: 10 + - in: query + name: handle + style: form + explode: false + description: Filter by the collection handle + schema: + type: array + items: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.collections.list() + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/collections' + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCollectionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/collections/{id}: + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.collections.retrieve(collection_id) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/collections/{id}' + tags: + - Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.customers.create({ + first_name: 'Alec', + last_name: 'Reynolds', + email: 'user@example.com', + password: 'supersecret' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Alec", + "last_name": "Reynolds", + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + description: A customer with the same email exists + content: + application/json: + schema: + type: object + properties: + code: + type: string + description: The error code + type: + type: string + description: The type of error + message: + type: string + description: Human-readable message with details about the error + example: + code: invalid_request_error + type: duplicate_error + message: A customer with the given email already has an account. Log in instead + '500': + $ref: '#/components/responses/500_error' + /store/customers/me: + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: Retrieves a Customer - the Customer must be logged in to retrieve their details. + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.retrieve() + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update Customer + description: Updates a Customer's saved details. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.update({ + first_name: 'Laury' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me' \ + --header 'Cookie: connect.sid={sid}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Laury" + }' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/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: + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' + x-codegen: + method: addAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.addresses.addAddress({ + address: { + first_name: 'Celia', + last_name: 'Schumm', + address_1: '225 Bednar Curve', + city: 'Danielville', + country_code: 'US', + postal_code: '85137', + phone: '981-596-6748 x90188', + company: 'Wyman LLC', + address_2: '', + province: 'Georgia', + metadata: {} + } + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses' \ + --header 'Cookie: connect.sid={sid}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "address": { + "first_name": "Celia", + "last_name": "Schumm", + "address_1": "225 Bednar Curve", + "city": "Danielville", + "country_code": "US", + "postal_code": "85137" + } + }' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: A successful response + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/customers/me/addresses/{address_id}: + 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: + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesAddressReq' + x-codegen: + method: updateAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.addresses.updateAddress(address_id, { + first_name: 'Gina' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + --header 'Cookie: connect.sid={sid}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Gina" + }' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresses. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string + x-codegen: + method: deleteAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.addresses.deleteAddress(address_id) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/customers/me/orders: + get: + operationId: GetCustomersCustomerOrders + summary: List Orders + description: Retrieves a list of a Customer's Orders. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching orders. + schema: + type: string + - in: query + name: id + description: Id of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + - in: query + name: display_id + description: Display id to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + description: to search for. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + - in: query + name: tax_rate + description: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + description: Date comparison for when resulting collections were canceled. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: How many orders to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The offset in the resulting orders. + schema: + type: integer + default: 0 + - in: query + name: fields + description: (Comma separated string) Which fields should be included in the resulting orders. + schema: + type: string + - in: query + name: expand + description: (Comma separated string) Which relations should be expanded in the resulting orders. + schema: + type: string + x-codegen: + method: listOrders + queryParams: StoreGetCustomersCustomerOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.listOrders() + .then(({ orders, limit, offset, count }) => { + console.log(orders); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersListOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Get Payment Methods + description: Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods. + x-authenticated: true + x-codegen: + method: listPaymentMethods + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.paymentMethods.list() + .then(({ payment_methods }) => { + console.log(payment_methods.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me/payment-methods' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersListPaymentMethodsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/customers/password-reset: + post: + operationId: PostCustomersResetPassword + summary: Reset Password + description: Resets a Customer's password using a password token created by a previous /password-token request. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' + x-codegen: + method: resetPassword + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.customers.resetPassword({ + email: 'user@example.com', + password: 'supersecret', + token: 'supersecrettoken' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/password-reset' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret", + "token": "supersecrettoken" + }' + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersResetPasswordRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/customers/password-token: + post: + operationId: PostCustomersCustomerPasswordToken + summary: Request Password Reset + description: Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' + x-codegen: + method: generatePasswordToken + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.customers.generatePasswordToken({ + email: 'user@example.com' + }) + .then(() => { + // successful + }) + .catch(() => { + // failed + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/password-token' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Customers + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/gift-cards/{code}: + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unique code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.giftCards.retrieve(code) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/gift-cards/{code}' + tags: + - Gift Cards + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/order-edits/{id}: + get: + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orderEdits.retrieve(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}' + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/order-edits/{id}/complete: + post: + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + x-codegen: + method: complete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orderEdits.complete(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/complete' + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /store/order-edits/{id}/decline: + post: + operationId: PostOrderEditsOrderEditDecline + summary: Decline an OrderEdit + description: Declines an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' + x-codegen: + method: decline + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orderEdits.decline(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/decline' + tags: + - Order Edits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /store/orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: Look up an order using filters. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the result. + schema: + type: string + - in: query + name: email + style: form + explode: false + description: The email associated with this order. + required: true + schema: + type: string + format: email + - in: query + name: shipping_address + style: form + explode: false + description: The shipping address associated with this order. + schema: + type: object + properties: + postal_code: + type: string + description: The postal code of the shipping address + x-codegen: + method: lookupOrder + queryParams: StoreGetOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orders.lookupOrder({ + display_id: 1, + email: 'user@example.com' + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim an Order + description: Sends an email to emails registered to orders provided with link to transfer order ownership + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' + x-codegen: + method: requestCustomerOrders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.orders.claimOrders({ + display_ids, + }) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/orders/cart/{cart_id}: + get: + operationId: GetOrdersOrderCartId + summary: Get by Cart ID + description: Retrieves an Order by the id of the Cart that was used to create the Order. + parameters: + - in: path + name: cart_id + required: true + description: The ID of Cart. + schema: + type: string + x-codegen: + method: retrieveByCartId + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orders.retrieveByCartId(cart_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/orders/cart/{id}' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify an Order Claim + description: Verifies the claim order token provided to the customer upon request of order ownership + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' + x-codegen: + method: confirmRequest + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.orders.confirmRequest( + token, + ) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/orders/{id}: + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the result. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orders.retrieve(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/orders/{id}' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-collections/{id}: + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Get a PaymentCollection + description: Get a Payment Collection + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: StoreGetPaymentCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-collections/{id}/sessions: + post: + operationId: PostPaymentCollectionsSessions + summary: Manage a Payment Session + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' + x-codegen: + method: managePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding a payment session + medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-collections/{id}/sessions/batch: + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Payment Sessions + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' + x-codegen: + method: managePaymentSessionsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding two new sessions + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-collections/{id}/sessions/batch/authorize: + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize PaymentSessions + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq' + x-codegen: + method: authorizePaymentSessionsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.paymentCollections.authorize(payment_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-collections/{id}/sessions/{session_id}: + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: Refreshes a Payment Session to ensure that it is in sync with the Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + x-codegen: + method: refreshPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id) + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsSessionRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-collections/{id}/sessions/{session_id}/authorize: + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize Payment Session + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. + schema: + type: string + x-codegen: + method: authorizePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.paymentCollections.authorize(payment_id, session_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment Collections + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsSessionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/product-categories: + get: + operationId: GetProductCategories + summary: List Product Categories + description: Retrieve a list of product categories. + x-authenticated: false + parameters: + - in: query + name: q + description: Query used for searching product category names or handles. + schema: + type: string + - in: query + name: parent_category_id + description: Returns categories scoped by parent + schema: + type: string + - in: query + name: include_descendants_tree + description: Include all nested descendants of category + schema: + type: boolean + - in: query + name: offset + description: How many product categories to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of product categories returned. + schema: + type: integer + default: 100 + x-codegen: + method: list + queryParams: StoreGetProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.productCategories.list() + .then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-categories' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetProductCategoriesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/product-categories/{id}: + get: + operationId: GetProductCategoriesCategory + summary: Get a Product Category + description: Retrieves a Product Category. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each product category. + schema: + type: string + x-codegen: + method: retrieve + queryParams: StoreGetProductCategoriesCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/product-tags: + get: + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. + x-authenticated: true + x-codegen: + method: list + queryParams: StoreGetProductTagsParams + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.productTags.list() + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-tags' + tags: + - Product Tags + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductTagsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.productTypes.list() + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-types' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductTypesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/products: + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Products. + parameters: + - in: query + name: q + description: Query used for searching products by title, description, variant's title, variant's sku, and collection's title + schema: + type: string + - in: query + name: id + style: form + explode: false + description: product IDs to search for. + schema: + oneOf: + - type: string + - type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: an array of sales channel IDs to filter the retrieved products by. + schema: + type: array + items: + 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: type_id + style: form + explode: false + description: Type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: category_id + style: form + explode: false + description: Category ids to filter by. + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id. + schema: + type: boolean + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 100 + - 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 + - in: query + name: order + description: the field used to order the products. + schema: + type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.products.list() + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/products' + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/products/search: + post: + operationId: PostProductsSearch + summary: Search Products + description: Run a search query on products using the search engine installed on Medusa + parameters: + - in: query + name: q + required: true + description: The query to run the search with. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + x-codegen: + method: search + queryParams: StorePostSearchReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.products.search({ + q: 'Shirt' + }) + .then(({ hits }) => { + console.log(hits.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/products/search?q=Shirt' + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostSearchRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/products/{id}: + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + parameters: + - in: path + name: id + required: true + description: The id of the Product. + schema: + type: string + - in: query + name: sales_channel_id + description: The sales channel used when fetching the product. + schema: + type: string + - in: query + name: cart_id + description: The ID of the customer's cart. + schema: + type: string + - in: query + name: region_id + description: The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + 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: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetProductsProductParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.products.retrieve(product_id) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/products/{id}' + tags: + - Products + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/regions: + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + parameters: + - in: query + name: offset + description: How many regions to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of regions returned. + schema: + type: integer + default: 100 + - in: query + name: created_at + description: Date comparison for when resulting regions were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting regions were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetRegionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.regions.list() + .then(({ regions }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/regions' + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRegionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/regions/{id}: + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.regions.retrieve(region_id) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/regions/{id}' + tags: + - Regions + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/return-reasons: + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.returnReasons.list() + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/return-reasons' + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnReasonsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/return-reasons/{id}: + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.returnReasons.retrieve(reason_id) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/return-reasons/{id}' + tags: + - Return Reasons + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/returns: + post: + operationId: PostReturns + summary: Create Return + description: Creates a Return for an Order. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostReturnsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.returns.create({ + order_id, + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/returns' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "order_id": "asfasf", + "items": [ + { + "item_id": "assfasf", + "quantity": 1 + } + ] + }' + tags: + - Returns + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/shipping-options: + get: + operationId: GetShippingOptions + summary: Get Shipping Options + description: Retrieves a list of Shipping Options. + parameters: + - in: query + name: is_return + description: Whether return Shipping Options should be included. By default all Shipping Options are returned. + schema: + type: boolean + - in: query + name: product_ids + description: A comma separated list of Product ids to filter Shipping Options by. + schema: + type: string + - in: query + name: region_id + description: the Region to retrieve Shipping Options from. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.shippingOptions.list() + .then(({ shipping_options }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/shipping-options' + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/shipping-options/{cart_id}: + get: + operationId: GetShippingOptionsCartId + summary: List for Cart + description: Retrieves a list of Shipping Options available to a cart. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: listCartOptions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.shippingOptions.listCartOptions(cart_id) + .then(({ shipping_options }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/shipping-options/{cart_id}' + tags: + - Shipping Options + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/swaps: + post: + operationId: PostSwaps + summary: Create a Swap + description: Creates a Swap on an Order by providing some items to return along with some items to send back + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostSwapsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.swaps.create({ + order_id, + return_items: [ + { + item_id, + quantity: 1 + } + ], + additional_items: [ + { + variant_id, + quantity: 1 + } + ] + }) + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/swaps' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "order_id": "asfasf", + "return_items": [ + { + "item_id": "asfas", + "quantity": 1 + } + ], + "additional_items": [ + { + "variant_id": "asfas", + "quantity": 1 + } + ] + }' + tags: + - Swaps + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/swaps/{cart_id}: + get: + operationId: GetSwapsSwapCartId + summary: Get by Cart ID + description: Retrieves a Swap by the id of the Cart used to confirm the Swap. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart + schema: + type: string + x-codegen: + method: retrieveByCartId + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.swaps.retrieveByCartId(cart_id) + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/swaps/{cart_id}' + tags: + - Swaps + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/variants: + get: + operationId: GetVariants + summary: Get Product Variants + description: Retrieves a list of Product Variants + parameters: + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: filter by inventory quantity less than or equal to this number + gte: + type: number + description: filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: StoreGetVariantsParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/variants' + tags: + - Variants + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreVariantsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/variants/{variant_id}: + get: + operationId: GetVariantsVariant + summary: Get a Product Variant + description: Retrieves a Product Variant by id + parameters: + - in: path + name: variant_id + required: true + description: The id of the Product Variant. + schema: + type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetVariantsVariantParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/variants/{id}' + tags: + - Variants + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' +components: + responses: + default_error: + description: Default Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + invalid_state_error: + description: Invalid State Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: The request conflicted with another request. You may retry the request with the provided Idempotency-Key. + type: QueryRunnerAlreadyReleasedError + invalid_request_error: + description: Invalid Request Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: invalid_request_error + message: Discount with code TEST already exists. + type: duplicate_error + not_found_error: + description: Not Found Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + message: Entity with id 1 was not found + type: not_found + 400_error: + description: Client Error or Multiple Errors + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' + examples: + not_allowed: + $ref: '#/components/examples/not_allowed_error' + invalid_data: + $ref: '#/components/examples/invalid_data_error' + MultipleErrors: + $ref: '#/components/examples/multiple_errors' + 500_error: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + database: + $ref: '#/components/examples/database_error' + unexpected_state: + $ref: '#/components/examples/unexpected_state_error' + invalid_argument: + $ref: '#/components/examples/invalid_argument_error' + default_error: + $ref: '#/components/examples/default_error' + unauthorized: + description: User is not authorized. Must log in first + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + incorrect_credentials: + description: User does not exist or incorrect credentials + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + examples: + not_allowed_error: + summary: Not Allowed Error + value: + message: Discount must be set to dynamic + type: not_allowed + invalid_data_error: + summary: Invalid Data Error + value: + message: first_name must be a string + type: invalid_data + multiple_errors: + summary: Multiple Errors + value: + message: Provided request body contains errors. Please check the data and retry the request + errors: + - message: first_name must be a string + type: invalid_data + - message: Discount must be set to dynamic + type: not_allowed + database_error: + summary: Database Error + value: + code: api_error + message: An error occured while hashing password + type: database_error + unexpected_state_error: + summary: Unexpected State Error + value: + message: cart.total must be defined + type: unexpected_state + invalid_argument_error: + summary: Invalid Argument Error + value: + message: cart.total must be defined + type: unexpected_state + default_error: + summary: Default Error + value: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + securitySchemes: + cookie_auth: + type: apiKey + x-displayName: Cookie Session ID + in: cookie + name: connect.sid + description: | + Use a cookie session to send authenticated requests. + + ### How to Obtain the Cookie Session + + If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the customer is logged in. + + If you're sending requests using cURL, you must set the Session ID in the cookie manually. + + To do that, send a request to [authenticate the customer](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + + ```bash + curl -v --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + ``` + + The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this: + + ```bash + Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; + ``` + + Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following: + + ```bash + curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ + --header 'Cookie: connect.sid={sid}' + ``` + + Where `{sid}` is the value of `connect.sid` that you copied. + schemas: + Address: + title: Address + description: An address. + type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at + properties: + id: + type: string + description: ID of the address + example: addr_01G8ZC9VS1XVE149MGH2J7QSSH + customer_id: + description: ID of the customer this address belongs to + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: Available if the relation `customer` is expanded. + nullable: true + type: object + company: + description: Company name + nullable: true + type: string + example: Acme + first_name: + description: First name + nullable: true + type: string + example: Arno + last_name: + description: Last name + nullable: true + type: string + example: Willms + address_1: + description: Address line 1 + nullable: true + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + nullable: true + type: string + example: Suite 369 + city: + description: City + nullable: true + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + nullable: true + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + country: + description: A country object. Available if the relation `country` is expanded. + nullable: true + $ref: '#/components/schemas/Country' + province: + description: Province + nullable: true + type: string + example: Kentucky + postal_code: + description: Postal Code + nullable: true + type: string + example: 72093 + phone: + description: Phone Number + nullable: true + type: string + example: 16128234334802 + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + AddressCreatePayload: + type: object + description: Address fields used when creating an address. + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code + properties: + first_name: + description: First name + type: string + example: Arno + last_name: + description: Last name + type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: + description: Address line 1 + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + type: string + example: Suite 369 + city: + description: City + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + description: Province + type: string + example: Kentucky + postal_code: + description: Postal Code + type: string + example: 72093 + metadata: + type: object + example: + car: white + description: An optional key-value map with additional details + AddressPayload: + type: object + description: Address fields used when creating/updating an address. + properties: + first_name: + description: First name + type: string + example: Arno + last_name: + description: Last name + type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: + description: Address line 1 + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + type: string + example: Suite 369 + city: + description: City + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + description: Province + type: string + example: Kentucky + postal_code: + description: Postal Code + type: string + example: 72093 + metadata: + type: object + example: + car: white + description: An optional key-value map with additional details + BatchJob: + title: Batch Job + description: A Batch Job. + type: object + required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status + - type + - updated_at + properties: + id: + description: The unique identifier for the batch job. + type: string + example: batch_01G8T782965PYFG0751G0Z38B4 + 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 + - confirmed + - processing + - completed + - canceled + - failed + default: created + created_by: + description: The unique identifier of the user that created the batch job. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + nullable: true + $ref: '#/components/schemas/User' + context: + description: The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + nullable: true + allOf: + - type: object + example: {} + - type: object + properties: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: + type: string + file_size: + type: number + example: + errors: + - err: [] + code: unknown + message: Method not implemented. + stat_descriptors: + - key: product-export-count + name: Product count to export + message: There will be 8 products exported by this action + pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true + type: string + format: date-time + processing_at: + description: The date the job is processing at. + nullable: true + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + nullable: true + type: string + format: date-time + completed_at: + description: The date of the completion. + nullable: true + type: string + format: date-time + canceled_at: + description: The date of the concellation. + nullable: true + type: string + format: date-time + failed_at: + description: The date when the job failed. + nullable: true + 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. + nullable: true + type: string + format: date-time + Cart: + title: Cart + description: Represents a user cart + type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at + properties: + id: + description: The cart's ID + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + email: + description: The email associated with the cart + nullable: true + type: string + format: email + billing_address_id: + description: The billing address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The shipping address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + discounts: + description: Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + customer_id: + description: The customer's ID + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + payment_session: + description: The selected payment session in the cart. + nullable: true + type: object + payment_sessions: + description: The payment sessions created on the cart. + type: array + items: + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + shipping_methods: + description: The shipping methods added to the cart. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + type: + description: The cart's type. + type: string + enum: + - default + - swap + - draft_order + - payment_link + - claim + default: default + completed_at: + description: The date with timezone at which the cart was completed. + nullable: true + type: string + format: date-time + payment_authorized_at: + description: The date with timezone at which the payment was authorized. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + context: + description: The context of the cart which can include info like IP or user agent. + nullable: true + type: object + example: + ip: '::1' + user_agent: PostmanRuntime/7.29.2 + sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + shipping_total: + description: The total of shipping + type: integer + example: 1000 + discount_total: + description: The total of discount rounded + type: integer + example: 800 + raw_discount_total: + description: The total of discount + type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order associated with this cart is returned. + type: integer + example: 0 + total: + description: The total amount of the cart + type: integer + example: 8200 + subtotal: + description: The subtotal of the cart + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + ClaimImage: + title: Claim Image + description: Represents photo documentation of a claim. + type: object + required: + - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + description: The claim image's ID + type: string + example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 + claim_item_id: + description: The ID of the claim item associated with the image + type: string + claim_item: + description: A claim item object. Available if the relation `claim_item` is expanded. + nullable: true + type: object + url: + description: The URL of the image + type: string + format: uri + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimItem: + title: Claim Item + description: Represents a claimed item along with information about the reasons for the claim. + type: object + required: + - claim_order_id + - created_at + - deleted_at + - id + - item_id + - metadata + - note + - quantity + - reason + - updated_at + - variant_id + properties: + id: + description: The claim item's ID + type: string + example: citm_01G8ZH853Y6TFXWPG5EYE81X63 + images: + description: Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimImage' + claim_order_id: + description: The ID of the claim this item is associated with. + type: string + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + item_id: + description: The ID of the line item that the claim item refers to. + type: string + example: item_01G8ZM25TN49YV9EQBE2NC27KC + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + variant_id: + description: The ID of the product variant that is claimed. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A variant object. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + reason: + description: The reason for the claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + note: + description: An optional note about the claim, for additional information + nullable: true + type: string + example: I don't like it. + quantity: + description: The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order. + type: integer + example: 1 + tags: + description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimTag' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimOrder: + title: Claim Order + description: Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. + type: object + required: + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at + properties: + id: + description: The claim's ID + type: string + example: claim_01G8ZH853Y6TFXWPG5EYE81X63 + type: + description: The claim's type + type: string + enum: + - refund + - replace + payment_status: + description: The status of the claim's payment + type: string + enum: + - na + - not_refunded + - refunded + default: na + fulfillment_status: + description: The claim's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + claim_items: + description: The items that have been claimed + type: array + items: + $ref: '#/components/schemas/ClaimItem' + 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/LineItem' + order_id: + description: The ID of the order that the claim comes from. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + return_order: + description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true + type: object + shipping_address_id: + description: The ID of the address that the new items should be shipped to + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The shipping methods that the claim order will be shipped with. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + fulfillments: + description: The fulfillments of the new items to be shipped + type: array + items: + type: object + refund_amount: + description: The amount that will be refunded in conjunction with the claim + nullable: true + type: integer + example: 1000 + canceled_at: + description: The date with timezone at which the claim was canceled. + nullable: true + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + ClaimTag: + title: Claim Tag + description: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The claim tag's ID + type: string + example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 + value: + description: The value that the claim tag holds + type: string + example: Damaged + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Country: + title: Country + description: Country details + type: object + required: + - display_name + - id + - iso_2 + - iso_3 + - name + - num_code + - region_id + properties: + id: + description: The country's ID + type: string + example: 109 + iso_2: + description: The 2 character ISO code of the country in lower case + type: string + example: it + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + iso_3: + description: The 2 character ISO code of the country in lower case + type: string + example: ita + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + description: See a list of codes. + num_code: + description: The numerical ISO code for the country. + type: string + example: 380 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + description: See a list of codes. + name: + description: The normalized country name in upper case. + type: string + example: ITALY + display_name: + description: The country name appropriate for display. + type: string + example: Italy + region_id: + description: The region ID this country is associated with. + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + CreateStockLocationInput: + title: Create Stock Location Input + description: Represents the Input to create a Stock Location + type: object + required: + - name + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + Currency: + title: Currency + description: Currency + type: object + required: + - code + - name + - symbol + - symbol_native + properties: + code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + symbol: + description: The symbol used to indicate the currency. + type: string + example: $ + symbol_native: + description: The native symbol used to indicate the currency. + type: string + example: $ + name: + description: The written name of the currency + type: string + example: US Dollar + includes_tax: + description: '[EXPERIMENTAL] Does the currency prices include tax' + type: boolean + default: false + CustomShippingOption: + title: Custom Shipping Option + description: Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option + type: object + required: + - cart_id + - created_at + - deleted_at + - id + - metadata + - price + - shipping_option_id + - updated_at + properties: + id: + description: The custom shipping option's ID + type: string + example: cso_01G8X99XNB77DMFBJFWX6DN9V9 + price: + description: The custom price set that will override the shipping option's original price + type: integer + example: 1000 + shipping_option_id: + description: The ID of the Shipping Option that the custom shipping option overrides + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: A shipping option object. Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + cart_id: + description: The ID of the Cart that the custom shipping option is attached to + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Customer: + title: Customer + description: Represents a customer + type: object + required: + - billing_address_id + - created_at + - deleted_at + - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at + properties: + id: + description: The customer's ID + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + email: + description: The customer's email + type: string + format: email + first_name: + description: The customer's first name + nullable: true + type: string + example: Arno + last_name: + description: The customer's last name + nullable: true + type: string + example: Willms + billing_address_id: + description: The customer's billing address ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_addresses: + description: Available if the relation `shipping_addresses` is expanded. + type: array + items: + $ref: '#/components/schemas/Address' + phone: + description: The customer's phone number + nullable: true + type: string + example: 16128234334802 + has_account: + description: Whether the customer has an account or not + type: boolean + default: false + orders: + description: Available if the relation `orders` is expanded. + type: array + items: + type: object + groups: + description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + CustomerGroup: + title: Customer Group + description: Represents a customer group + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - updated_at + properties: + id: + description: The customer group's ID + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + name: + description: The name of the customer group + type: string + example: VIP + customers: + description: The customers that belong to the customer group. Available if the relation `customers` is expanded. + type: array + items: + type: object + price_lists: + description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Discount: + title: Discount + description: Represents a discount that can be applied to a cart for promotional purposes. + type: object + required: + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration + properties: + id: + description: The discount's ID + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + code: + description: A unique code for the discount - this will be used by the customer to apply the discount + type: string + example: 10DISC + is_dynamic: + description: A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts + type: boolean + example: false + rule_id: + description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + rule: + description: Available if the relation `rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + is_disabled: + description: Whether the Discount has been disabled. Disabled discounts cannot be applied to carts + type: boolean + example: false + parent_discount_id: + description: The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string + example: disc_01G8ZH853YPY9B94857DY91YGW + parent_discount: + description: Available if the relation `parent_discount` is expanded. + nullable: true + type: object + starts_at: + description: The time at which the discount can be used. + type: string + format: date-time + ends_at: + description: The time at which the discount can no longer be used. + nullable: true + type: string + format: date-time + valid_duration: + description: Duration the discount runs between + nullable: true + type: string + example: P3Y6M4DT12H30M5S + regions: + description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. + type: array + items: + $ref: '#/components/schemas/Region' + usage_limit: + description: The maximum number of times that a discount can be used. + nullable: true + type: integer + example: 100 + usage_count: + description: The number of times a discount has been used. + type: integer + example: 50 + default: 0 + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountCondition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + type: object + required: + - created_at + - deleted_at + - discount_rule_id + - id + - metadata + - operator + - type + - updated_at + properties: + id: + description: The discount condition's ID + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + operator: + description: The operator of the Condition + type: string + enum: + - in + - not_in + discount_rule_id: + description: The ID of the discount rule associated with the condition + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + discount_rule: + description: Available if the relation `discount_rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + products: + description: products associated with this condition if type = products. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + product_tags: + description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + product_collections: + description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductCollection' + customer_groups: + description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionCustomerGroup: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + type: object + required: + - condition_id + - created_at + - customer_group_id + - metadata + - updated_at + properties: + customer_group_id: + description: The ID of the Product Tag + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + customer_group: + description: Available if the relation `customer_group` is expanded. + nullable: true + $ref: '#/components/schemas/CustomerGroup' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProduct: + title: Product Discount Condition + description: Associates a discount condition with a product + type: object + required: + - condition_id + - created_at + - metadata + - product_id + - updated_at + properties: + product_id: + description: The ID of the Product Tag + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductCollection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + type: object + required: + - condition_id + - created_at + - metadata + - product_collection_id + - updated_at + properties: + product_collection_id: + description: The ID of the Product Collection + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_collection: + description: Available if the relation `product_collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductTag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + type: object + required: + - condition_id + - created_at + - metadata + - product_tag_id + - updated_at + properties: + product_tag_id: + description: The ID of the Product Tag + type: string + example: ptag_01F0YESHPZYY3H4SJ3A5918SBN + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_tag: + description: Available if the relation `product_tag` is expanded. + nullable: true + $ref: '#/components/schemas/ProductTag' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductType: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + type: object + required: + - condition_id + - created_at + - metadata + - product_type_id + - updated_at + properties: + product_type_id: + description: The ID of the Product Tag + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountRule: + title: Discount Rule + description: Holds the rules that governs how a Discount is calculated when applied to a Cart. + type: object + required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata + - type + - updated_at + - value + properties: + id: + description: The discount rule's ID + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + type: + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + type: string + enum: + - fixed + - percentage + - free_shipping + example: percentage + description: + description: A short description of the discount + nullable: true + type: string + example: 10 Percent + value: + description: The value that the discount represents; this will depend on the type of the discount + type: integer + example: 10 + allocation: + description: The scope that the discount should apply to. + nullable: true + type: string + enum: + - total + - item + example: total + conditions: + description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DraftOrder: + title: DraftOrder + description: Represents a draft order + type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at + properties: + id: + description: The draft order's ID + type: string + example: dorder_01G8TJFKBG38YYFQ035MSVG03C + status: + description: The status of the draft order + type: string + enum: + - open + - completed + default: open + display_id: + description: The draft order's display ID + type: string + example: 2 + cart_id: + description: The ID of the cart associated with the draft order. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the order associated with the draft order. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + canceled_at: + description: The date the draft order was canceled at. + nullable: true + type: string + format: date-time + completed_at: + description: The date the draft order was completed at. + nullable: true + type: string + format: date-time + no_notification_order: + description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Error: + title: Response Error + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + message: + type: string + description: Description of the error that occurred. + type: + type: string + description: A slug indicating the type of the error. + ExtendedStoreDTO: + allOf: + - $ref: '#/components/schemas/Store' + - type: object + required: + - payment_providers + - fulfillment_providers + - feature_flags + - modules + properties: + payment_providers: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + $ref: '#/components/schemas/FulfillmentProvider' + feature_flags: + $ref: '#/components/schemas/FeatureFlagsResponse' + modules: + $ref: '#/components/schemas/ModulesResponse' + FeatureFlagsResponse: + type: array + items: + type: object + required: + - key + - value + properties: + key: + description: The key of the feature flag. + type: string + value: + description: The value of the feature flag. + type: boolean + Fulfillment: + title: Fulfillment + description: Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. + type: object + required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at + properties: + id: + description: The fulfillment's ID + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + claim_order_id: + description: The id of the Claim that the Fulfillment belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Fulfillment belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + order_id: + description: The id of the Order that the Fulfillment belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + provider_id: + description: The id of the Fulfillment Provider responsible for handling the fulfillment + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + items: + description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentItem' + tracking_links: + description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded. + type: array + items: + $ref: '#/components/schemas/TrackingLink' + tracking_numbers: + description: The tracking numbers that can be used to track the status of the fulfillment. + deprecated: true + type: array + items: + type: string + data: + description: This contains all the data necessary for the Fulfillment provider to handle the fulfillment. + type: object + example: {} + shipped_at: + description: The date with timezone at which the Fulfillment was shipped. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be sent. + nullable: true + type: boolean + example: false + canceled_at: + description: The date with timezone at which the Fulfillment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of the fulfillment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + FulfillmentItem: + title: Fulfillment Item + description: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. + type: object + required: + - fulfillment_id + - item_id + - quantity + properties: + fulfillment_id: + description: The id of the Fulfillment that the Fulfillment Item belongs to. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + item_id: + description: The id of the Line Item that the Fulfillment Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + fulfillment: + description: A fulfillment object. Available if the relation `fulfillment` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Fulfillment. + type: integer + example: 1 + FulfillmentProvider: + title: Fulfillment Provider + description: Represents a fulfillment provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the fulfillment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + GiftCard: + title: Gift Card + description: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. + type: object + required: + - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id + - region_id + - tax_rate + - updated_at + - value + properties: + id: + description: The gift card's ID + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + code: + description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card. + type: string + example: 3RFT-MH2C-Y4YZ-XMN4 + value: + description: The value that the Gift Card represents. + type: integer + example: 10 + balance: + description: The remaining value on the Gift Card. + type: integer + example: 10 + region_id: + description: The id of the Region in which the Gift Card is available. + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + order_id: + description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + is_disabled: + description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. + type: boolean + default: false + ends_at: + description: The time at which the Gift Card can no longer be used. + nullable: true + type: string + format: date-time + tax_rate: + description: The gift card's tax rate that will be applied on calculating totals + nullable: true + type: number + example: 0 + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + GiftCardTransaction: + title: Gift Card Transaction + description: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order + type: object + required: + - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate + properties: + id: + description: The gift card transaction's ID + type: string + example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A + gift_card_id: + description: The ID of the Gift Card that was used in the transaction. + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + gift_card: + description: A gift card object. Available if the relation `gift_card` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Gift Card was used to pay for. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that was used from the Gift Card. + type: integer + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + is_taxable: + description: Whether the transaction is taxable or not. + nullable: true + type: boolean + example: false + tax_rate: + description: The tax rate of the transaction + nullable: true + type: number + example: 0 + IdempotencyKey: + title: Idempotency Key + description: Idempotency Key is used to continue a process in case of any failure that might occur. + type: object + required: + - created_at + - id + - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path + properties: + id: + description: The idempotency key's ID + type: string + example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A + idempotency_key: + description: The unique randomly generated key used to determine the state of a process. + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: Date which the idempotency key was locked. + type: string + format: date-time + locked_at: + description: Date which the idempotency key was locked. + nullable: true + type: string + format: date-time + request_method: + description: The method of the request + nullable: true + type: string + example: POST + request_params: + description: The parameters passed to the request + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + request_path: + description: The request's path + nullable: true + type: string + example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete + response_code: + description: The response's code. + nullable: true + type: string + example: 200 + response_body: + description: The response's body + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + recovery_point: + description: Where to continue from. + type: string + default: started + Image: + title: Image + description: Images holds a reference to a URL at which the image file can be found. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + type: string + description: The image's ID + example: img_01G749BFYR6T8JTVW6SGW3K3E6 + url: + description: The URL at which the image file can be found. + type: string + format: uri + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + Invite: + title: Invite + description: Represents an invite + type: object + required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at + - user_email + properties: + id: + type: string + description: The invite's ID + example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 + user_email: + description: The email of the user being invited. + type: string + format: email + role: + description: The user's role. + nullable: true + type: string + enum: + - admin + - member + - developer + default: member + accepted: + description: Whether the invite was accepted or not. + type: boolean + default: false + token: + description: The token used to accept the invite. + type: string + expires_at: + description: The date the invite expires at. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItem: + title: Line Item + description: Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. + type: object + required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail + - title + - unit_price + - updated_at + - variant_id + properties: + id: + description: The line item's ID + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + cart_id: + description: The ID of the Cart that the Line Item belongs to. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Line Item belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Line Item belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Line Item belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemTaxLine' + adjustments: + description: Available if the relation `adjustments` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemAdjustment' + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: The order edit joined. Available if the relation `order_edit` is expanded. + nullable: true + type: object + title: + description: The title of the Line Item, this should be easily identifiable by the Customer. + type: string + example: Medusa Coffee Mug + description: + description: A more detailed description of the contents of the Line Item. + nullable: true + type: string + example: One Size + thumbnail: + description: A URL string to a small image of the contents of the Line Item. + nullable: true + type: string + format: uri + example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + is_return: + description: Is the item being returned + type: boolean + default: false + is_giftcard: + description: Flag to indicate if the Line Item is a Gift Card. + type: boolean + default: false + should_merge: + description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. + type: boolean + default: true + allow_discounts: + description: Flag to indicate if the Line Item should be included when doing discount calculations. + type: boolean + default: true + has_shipping: + description: Flag to indicate if the Line Item has fulfillment associated with it. + nullable: true + type: boolean + example: false + unit_price: + description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. + type: integer + example: 8000 + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + quantity: + description: The quantity of the content in the Line Item. + type: integer + example: 1 + fulfilled_quantity: + description: The quantity of the Line Item that has been fulfilled. + nullable: true + type: integer + example: 0 + returned_quantity: + description: The quantity of the Line Item that has been returned. + nullable: true + type: integer + example: 0 + shipped_quantity: + description: The quantity of the Line Item that has been shipped. + nullable: true + type: integer + example: 0 + refundable: + description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration. + type: integer + example: 0 + subtotal: + description: The subtotal of the line item + type: integer + example: 8000 + tax_total: + description: The total of tax of the line item + type: integer + example: 0 + total: + description: The total amount of the line item + type: integer + example: 8000 + original_total: + description: The original total amount of the line item + type: integer + example: 8000 + original_tax_total: + description: The original tax total amount of the line item + type: integer + example: 0 + discount_total: + description: The total of discount of the line item rounded + type: integer + example: 0 + raw_discount_total: + description: The total of discount of the line item + type: integer + example: 0 + gift_card_total: + description: The total of the gift card of the line item + type: integer + example: 0 + includes_tax: + description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemAdjustment: + title: Line Item Adjustment + description: Represents a Line Item Adjustment + type: object + required: + - amount + - description + - discount_id + - id + - item_id + - metadata + properties: + id: + description: The Line Item Adjustment's ID + type: string + example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + description: + description: The line item's adjustment description + type: string + example: Adjusted item's price. + discount_id: + description: The ID of the discount associated with the adjustment + nullable: true + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + discount: + description: Available if the relation `discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + amount: + description: The adjustment amount + type: number + example: 1000 + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemTaxLine: + title: Line Item Tax Line + description: Represents a Line Item Tax Line + type: object + required: + - code + - created_at + - id + - item_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ModulesResponse: + type: array + items: + type: object + required: + - module + - resolution + properties: + module: + description: The key of the module. + type: string + resolution: + description: The resolution path of the module or false if module is not installed. + type: string + MoneyAmount: + title: Money Amount + description: Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. + type: object + required: + - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id + properties: + id: + description: The money amount's ID + type: string + example: ma_01F0YESHRFQNH5S8Q0PK84YYZN + currency_code: + description: The 3 character currency code that the Money Amount is given in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount: + description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. + type: integer + example: 100 + 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. + nullable: true + type: integer + example: 1 + 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. + nullable: true + type: integer + example: 1 + price_list_id: + description: The ID of the price list associated with the money amount + nullable: true + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + price_list: + description: Available if the relation `price_list` is expanded. + nullable: true + type: object + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + type: object + region_id: + description: The region's ID + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + MultipleErrors: + title: Multiple Errors + type: object + properties: + errors: + type: array + description: Array of errors + items: + $ref: '#/components/schemas/Error' + message: + type: string + default: Provided request body contains errors. Please check the data and retry the request + Note: + title: Note + description: Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. + type: object + required: + - author_id + - created_at + - deleted_at + - id + - metadata + - resource_id + - resource_type + - updated_at + - value + properties: + id: + description: The note's ID + type: string + example: note_01G8TM8ENBMC7R90XRR1G6H26Q + resource_type: + description: The type of resource that the Note refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Note refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + value: + description: The contents of the note. + type: string + example: This order must be fulfilled on Monday + author_id: + description: The ID of the author (user) + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + author: + description: Available if the relation `author` is expanded. + nullable: true + $ref: '#/components/schemas/User' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Notification: + title: Notification + description: Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. + type: object + required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id + - resource_type + - resource_id + - to + - updated_at + properties: + id: + description: The notification's ID + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + event_name: + description: The name of the event that the notification was sent for. + nullable: true + type: string + example: order.placed + resource_type: + description: The type of resource that the Notification refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Notification refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + customer_id: + description: The ID of the Customer that the Notification was sent to. + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + to: + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id + type: string + example: user@example.com + data: + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. + type: object + example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + type: object + resends: + description: The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. + type: array + items: + type: object + provider_id: + description: The id of the Notification Provider that handles the Notification. + nullable: true + type: string + example: sengrid + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/NotificationProvider' + 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 updated. + type: string + format: date-time + NotificationProvider: + title: Notification Provider + description: Represents a notification provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the notification provider as given by the plugin. + type: string + example: sendgrid + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + OAuth: + title: OAuth + description: Represent an OAuth app + type: object + required: + - application_name + - data + - display_name + - id + - install_url + - uninstall_url + properties: + id: + description: The app's ID + type: string + example: example_app + display_name: + description: The app's display name + type: string + example: Example app + application_name: + description: The app's name + type: string + example: example + install_url: + description: The URL to install the app + nullable: true + type: string + format: uri + uninstall_url: + description: The URL to uninstall the app + nullable: true + type: string + format: uri + data: + description: Any data necessary to the app. + nullable: true + type: object + example: {} + Order: + title: Order + description: Represents an order + type: object + required: + - billing_address_id + - canceled_at + - cart_id + - created_at + - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at + properties: + id: + description: The order's ID + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + status: + description: The order's status + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + default: pending + fulfillment_status: + description: The order's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + payment_status: + description: The order's payment status + type: string + enum: + - not_paid + - awaiting + - captured + - partially_refunded + - refunded + - canceled + - requires_action + default: not_paid + display_id: + description: The order's display ID + type: integer + example: 2 + cart_id: + description: The ID of the cart associated with the order + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + customer_id: + description: The ID of the customer associated with the order + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + email: + description: The email associated with the order + type: string + format: email + billing_address_id: + description: The ID of the billing address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The ID of the shipping address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character currency code that is used in the order + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The order's tax rate + nullable: true + type: number + example: 0 + discounts: + description: The discounts used in the order. Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + shipping_methods: + description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + payments: + description: The payments used in the order. Available if the relation `payments` is expanded. + type: array + items: + type: object + fulfillments: + description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + returns: + description: The returns associated with the order. Available if the relation `returns` is expanded. + type: array + items: + type: object + claims: + description: The claims associated with the order. Available if the relation `claims` is expanded. + type: array + items: + type: object + refunds: + description: The refunds associated with the order. Available if the relation `refunds` is expanded. + type: array + items: + type: object + swaps: + description: The swaps associated with the order. Available if the relation `swaps` is expanded. + type: array + items: + type: object + draft_order_id: + description: The ID of the draft order this order is associated with. + nullable: true + type: string + example: null + draft_order: + description: A draft order object. Available if the relation `draft_order` is expanded. + nullable: true + type: object + items: + description: The line items that belong to the order. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + edits: + description: Order edits done on the order. Available if the relation `edits` is expanded. + type: array + items: + type: object + gift_card_transactions: + description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCardTransaction' + canceled_at: + description: The date the order was canceled on. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the processing of the order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + external_id: + description: The ID of an external order. + nullable: true + type: string + example: null + sales_channel_id: + description: The ID of the sales channel this order is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + shipping_total: + type: integer + description: The total of shipping + example: 1000 + raw_discount_total: + description: The total of discount + type: integer + example: 800 + discount_total: + description: The total of discount rounded + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order is returned. + type: integer + example: 0 + total: + description: The total amount of the order + type: integer + example: 8200 + subtotal: + description: The subtotal of the order + type: integer + example: 8000 + paid_total: + description: The total amount paid + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + returnable_items: + description: The items that are returnable as part of the order, order swaps or order claims + type: array + items: + $ref: '#/components/schemas/LineItem' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + OrderEdit: + title: Order Edit + description: Order edit keeps track of order items changes. + type: object + required: + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at + - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at + properties: + id: + description: The order edit's ID + type: string + example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK + order_id: + description: The ID of the order that is edited + type: string + example: order_01G2SG30J8C85S4A5CHM2S1NS2 + order: + description: Available if the relation `order` is expanded. + nullable: true + type: object + changes: + description: Available if the relation `changes` is expanded. + type: array + items: + $ref: '#/components/schemas/OrderItemChange' + internal_note: + description: An optional note with additional details about the order edit. + nullable: true + type: string + example: Included two more items B to the order. + created_by: + description: The unique identifier of the user or customer who created the order edit. + type: string + requested_by: + description: The unique identifier of the user or customer who requested the order edit. + nullable: true + type: string + requested_at: + description: The date with timezone at which the edit was requested. + nullable: true + type: string + format: date-time + confirmed_by: + description: The unique identifier of the user or customer who confirmed the order edit. + nullable: true + type: string + confirmed_at: + description: The date with timezone at which the edit was confirmed. + nullable: true + type: string + format: date-time + declined_by: + description: The unique identifier of the user or customer who declined the order edit. + nullable: true + type: string + declined_at: + description: The date with timezone at which the edit was declined. + nullable: true + type: string + format: date-time + declined_reason: + description: An optional note why the order edit is declined. + nullable: true + type: string + canceled_by: + description: The unique identifier of the user or customer who cancelled the order edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time + subtotal: + description: The total of subtotal + type: integer + example: 8000 + discount_total: + description: The total of discount + type: integer + example: 800 + shipping_total: + description: The total of the shipping amount + type: integer + example: 800 + gift_card_total: + description: The total of the gift card amount + type: integer + example: 800 + gift_card_tax_total: + description: The total of the gift card tax amount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + total: + description: The total amount of the edited order. + type: integer + example: 8200 + difference_due: + description: The difference between the total amount of the order and total amount of edited order. + type: integer + example: 8200 + status: + description: The status of the order edit. + type: string + enum: + - confirmed + - declined + - requested + - created + - canceled + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + payment_collection_id: + description: The ID of the payment collection + nullable: true + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + nullable: true + $ref: '#/components/schemas/PaymentCollection' + 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 updated. + type: string + format: date-time + OrderItemChange: + title: Order Item Change + description: Represents an order edit item change + type: object + required: + - created_at + - deleted_at + - id + - line_item_id + - order_edit_id + - original_line_item_id + - type + - updated_at + properties: + id: + description: The order item change's ID + type: string + example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The order item change's status + type: string + enum: + - item_add + - item_remove + - item_update + order_edit_id: + description: The ID of the order edit + type: string + example: oe_01G2SG30J8C85S4A5CHM2S1NS2 + order_edit: + description: Available if the relation `order_edit` is expanded. + nullable: true + type: object + original_line_item_id: + description: The ID of the original line item in the order + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + original_line_item: + description: Available if the relation `original_line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + line_item_id: + description: The ID of the cloned line item. + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + line_item: + description: Available if the relation `line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Payment: + title: Payment + description: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. + type: object + required: + - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at + - currency_code + - data + - id + - idempotency_key + - metadata + - order_id + - provider_id + - swap_id + - updated_at + properties: + id: + description: The payment's ID + type: string + example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE + swap_id: + description: The ID of the Swap that the Payment is used for. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Payment is used for. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that the Payment has been authorized for. + type: integer + example: 100 + currency_code: + description: The 3 character ISO currency code that the Payment is completed in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount_refunded: + description: The amount of the original Payment amount that has been refunded back to the Customer. + type: integer + default: 0 + example: 0 + provider_id: + description: The id of the Payment Provider that is responsible for the Payment + type: string + example: manual + data: + description: The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + captured_at: + description: The date with timezone at which the Payment was captured. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Payment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a payment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentCollection: + title: Payment Collection + description: Payment Collection + type: object + required: + - amount + - authorized_amount + - created_at + - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at + properties: + id: + description: The payment collection's ID + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The type of the payment collection + type: string + enum: + - order_edit + status: + description: The type of the payment collection + type: string + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - canceled + description: + description: Description of the payment collection + nullable: true + type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + payment_sessions: + description: Available if the relation `payment_sessions` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payments: + description: Available if the relation `payments` is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + created_by: + description: The ID of the user that created the payment collection. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentProvider: + title: Payment Provider + description: Represents a Payment Provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the payment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + PaymentSession: + title: Payment Session + description: Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. + type: object + required: + - amount + - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at + - provider_id + - status + - updated_at + properties: + id: + description: The payment session's ID + type: string + example: ps_01G901XNSRM2YS3ASN9H5KG3FZ + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + provider_id: + description: The id of the Payment Provider that is responsible for the Payment Session + type: string + example: manual + is_selected: + description: A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. + nullable: true + type: boolean + example: true + is_initiated: + description: A flag to indicate if a communication with the third party provider has been initiated. + type: boolean + default: false + example: true + status: + description: Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer. + type: string + enum: + - authorized + - pending + - requires_more + - error + - canceled + example: pending + data: + description: The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true + 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 updated. + type: string + format: date-time + PriceList: + title: Price List + description: Price Lists represents a set of prices that overrides the default price for one or more product variants. + type: object + required: + - created_at + - deleted_at + - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at + properties: + id: + description: The price list's ID + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + name: + description: The price list's name + type: string + example: VIP Prices + description: + description: The price list's description + type: string + example: Prices for VIP customers + type: + description: The type of Price List. This can be one of either `sale` or `override`. + type: string + enum: + - sale + - override + default: sale + status: + description: The status of the Price List + type: string + enum: + - active + - draft + default: draft + starts_at: + description: The date with timezone that the Price List starts being valid. + nullable: true + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + nullable: true + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + prices: + description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + includes_tax: + description: '[EXPERIMENTAL] Does the price list prices include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + PricedProduct: + title: Priced Product + type: object + allOf: + - $ref: '#/components/schemas/Product' + - type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + PricedShippingOption: + title: Priced Shipping Option + type: object + allOf: + - $ref: '#/components/schemas/ShippingOption' + - type: object + properties: + price_incl_tax: + type: number + description: Price including taxes + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + tax_amount: + type: number + description: The taxes applied. + PricedVariant: + title: Priced Product Variant + type: object + allOf: + - $ref: '#/components/schemas/ProductVariant' + - type: object + properties: + original_price: + type: number + description: The original price of the variant without any discounted prices applied. + calculated_price: + type: number + description: The calculated price of the variant. Can be a discounted price. + original_price_incl_tax: + type: number + description: The original price of the variant including taxes. + calculated_price_incl_tax: + type: number + description: The calculated price of the variant including taxes. + original_tax: + type: number + description: The taxes applied on the original price. + calculated_tax: + type: number + description: The taxes applied on the calculated price. + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + Product: + title: Product + description: Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. + type: object + required: + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country + - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width + properties: + id: + description: The product's ID + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + title: + description: A title that can be displayed for easy identification of the Product. + type: string + example: Medusa Coffee Mug + subtitle: + description: An optional subtitle that can be used to further specify the Product. + nullable: true + type: string + description: + description: A short description of the Product. + nullable: true + type: string + example: Every programmer's best friend. + handle: + description: A unique identifier for the Product (e.g. for slug structure). + nullable: true + type: string + example: coffee-mug + is_giftcard: + description: Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. + type: boolean + default: false + status: + description: The status of the product + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + images: + description: Images of the Product. Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/Image' + thumbnail: + description: A URL to an image file that can be used to identify the Product. + nullable: true + type: string + format: uri + options: + description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOption' + variants: + description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariant' + categories: + description: The product's associated categories. Available if the relation `categories` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + profile_id: + description: The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + collection_id: + description: The Product Collection that the Product belongs to + nullable: true + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + collection: + description: A product collection object. Available if the relation `collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + type_id: + description: The Product type that the Product belongs to + nullable: true + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: Available if the relation `type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + tags: + description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + discountable: + description: Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. + type: boolean + default: true + external_id: + description: The external ID of the product + nullable: true + type: string + example: null + sales_channels: + description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannel' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductCategory: + title: ProductCategory + description: Represents a product category + x-resourceId: ProductCategory + type: object + required: + - category_children + - created_at + - handle + - id + - is_active + - is_internal + - mpath + - name + - parent_category_id + - updated_at + properties: + id: + description: The product category's ID + type: string + example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 + name: + description: The product category's name + type: string + example: Regular Fit + handle: + description: A unique string that identifies the Product Category - can for example be used in slug structures. + type: string + example: regular-fit + mpath: + description: A string for Materialized Paths - used for finding ancestors and descendents + nullable: true + type: string + example: pcat_id1.pcat_id2.pcat_id3 + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + default: false + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + default: false + rank: + type: integer + description: An integer that depicts the rank of category in a tree node + default: 0 + category_children: + description: Available if the relation `category_children` are expanded. + type: array + items: + type: object + parent_category_id: + description: The ID of the parent category. + nullable: true + type: string + default: null + parent_category: + description: A product category object. Available if the relation `parent_category` is expanded. + nullable: true + type: object + products: + description: Products associated with category. Available if the relation `products` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + ProductCollection: + title: Product Collection + description: Product Collections represents a group of Products that are related. + type: object + required: + - created_at + - deleted_at + - handle + - id + - metadata + - title + - updated_at + properties: + id: + description: The product collection's ID + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + title: + description: The title that the Product Collection is identified by. + type: string + example: Summer Collection + handle: + description: A unique string that identifies the Product Collection - can for example be used in slug structures. + nullable: true + type: string + example: summer-collection + products: + description: The Products contained in the Product Collection. Available if the relation `products` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOption: + title: Product Option + description: Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - product_id + - title + - updated_at + properties: + id: + description: The product option's ID + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + title: + description: The title that the Product Option is defined by (e.g. `Size`). + type: string + example: Size + values: + description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + product_id: + description: The ID of the Product that the Product Option is defined for. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOptionValue: + title: Product Option Value + description: A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - option_id + - updated_at + - value + - variant_id + properties: + id: + description: The product option value's ID + type: string + example: optval_01F0YESHR7S6ECD03RF6W12DSJ + value: + description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`). + type: string + example: large + option_id: + description: The ID of the Product Option that the Product Option Value is defined for. + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + option: + description: Available if the relation `option` is expanded. + nullable: true + type: object + variant_id: + description: The ID of the Product Variant that the Product Option Value is defined for. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: Available if the relation `variant` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTag: + title: Product Tag + description: Product Tags can be added to Products for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product tag's ID + type: string + example: ptag_01G8K2MTMG9168F2B70S1TAVK3 + value: + description: The value that the Product Tag represents + type: string + example: Pants + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTaxRate: + title: Product Tax Rate + description: Associates a tax rate with a product to indicate that the product is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_id + - rate_id + - updated_at + properties: + product_id: + description: The ID of the Product + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductType: + title: Product Type + description: Product Type can be added to Products for filtering and reporting purposes. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product type's ID + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + value: + description: The value that the Product Type represents. + type: string + example: Clothing + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTypeTaxRate: + title: Product Type Tax Rate + description: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_type_id + - rate_id + - updated_at + properties: + product_type_id: + description: The ID of the Product type + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + rate_id: + description: The id of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariant: + title: Product Variant + description: Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. + type: object + required: + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id + - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width + properties: + id: + description: The product variant's ID + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + title: + description: A title that can be displayed for easy identification of the Product Variant. + type: string + example: Small + product_id: + description: The ID of the Product that the Product Variant belongs to. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + prices: + description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + sku: + description: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. + nullable: true + type: string + example: shirt-123 + barcode: + description: A generic field for a GTIN number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + ean: + description: An EAN barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + upc: + description: A UPC barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + variant_rank: + description: The ranking of this variant + nullable: true + type: number + default: 0 + inventory_quantity: + description: The current quantity of the item that is stocked. + type: integer + example: 100 + allow_backorder: + description: Whether the Product Variant should be purchasable when `inventory_quantity` is 0. + type: boolean + default: false + manage_inventory: + description: Whether Medusa should manage inventory for the Product Variant. + type: boolean + default: true + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + options: + description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + inventory_items: + description: The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariantInventoryItem' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariantInventoryItem: + title: Product Variant Inventory Item + description: Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. + type: object + required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id + properties: + id: + description: The product variant inventory item's ID + type: string + example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A + inventory_item_id: + description: The id of the inventory item + type: string + variant_id: + description: The id of the variant. + type: string + variant: + description: A ProductVariant object. Available if the relation `variant` is expanded. + nullable: true + type: object + required_quantity: + description: The quantity of an inventory item required for one quantity of the variant. + type: integer + default: 1 + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + PublishableApiKey: + title: Publishable API key + description: Publishable API key defines scopes (i.e. resources) that are available within a request. + type: object + required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at + properties: + id: + description: The key's ID + type: string + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + description: The unique identifier of the user that created the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by: + description: The unique identifier of the user that revoked the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: + description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + 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 updated. + type: string + format: date-time + PublishableApiKeySalesChannel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + type: object + required: + - publishable_key_id + - sales_channel_id + properties: + sales_channel_id: + description: The sales channel's ID + type: string + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + description: The publishable API key's ID + type: string + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + Refund: + title: Refund + description: Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. + type: object + required: + - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at + properties: + id: + description: The refund's ID + type: string + example: ref_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Refund is related to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + amount: + description: The amount that has be refunded to the Customer. + type: integer + example: 1000 + note: + description: An optional note explaining why the amount was refunded. + nullable: true + type: string + example: I didn't like it + reason: + description: The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return. + type: string + enum: + - discount + - return + - swap + - claim + - other + example: return + idempotency_key: + description: Randomly generated key used to continue the completion of the refund in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Region: + title: Region + description: Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. + type: object + required: + - automatic_taxes + - created_at + - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id + - tax_rate + - updated_at + properties: + id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + name: + description: The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name. + type: string + example: EU + currency_code: + description: The 3 character currency code that the Region uses. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The tax rate that should be charged on purchases in the Region. + type: number + example: 0 + tax_rates: + description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. + type: array + items: + $ref: '#/components/schemas/TaxRate' + tax_code: + description: The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. + nullable: true + type: string + example: null + gift_cards_taxable: + description: Whether the gift cards are taxable or not in this region. + type: boolean + default: true + automatic_taxes: + description: Whether taxes should be automated in this region. + type: boolean + default: true + countries: + description: The countries that are included in the Region. Available if the relation `countries` is expanded. + type: array + items: + $ref: '#/components/schemas/Country' + tax_provider_id: + description: The ID of the tax provider used in this region + nullable: true + type: string + example: null + tax_provider: + description: Available if the relation `tax_provider` is expanded. + nullable: true + $ref: '#/components/schemas/TaxProvider' + payment_providers: + description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentProvider' + includes_tax: + description: '[EXPERIMENTAL] Does the prices for the region include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReservationItemDTO: + title: Reservation item + description: Represents a reservation of an inventory item at a stock location + type: object + required: + - id + - location_id + - inventory_item_id + - quantity + properties: + id: + description: The id of the reservation item + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + Return: + title: Return + description: Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. + type: object + required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at + - refund_amount + - shipping_data + - status + - swap_id + - updated_at + properties: + id: + description: The return's ID + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + status: + description: Status of the Return. + type: string + enum: + - requested + - received + - requires_action + - canceled + default: requested + items: + description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/ReturnItem' + swap_id: + description: The ID of the Swap that the Return is a part of. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The ID of the Claim that the Return is a part of. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + shipping_method: + description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + shipping_data: + description: Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. + nullable: true + type: object + example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + refund_amount: + description: The amount that should be refunded as a result of the return. + type: integer + example: 1000 + no_notification: + description: When set to true, no notification will be sent related to this return. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the return in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + received_at: + description: The date with timezone at which the return was received. + nullable: true + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnItem: + title: Return Item + description: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. + type: object + required: + - is_requested + - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id + properties: + return_id: + description: The id of the Return that the Return Item belongs to. + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + item_id: + description: The id of the Line Item that the Return Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Return. + type: integer + example: 1 + is_requested: + description: Whether the Return Item was requested initially or received unexpectedly in the warehouse. + type: boolean + default: true + requested_quantity: + description: The quantity that was originally requested to be returned. + nullable: true + type: integer + example: 1 + received_quantity: + description: The quantity that was received in the warehouse. + nullable: true + type: integer + example: 1 + reason_id: + description: The ID of the reason for returning the item. + nullable: true + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + reason: + description: Available if the relation `reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + note: + description: An optional note with additional details about the Return. + nullable: true + type: string + example: I didn't like it. + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnReason: + title: Return Reason + description: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. + type: object + required: + - created_at + - deleted_at + - description + - id + - label + - metadata + - parent_return_reason_id + - updated_at + - value + properties: + id: + description: The return reason's ID + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + value: + description: The value to identify the reason by. + type: string + example: damaged + label: + description: A text that can be displayed to the Customer as a reason. + type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: + description: The ID of the parent reason. + nullable: true + type: string + example: null + parent_return_reason: + description: Available if the relation `parent_return_reason` is expanded. + nullable: true + type: object + return_reason_children: + description: Available if the relation `return_reason_children` is expanded. + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + SalesChannel: + title: Sales Channel + description: A Sales Channel + type: object + required: + - created_at + - deleted_at + - description + - id + - is_disabled + - name + - updated_at + properties: + id: + description: The sales channel's ID + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + name: + description: The name of the sales channel. + type: string + example: Market + description: + description: The description of the sales channel. + nullable: true + type: string + example: Multi-vendor market + is_disabled: + description: Specify if the sales channel is enabled or disabled. + type: boolean + default: false + locations: + description: The Stock Locations related to the sales channel. Available if the relation `locations` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannelLocation' + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + SalesChannelLocation: + title: Sales Channel Stock Location + description: Sales Channel Stock Location link sales channels with stock locations. + type: object + required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at + properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingMethod: + title: Shipping Method + description: Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. + type: object + required: + - cart_id + - claim_order_id + - data + - id + - order_id + - price + - return_id + - shipping_option_id + - swap_id + properties: + id: + description: The shipping method's ID + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_option_id: + description: The id of the Shipping Option that the Shipping Method is built from. + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Shipping Method is used on. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Shipping Method is used on. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: A return object. Available if the relation `return_order` is expanded. + nullable: true + type: object + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethodTaxLine' + price: + description: The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of. + type: integer + example: 200 + data: + description: Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' + type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 + ShippingMethodTaxLine: + title: Shipping Method Tax Line + description: Shipping Method Tax Line + type: object + required: + - code + - created_at + - id + - shipping_method_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + shipping_method_id: + description: The ID of the line item + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + type: object + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingOption: + title: Shipping Option + description: Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. + type: object + required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata + - name + - price_type + - profile_id + - provider_id + - region_id + - updated_at + properties: + id: + description: The shipping option's ID + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + name: + description: The name given to the Shipping Option - this may be displayed to the Customer. + type: string + example: PostFake Standard + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + profile_id: + description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + provider_id: + description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + price_type: + description: The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations. + type: string + enum: + - flat_rate + - calculated + example: flat_rate + amount: + description: The amount to charge for shipping when the Shipping Option price type is `flat_rate`. + nullable: true + type: integer + example: 200 + is_return: + description: Flag to indicate if the Shipping Option can be used for Return shipments. + type: boolean + default: false + admin_only: + description: Flag to indicate if the Shipping Option usage is restricted to admin users. + type: boolean + default: false + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOptionRequirement' + data: + description: The data needed for the Fulfillment Provider to identify the Shipping Option. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Does the shipping option price include tax' + type: boolean + default: false + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingOptionRequirement: + title: Shipping Option Requirement + description: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. + type: object + required: + - amount + - deleted_at + - id + - shipping_option_id + - type + properties: + id: + description: The shipping option requirement's ID + type: string + example: sor_01G1G5V29AB4CTNDRFSRWSRKWD + shipping_option_id: + description: The id of the Shipping Option that the hipping option requirement belongs to + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + type: object + type: + description: The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available. + type: string + enum: + - min_subtotal + - max_subtotal + example: min_subtotal + amount: + description: The amount to compare the Cart subtotal to. + type: integer + example: 100 + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingProfile: + title: Shipping Profile + description: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - type + - updated_at + properties: + id: + description: The shipping profile's ID + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + name: + description: The name given to the Shipping profile - this may be displayed to the Customer. + type: string + example: Default Shipping Profile + type: + description: The type of the Shipping Profile, may be `default`, `gift_card` or `custom`. + type: string + enum: + - default + - gift_card + - custom + example: default + products: + description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. + type: array + items: + type: object + shipping_options: + description: The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded. + type: array + items: + type: object + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingTaxRate: + title: Shipping Tax Rate + description: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way + type: object + required: + - created_at + - metadata + - rate_id + - shipping_option_id + - updated_at + properties: + shipping_option_id: + description: The ID of the Shipping Option + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StagedJob: + title: Staged Job + description: A staged job resource + type: object + required: + - data + - event_name + - id + - options + properties: + id: + description: The staged job's ID + type: string + example: job_01F0YET7BZTARY9MKN1SJ7AAXF + event_name: + description: The name of the event + type: string + example: order.placed + data: + description: Data necessary for the job + type: object + example: {} + option: + description: The staged job's option + type: object + example: {} + StockLocationAddressDTO: + title: Stock Location Address + description: Represents a Stock Location Address + type: object + required: + - address_1 + - country_code + - created_at + - updated_at + properties: + id: + type: string + description: The stock location address' ID + example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42 + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationAddressInput: + title: Stock Location Address Input + description: Represents a Stock Location Address Input + type: object + required: + - address_1 + - country_code + properties: + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationDTO: + title: Stock Location + description: Represents a Stock Location + type: object + required: + - id + - name + - address_id + - created_at + - updated_at + properties: + id: + type: string + description: The stock location's ID + example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42 + address_id: + type: string + description: Stock location address' ID + example: laddr_05B2ZE853Y6FTXWPW85NJ81A44 + name: + type: string + description: The name of the stock location + example: Main Warehouse + address: + description: The Address of the Stock Location + allOf: + - $ref: '#/components/schemas/StockLocationAddressDTO' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + StockLocationExpandedDTO: + allOf: + - $ref: '#/components/schemas/StockLocationDTO' + - type: object + properties: + sales_channels: + $ref: '#/components/schemas/SalesChannel' + Store: + title: Store + description: Holds settings for the Store, such as name, currencies, etc. + type: object + required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at + properties: + id: + description: The store's ID + type: string + example: store_01G1G5V21KADXNGH29BJMAJ4B4 + name: + description: The name of the Store - this may be displayed to the Customer. + type: string + example: Medusa Store + default_currency_code: + description: The 3 character currency code that is the default of the store. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + default_currency: + description: Available if the relation `default_currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + currencies: + description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. + type: array + items: + $ref: '#/components/schemas/Currency' + swap_link_template: + description: A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. + nullable: true + type: string + example: null + payment_link_template: + description: A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. + nullable: true + type: string + example: null + invite_link_template: + description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true + type: string + example: null + default_sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + default_sales_channel: + description: A sales channel object. Available if the relation `default_sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StoreAuthRes: + type: object + x-expanded-relations: + field: customer + relations: + - orders + - orders.items + - shipping_addresses + required: + - customer + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreCartShippingOptionsListRes: + type: object + x-expanded-relations: + field: shipping_options + implicit: + - profile + - requirements + required: + - shipping_options + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/PricedShippingOption' + StoreCartsRes: + type: object + x-expanded-relations: + field: cart + relations: + - billing_address + - discounts + - discounts.rule + - gift_cards + - items + - items.adjustments + - items.variant + - payment + - payment_sessions + - region + - region.countries + - region.payment_providers + - shipping_address + - shipping_methods + eager: + - region.fulfillment_providers + - region.payment_providers + - shipping_methods.shipping_option + implicit: + - items + - items.variant + - items.variant.product + - items.tax_lines + - items.adjustments + - gift_cards + - discounts + - discounts.rule + - shipping_methods + - shipping_methods.tax_lines + - shipping_address + - region + - region.tax_rates + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - item_tax_total + - refundable_amount + - refunded_total + - shipping_tax_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + required: + - cart + properties: + cart: + $ref: '#/components/schemas/Cart' + StoreCollectionsListRes: + type: object + required: + - collections + - count + - offset + - limit + properties: + collections: + type: array + items: + $ref: '#/components/schemas/ProductCollection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreCollectionsRes: + type: object + required: + - collection + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + StoreCompleteCartRes: + type: object + required: + - type + - data + properties: + type: + type: string + description: The type of the data property. + enum: + - order + - cart + - swap + data: + type: object + description: The data of the result object. Its type depends on the type field. + oneOf: + - type: object + allOf: + - description: Cart was successfully authorized and order was placed successfully. + - $ref: '#/components/schemas/Order' + - type: object + allOf: + - description: Cart was successfully authorized but requires further actions. + - $ref: '#/components/schemas/Cart' + - type: object + allOf: + - description: When cart is used for a swap and it has been completed successfully. + - $ref: '#/components/schemas/Swap' + StoreCustomersListOrdersRes: + type: object + x-expanded-relations: + field: orders + relations: + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.tracking_links + - items + - items.variant + - payments + - region + - shipping_address + - shipping_methods + eager: + - region.fulfillment_providers + - region.payment_providers + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - customer + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_address + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total + required: + - orders + - count + - offset + - limit + properties: + orders: + type: array + items: + $ref: '#/components/schemas/Order' + count: + description: The total number of items available + type: integer + offset: + description: The number of items skipped before these items + type: integer + limit: + description: The number of items per page + type: integer + StoreCustomersListPaymentMethodsRes: + type: object + required: + - payment_methods + properties: + payment_methods: + type: array + items: + type: object + required: + - provider_id + - data + properties: + provider_id: + description: The id of the Payment Provider where the payment method is saved. + type: string + data: + description: The data needed for the Payment Provider to use the saved payment method. + type: object + StoreCustomersRes: + type: object + x-expanded-relations: + field: customer + relations: + - billing_address + - shipping_addresses + required: + - customer + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreCustomersResetPasswordRes: + type: object + required: + - customer + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreGetAuthEmailRes: + type: object + required: + - exists + properties: + exists: + description: Whether email exists or not. + type: boolean + StoreGetProductCategoriesCategoryRes: + type: object + x-expanded-relations: + field: product_category + relations: + - category_children + - parent_category + required: + - product_category + properties: + product_category: + $ref: '#/components/schemas/ProductCategory' + StoreGetProductCategoriesRes: + type: object + x-expanded-relations: + field: product_categories + relations: + - category_children + - parent_category + required: + - product_categories + - count + - offset + - limit + properties: + product_categories: + type: array + items: + $ref: '#/components/schemas/ProductCategory' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreGiftCardsRes: + type: object + required: + - gift_card + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + StoreOrderEditsRes: + type: object + x-expanded-relations: + field: order_edit + relations: + - changes + - changes.line_item + - changes.line_item.variant + - changes.original_line_item + - changes.original_line_item.variant + - items + - items.adjustments + - items.tax_lines + - items.variant + - payment_collection + implicit: + - items + - items.tax_lines + - items.adjustments + - items.variant + totals: + - difference_due + - discount_total + - gift_card_tax_total + - gift_card_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + required: + - order_edit + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + StoreOrdersRes: + type: object + required: + - order + x-expanded-relations: + field: order + relations: + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.tracking_links + - items + - items.variant + - payments + - region + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - region.fulfillment_providers + - region.payment_providers + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total + properties: + order: + $ref: '#/components/schemas/Order' + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + StorePaymentCollectionsRes: + type: object + x-expanded-relations: + field: payment_collection + relations: + - payment_sessions + - region + eager: + - region.fulfillment_providers + - region.payment_providers + required: + - payment_collection + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + StorePaymentCollectionsSessionRes: + type: object + required: + - payment_session + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + StorePostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + StorePostCartReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: An optional array of `variant_id`, `quantity` pairs to generate Line Items from. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCartsCartLineItemsItemReq: + type: object + required: + - quantity + properties: + quantity: + type: number + description: The quantity to set the Line Item to. + StorePostCartsCartLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: The id of the Product Variant to generate the Line Item from. + quantity: + type: number + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: An optional key-value map with additional details about the Line Item. + StorePostCartsCartPaymentSessionReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + StorePostCartsCartPaymentSessionUpdateReq: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + StorePostCartsCartReq: + type: object + properties: + region_id: + type: string + description: The id of the Region to create the Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Cart. + format: email + sales_channel_id: + type: string + description: The ID of the Sales channel to update the Cart with. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + type: object + 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: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCartsCartShippingMethodReq: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StorePostCustomersCustomerAddressesAddressReq: + anyOf: + - $ref: '#/components/schemas/AddressPayload' + StorePostCustomersCustomerAddressesReq: + type: object + required: + - address + properties: + address: + description: The Address to add to the Customer. + $ref: '#/components/schemas/AddressCreatePayload' + StorePostCustomersCustomerOrderClaimReq: + type: object + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + StorePostCustomersCustomerPasswordTokenReq: + type: object + required: + - email + properties: + email: + description: The email of the customer. + type: string + format: email + StorePostCustomersCustomerReq: + type: object + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressPayload' + description: The full billing address object + - type: string + description: The ID of an existing billing address + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object + StorePostCustomersReq: + type: object + required: + - first_name + - last_name + - email + - password + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + phone: + description: The Customer's phone number. + type: string + StorePostCustomersResetPasswordReq: + type: object + required: + - email + - password + - token + properties: + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + token: + description: The reset password token + type: string + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StorePostPaymentCollectionsBatchSessionsAuthorizeReq: + type: object + required: + - session_ids + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + StorePostPaymentCollectionsBatchSessionsReq: + type: object + required: + - sessions + properties: + sessions: + description: An array of payment sessions related to the Payment Collection. If the session_id is not provided, existing sessions not present will be deleted and the provided ones will be created. + type: array + items: + type: object + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + StorePostReturnsReq: + type: object + required: + - order_id + - items + properties: + order_id: + type: string + description: The ID of the Order to create the Return from. + items: + description: The items to include in the Return. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + reason_id: + description: The ID of the return reason. + type: string + note: + description: A note to add to the item returned. + type: string + return_shipping: + description: If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves. + type: object + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + StorePostSearchRes: + allOf: + - type: object + required: + - hits + properties: + hits: + description: Array of results. The format of the items depends on the search engine installed on the server. + type: array + - type: object + StorePostSwapsReq: + type: object + required: + - order_id + - return_items + - additional_items + properties: + order_id: + type: string + description: The ID of the Order to create the Swap for. + return_items: + description: The items to include in the Return. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to swap. + type: integer + reason_id: + description: The ID of the reason of this return. + type: string + note: + description: The note to add to the item being swapped. + type: string + return_shipping_option: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + additional_items: + description: The items to exchange the returned items to. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to send. + type: string + quantity: + description: The quantity to send of the variant. + type: integer + StoreProductTagsListRes: + type: object + required: + - product_tags + - count + - offset + - limit + properties: + product_tags: + type: array + items: + $ref: '#/components/schemas/ProductTag' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductTypesListRes: + type: object + required: + - product_types + - count + - offset + - limit + properties: + product_types: + type: array + items: + $ref: '#/components/schemas/ProductType' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductsListRes: + type: object + x-expanded-relations: + field: products + relations: + - collection + - images + - options + - options.values + - tags + - type + - variants + - variants.options + - variants.prices + required: + - products + - count + - offset + - limit + properties: + products: + type: array + items: + $ref: '#/components/schemas/PricedProduct' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductsRes: + type: object + x-expanded-relations: + field: product + relations: + - collection + - images + - options + - options.values + - tags + - type + - variants + - variants.options + - variants.prices + required: + - product + properties: + product: + $ref: '#/components/schemas/PricedProduct' + StoreRegionsListRes: + type: object + x-expanded-relations: + field: regions + relations: + - countries + - payment_providers + - fulfillment_providers + eager: + - payment_providers + - fulfillment_providers + required: + - regions + properties: + regions: + type: array + items: + $ref: '#/components/schemas/Region' + StoreRegionsRes: + type: object + x-expanded-relations: + field: region + relations: + - countries + - payment_providers + - fulfillment_providers + eager: + - payment_providers + - fulfillment_providers + required: + - region + properties: + region: + $ref: '#/components/schemas/Region' + StoreReturnReasonsListRes: + type: object + x-expanded-relations: + field: return_reasons + relations: + - parent_return_reason + - return_reason_children + required: + - return_reasons + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/ReturnReason' + StoreReturnReasonsRes: + type: object + x-expanded-relations: + field: return_reason + relations: + - parent_return_reason + - return_reason_children + required: + - return_reason + properties: + return_reason: + $ref: '#/components/schemas/ReturnReason' + StoreReturnsRes: + type: object + x-expanded-relations: + field: return + relations: + - items + - items.reason + eager: + - items + required: + - return + properties: + return: + $ref: '#/components/schemas/Return' + StoreShippingOptionsListRes: + type: object + x-expanded-relations: + field: shipping_options + relations: + - requirements + required: + - shipping_options + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/PricedShippingOption' + StoreSwapsRes: + type: object + x-expanded-relations: + field: swap + relations: + - additional_items + - additional_items.variant + - cart + - fulfillments + - order + - payment + - return_order + - return_order.shipping_method + - shipping_address + - shipping_methods + eager: + - fulfillments.items + required: + - swap + properties: + swap: + $ref: '#/components/schemas/Swap' + StoreVariantsListRes: + type: object + x-expanded-relations: + field: variants + relations: + - prices + - options + - product + required: + - variants + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StoreVariantsRes: + type: object + x-expanded-relations: + field: variant + relations: + - prices + - options + - product + required: + - variant + properties: + variant: + $ref: '#/components/schemas/PricedVariant' + Swap: + title: Swap + description: Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. + type: object + required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - shipping_address_id + - updated_at + properties: + id: + description: The swap's ID + type: string + example: swap_01F0YET86Y9G92D3YDR9Y6V676 + fulfillment_status: + description: The status of the Fulfillment of the Swap. + type: string + enum: + - not_fulfilled + - fulfilled + - shipped + - partially_shipped + - canceled + - requires_action + example: not_fulfilled + payment_status: + description: The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount. + type: string + enum: + - not_paid + - awaiting + - captured + - confirmed + - canceled + - difference_refunded + - partially_refunded + - refunded + - requires_action + example: not_paid + order_id: + description: The ID of the Order where the Line Items to be returned where purchased. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + additional_items: + description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + return_order: + description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + nullable: true + type: object + fulfillments: + description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + payment: + description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + nullable: true + type: object + difference_due: + description: The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. + nullable: true + type: integer + example: 0 + shipping_address_id: + description: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + cart_id: + description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + confirmed_at: + description: The date with timezone at which the Swap was confirmed by the Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: If set to true, no notification will be sent related to this swap + nullable: true + type: boolean + example: false + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: false + idempotency_key: + description: Randomly generated key used to continue the completion of the swap in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxLine: + title: Tax Line + description: Line item that specifies an amount of tax to add to a line item. + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The tax line's ID + type: string + example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxProvider: + title: Tax Provider + description: The tax service used to calculate taxes + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the tax provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + TaxRate: + title: Tax Rate + description: A Tax Rate can be used to associate a certain rate to charge on products within a given Region + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - region_id + - updated_at + properties: + id: + description: The tax rate's ID + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + rate: + description: The numeric rate to charge + nullable: true + type: number + example: 10 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + region_id: + description: The id of the Region that the rate belongs to + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + products: + description: The products that belong to this tax rate. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + shipping_options: + type: array + description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. + items: + $ref: '#/components/schemas/ShippingOption' + product_count: + description: The count of products + type: integer + example: 10 + product_type_count: + description: The count of product types + type: integer + example: 2 + shipping_option_count: + description: The count of shipping options + type: integer + example: 1 + 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 updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TrackingLink: + title: Tracking Link + description: Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. + type: object + required: + - created_at + - deleted_at + - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url + properties: + id: + description: The tracking link's ID + type: string + example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 + url: + description: The URL at which the status of the shipment can be tracked. + nullable: true + type: string + format: uri + tracking_number: + description: The tracking number given by the shipping carrier. + type: string + format: RH370168054CN + fulfillment_id: + description: The id of the Fulfillment that the Tracking Link references. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + fulfillment: + description: Available if the relation `fulfillment` is expanded. + nullable: true + type: object + idempotency_key: + description: Randomly generated key used to continue the completion of a process in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + UpdateStockLocationInput: + title: Update Stock Location Input + description: Represents the Input to update a Stock Location + type: object + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + User: + title: User + description: Represents a User who can manage store settings. + type: object + required: + - api_token + - created_at + - deleted_at + - email + - first_name + - id + - last_name + - metadata + - role + - updated_at + properties: + id: + description: The user's ID + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member + email: + description: The email of the User + type: string + format: email + first_name: + description: The first name of the User + nullable: true + type: string + example: Levi + last_name: + description: The last name of the User + nullable: true + type: string + example: Bogan + api_token: + description: An API token associated with the user. + nullable: true + type: string + example: null + 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 updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white diff --git a/docs/api/store/code_samples/JavaScript/auth/get.js b/docs/api/store/code_samples/JavaScript/store_auth/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/auth/get.js rename to docs/api/store/code_samples/JavaScript/store_auth/get.js diff --git a/docs/api/store/code_samples/JavaScript/auth/post.js b/docs/api/store/code_samples/JavaScript/store_auth/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/auth/post.js rename to docs/api/store/code_samples/JavaScript/store_auth/post.js diff --git a/docs/api/store/code_samples/JavaScript/auth_{email}/get.js b/docs/api/store/code_samples/JavaScript/store_auth_{email}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/auth_{email}/get.js rename to docs/api/store/code_samples/JavaScript/store_auth_{email}/get.js diff --git a/docs/api/store/code_samples/JavaScript/carts/post.js b/docs/api/store/code_samples/JavaScript/store_carts/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts/post.js rename to docs/api/store/code_samples/JavaScript/store_carts/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_complete/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_complete/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_complete/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_complete/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_discounts_{code}/delete.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_discounts_{code}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_discounts_{code}/delete.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_discounts_{code}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_line-items/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_line-items/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_line-items/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_line-items/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/delete.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/delete.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-session/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-session/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-session/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-session/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/delete.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/delete.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/post.js similarity index 99% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/post.js index 21e0253c2c..fbb0e0a564 100644 --- a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js +++ b/docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/post.js @@ -2,6 +2,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.updatePaymentSession(cart_id, 'manual', { data: { + } }) .then(({ cart }) => { diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_shipping-methods/post.js b/docs/api/store/code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_shipping-methods/post.js rename to docs/api/store/code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js diff --git a/docs/api/store/code_samples/JavaScript/collections/get.js b/docs/api/store/code_samples/JavaScript/store_collections/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/collections/get.js rename to docs/api/store/code_samples/JavaScript/store_collections/get.js diff --git a/docs/api/store/code_samples/JavaScript/collections_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_collections_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/collections_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_collections_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers/post.js b/docs/api/store/code_samples/JavaScript/store_customers/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers/post.js rename to docs/api/store/code_samples/JavaScript/store_customers/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me/get.js b/docs/api/store/code_samples/JavaScript/store_customers_me/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me/get.js rename to docs/api/store/code_samples/JavaScript/store_customers_me/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me/post.js b/docs/api/store/code_samples/JavaScript/store_customers_me/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me/post.js rename to docs/api/store/code_samples/JavaScript/store_customers_me/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_addresses/post.js b/docs/api/store/code_samples/JavaScript/store_customers_me_addresses/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_addresses/post.js rename to docs/api/store/code_samples/JavaScript/store_customers_me_addresses/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/delete.js b/docs/api/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/delete.js rename to docs/api/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/post.js b/docs/api/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/post.js rename to docs/api/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_orders/get.js b/docs/api/store/code_samples/JavaScript/store_customers_me_orders/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_orders/get.js rename to docs/api/store/code_samples/JavaScript/store_customers_me_orders/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_payment-methods/get.js b/docs/api/store/code_samples/JavaScript/store_customers_me_payment-methods/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_payment-methods/get.js rename to docs/api/store/code_samples/JavaScript/store_customers_me_payment-methods/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers_password-reset/post.js b/docs/api/store/code_samples/JavaScript/store_customers_password-reset/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_password-reset/post.js rename to docs/api/store/code_samples/JavaScript/store_customers_password-reset/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_password-token/post.js b/docs/api/store/code_samples/JavaScript/store_customers_password-token/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_password-token/post.js rename to docs/api/store/code_samples/JavaScript/store_customers_password-token/post.js diff --git a/docs/api/store/code_samples/JavaScript/gift-cards_{code}/get.js b/docs/api/store/code_samples/JavaScript/store_gift-cards_{code}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/gift-cards_{code}/get.js rename to docs/api/store/code_samples/JavaScript/store_gift-cards_{code}/get.js diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_order-edits_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/order-edits_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_order-edits_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/post.js b/docs/api/store/code_samples/JavaScript/store_order-edits_{id}_complete/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/post.js rename to docs/api/store/code_samples/JavaScript/store_order-edits_{id}_complete/post.js diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/post.js b/docs/api/store/code_samples/JavaScript/store_order-edits_{id}_decline/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/post.js rename to docs/api/store/code_samples/JavaScript/store_order-edits_{id}_decline/post.js diff --git a/docs/api/store/code_samples/JavaScript/orders/get.js b/docs/api/store/code_samples/JavaScript/store_orders/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders/get.js rename to docs/api/store/code_samples/JavaScript/store_orders/get.js diff --git a/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/post.js b/docs/api/store/code_samples/JavaScript/store_orders_batch_customer_token/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_batch_customer_token/post.js rename to docs/api/store/code_samples/JavaScript/store_orders_batch_customer_token/post.js diff --git a/docs/api/store/code_samples/JavaScript/orders_cart_{cart_id}/get.js b/docs/api/store/code_samples/JavaScript/store_orders_cart_{cart_id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_cart_{cart_id}/get.js rename to docs/api/store/code_samples/JavaScript/store_orders_cart_{cart_id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/orders_customer_confirm/post.js b/docs/api/store/code_samples/JavaScript/store_orders_customer_confirm/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_customer_confirm/post.js rename to docs/api/store/code_samples/JavaScript/store_orders_customer_confirm/post.js diff --git a/docs/api/store/code_samples/JavaScript/orders_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_orders_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_orders_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_payment-collections_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/post.js b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions/post.js similarity index 99% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/post.js rename to docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions/post.js index 3205e03ec7..59e3022db9 100644 --- a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/post.js +++ b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions/post.js @@ -1,7 +1,9 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token + // Total amount = 10000 + // Adding a payment session medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) .then(({ payment_collection }) => { diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_batch/post.js similarity index 99% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js rename to docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_batch/post.js index fdc8f51a65..6a87deeeee 100644 --- a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js +++ b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_batch/post.js @@ -1,7 +1,9 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token + // Total amount = 10000 + // Adding two new sessions medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ { @@ -16,6 +18,7 @@ medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ .then(({ payment_collection }) => { console.log(payment_collection.id); }); + // Updating one session and removing the other medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ { diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/post.js b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_batch_authorize/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/post.js rename to docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_batch_authorize/post.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/post.js b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/post.js rename to docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/post.js b/docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}_authorize/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/post.js rename to docs/api/store/code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}_authorize/post.js diff --git a/docs/api/store/code_samples/JavaScript/product-categories/get.js b/docs/api/store/code_samples/JavaScript/store_product-categories/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/product-categories/get.js rename to docs/api/store/code_samples/JavaScript/store_product-categories/get.js diff --git a/docs/api/store/code_samples/JavaScript/product-categories_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_product-categories_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/product-categories_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_product-categories_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/product-tags/get.js b/docs/api/store/code_samples/JavaScript/store_product-tags/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/product-tags/get.js rename to docs/api/store/code_samples/JavaScript/store_product-tags/get.js diff --git a/docs/api/store/code_samples/JavaScript/product-types/get.js b/docs/api/store/code_samples/JavaScript/store_product-types/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/product-types/get.js rename to docs/api/store/code_samples/JavaScript/store_product-types/get.js diff --git a/docs/api/store/code_samples/JavaScript/products/get.js b/docs/api/store/code_samples/JavaScript/store_products/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/products/get.js rename to docs/api/store/code_samples/JavaScript/store_products/get.js diff --git a/docs/api/store/code_samples/JavaScript/products_search/post.js b/docs/api/store/code_samples/JavaScript/store_products_search/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/products_search/post.js rename to docs/api/store/code_samples/JavaScript/store_products_search/post.js diff --git a/docs/api/store/code_samples/JavaScript/products_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_products_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/products_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_products_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/regions/get.js b/docs/api/store/code_samples/JavaScript/store_regions/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/regions/get.js rename to docs/api/store/code_samples/JavaScript/store_regions/get.js diff --git a/docs/api/store/code_samples/JavaScript/regions_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_regions_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/regions_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_regions_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/return-reasons/get.js b/docs/api/store/code_samples/JavaScript/store_return-reasons/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/return-reasons/get.js rename to docs/api/store/code_samples/JavaScript/store_return-reasons/get.js diff --git a/docs/api/store/code_samples/JavaScript/return-reasons_{id}/get.js b/docs/api/store/code_samples/JavaScript/store_return-reasons_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/return-reasons_{id}/get.js rename to docs/api/store/code_samples/JavaScript/store_return-reasons_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/returns/post.js b/docs/api/store/code_samples/JavaScript/store_returns/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/returns/post.js rename to docs/api/store/code_samples/JavaScript/store_returns/post.js diff --git a/docs/api/store/code_samples/JavaScript/shipping-options/get.js b/docs/api/store/code_samples/JavaScript/store_shipping-options/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/shipping-options/get.js rename to docs/api/store/code_samples/JavaScript/store_shipping-options/get.js diff --git a/docs/api/store/code_samples/JavaScript/shipping-options_{cart_id}/get.js b/docs/api/store/code_samples/JavaScript/store_shipping-options_{cart_id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/shipping-options_{cart_id}/get.js rename to docs/api/store/code_samples/JavaScript/store_shipping-options_{cart_id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/swaps/post.js b/docs/api/store/code_samples/JavaScript/store_swaps/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/swaps/post.js rename to docs/api/store/code_samples/JavaScript/store_swaps/post.js diff --git a/docs/api/store/code_samples/JavaScript/swaps_{cart_id}/get.js b/docs/api/store/code_samples/JavaScript/store_swaps_{cart_id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/swaps_{cart_id}/get.js rename to docs/api/store/code_samples/JavaScript/store_swaps_{cart_id}/get.js diff --git a/docs/api/store/code_samples/Shell/auth/delete.sh b/docs/api/store/code_samples/Shell/store_auth/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth/delete.sh rename to docs/api/store/code_samples/Shell/store_auth/delete.sh diff --git a/docs/api/store/code_samples/Shell/auth/get.sh b/docs/api/store/code_samples/Shell/store_auth/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth/get.sh rename to docs/api/store/code_samples/Shell/store_auth/get.sh diff --git a/docs/api/store/code_samples/Shell/auth/post.sh b/docs/api/store/code_samples/Shell/store_auth/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth/post.sh rename to docs/api/store/code_samples/Shell/store_auth/post.sh diff --git a/docs/api/store/code_samples/Shell/auth_{email}/get.sh b/docs/api/store/code_samples/Shell/store_auth_{email}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth_{email}/get.sh rename to docs/api/store/code_samples/Shell/store_auth_{email}/get.sh diff --git a/docs/api/store/code_samples/Shell/carts/post.sh b/docs/api/store/code_samples/Shell/store_carts/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts/post.sh rename to docs/api/store/code_samples/Shell/store_carts/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}/get.sh b/docs/api/store/code_samples/Shell/store_carts_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_complete/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_complete/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_complete/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_complete/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_discounts_{code}/delete.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_discounts_{code}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_discounts_{code}/delete.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_discounts_{code}/delete.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_line-items/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_line-items/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_line-items/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_line-items/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/delete.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_line-items_{line_id}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/delete.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_line-items_{line_id}/delete.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_line-items_{line_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_line-items_{line_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-session/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_payment-session/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-session/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_payment-session/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/delete.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/delete.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/delete.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_shipping-methods/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_shipping-methods/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_shipping-methods/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_shipping-methods/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_taxes/post.sh b/docs/api/store/code_samples/Shell/store_carts_{id}_taxes/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_taxes/post.sh rename to docs/api/store/code_samples/Shell/store_carts_{id}_taxes/post.sh diff --git a/docs/api/store/code_samples/Shell/collections/get.sh b/docs/api/store/code_samples/Shell/store_collections/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/collections/get.sh rename to docs/api/store/code_samples/Shell/store_collections/get.sh diff --git a/docs/api/store/code_samples/Shell/collections_{id}/get.sh b/docs/api/store/code_samples/Shell/store_collections_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/collections_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_collections_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/customers/post.sh b/docs/api/store/code_samples/Shell/store_customers/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers/post.sh rename to docs/api/store/code_samples/Shell/store_customers/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me/get.sh b/docs/api/store/code_samples/Shell/store_customers_me/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me/get.sh rename to docs/api/store/code_samples/Shell/store_customers_me/get.sh diff --git a/docs/api/store/code_samples/Shell/customers_me/post.sh b/docs/api/store/code_samples/Shell/store_customers_me/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me/post.sh rename to docs/api/store/code_samples/Shell/store_customers_me/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_addresses/post.sh b/docs/api/store/code_samples/Shell/store_customers_me_addresses/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_addresses/post.sh rename to docs/api/store/code_samples/Shell/store_customers_me_addresses/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/delete.sh b/docs/api/store/code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/delete.sh rename to docs/api/store/code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/post.sh b/docs/api/store/code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/post.sh rename to docs/api/store/code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_orders/get.sh b/docs/api/store/code_samples/Shell/store_customers_me_orders/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_orders/get.sh rename to docs/api/store/code_samples/Shell/store_customers_me_orders/get.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_payment-methods/get.sh b/docs/api/store/code_samples/Shell/store_customers_me_payment-methods/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_payment-methods/get.sh rename to docs/api/store/code_samples/Shell/store_customers_me_payment-methods/get.sh diff --git a/docs/api/store/code_samples/Shell/customers_password-reset/post.sh b/docs/api/store/code_samples/Shell/store_customers_password-reset/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_password-reset/post.sh rename to docs/api/store/code_samples/Shell/store_customers_password-reset/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_password-token/post.sh b/docs/api/store/code_samples/Shell/store_customers_password-token/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_password-token/post.sh rename to docs/api/store/code_samples/Shell/store_customers_password-token/post.sh diff --git a/docs/api/store/code_samples/Shell/gift-cards_{code}/get.sh b/docs/api/store/code_samples/Shell/store_gift-cards_{code}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/gift-cards_{code}/get.sh rename to docs/api/store/code_samples/Shell/store_gift-cards_{code}/get.sh diff --git a/docs/api/store/code_samples/Shell/order-edits_{id}/get.sh b/docs/api/store/code_samples/Shell/store_order-edits_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/order-edits_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_order-edits_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/order-edits_{id}_complete/post.sh b/docs/api/store/code_samples/Shell/store_order-edits_{id}_complete/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/order-edits_{id}_complete/post.sh rename to docs/api/store/code_samples/Shell/store_order-edits_{id}_complete/post.sh diff --git a/docs/api/store/code_samples/Shell/order-edits_{id}_decline/post.sh b/docs/api/store/code_samples/Shell/store_order-edits_{id}_decline/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/order-edits_{id}_decline/post.sh rename to docs/api/store/code_samples/Shell/store_order-edits_{id}_decline/post.sh diff --git a/docs/api/store/code_samples/Shell/orders/get.sh b/docs/api/store/code_samples/Shell/store_orders/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders/get.sh rename to docs/api/store/code_samples/Shell/store_orders/get.sh diff --git a/docs/api/store/code_samples/Shell/orders_batch_customer_token/post.sh b/docs/api/store/code_samples/Shell/store_orders_batch_customer_token/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_batch_customer_token/post.sh rename to docs/api/store/code_samples/Shell/store_orders_batch_customer_token/post.sh diff --git a/docs/api/store/code_samples/Shell/orders_cart_{cart_id}/get.sh b/docs/api/store/code_samples/Shell/store_orders_cart_{cart_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_cart_{cart_id}/get.sh rename to docs/api/store/code_samples/Shell/store_orders_cart_{cart_id}/get.sh diff --git a/docs/api/store/code_samples/Shell/orders_customer_confirm/post.sh b/docs/api/store/code_samples/Shell/store_orders_customer_confirm/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_customer_confirm/post.sh rename to docs/api/store/code_samples/Shell/store_orders_customer_confirm/post.sh diff --git a/docs/api/store/code_samples/Shell/orders_{id}/get.sh b/docs/api/store/code_samples/Shell/store_orders_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_orders_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}/get.sh b/docs/api/store/code_samples/Shell/store_payment-collections_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_payment-collections_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/post.sh b/docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/post.sh rename to docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/post.sh b/docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_batch/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/post.sh rename to docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_batch/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/post.sh b/docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_batch_authorize/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/post.sh rename to docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_batch_authorize/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/post.sh b/docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/post.sh rename to docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/post.sh b/docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}_authorize/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/post.sh rename to docs/api/store/code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}_authorize/post.sh diff --git a/docs/api/store/code_samples/Shell/product-categories/get.sh b/docs/api/store/code_samples/Shell/store_product-categories/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-categories/get.sh rename to docs/api/store/code_samples/Shell/store_product-categories/get.sh diff --git a/docs/api/store/code_samples/Shell/product-categories_{id}/get.sh b/docs/api/store/code_samples/Shell/store_product-categories_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-categories_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_product-categories_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/product-tags/get.sh b/docs/api/store/code_samples/Shell/store_product-tags/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-tags/get.sh rename to docs/api/store/code_samples/Shell/store_product-tags/get.sh diff --git a/docs/api/store/code_samples/Shell/product-types/get.sh b/docs/api/store/code_samples/Shell/store_product-types/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-types/get.sh rename to docs/api/store/code_samples/Shell/store_product-types/get.sh diff --git a/docs/api/store/code_samples/Shell/products/get.sh b/docs/api/store/code_samples/Shell/store_products/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/products/get.sh rename to docs/api/store/code_samples/Shell/store_products/get.sh diff --git a/docs/api/store/code_samples/Shell/products_search/post.sh b/docs/api/store/code_samples/Shell/store_products_search/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/products_search/post.sh rename to docs/api/store/code_samples/Shell/store_products_search/post.sh diff --git a/docs/api/store/code_samples/Shell/products_{id}/get.sh b/docs/api/store/code_samples/Shell/store_products_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/products_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_products_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/regions/get.sh b/docs/api/store/code_samples/Shell/store_regions/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/regions/get.sh rename to docs/api/store/code_samples/Shell/store_regions/get.sh diff --git a/docs/api/store/code_samples/Shell/regions_{id}/get.sh b/docs/api/store/code_samples/Shell/store_regions_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/regions_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_regions_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/return-reasons/get.sh b/docs/api/store/code_samples/Shell/store_return-reasons/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/return-reasons/get.sh rename to docs/api/store/code_samples/Shell/store_return-reasons/get.sh diff --git a/docs/api/store/code_samples/Shell/return-reasons_{id}/get.sh b/docs/api/store/code_samples/Shell/store_return-reasons_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/return-reasons_{id}/get.sh rename to docs/api/store/code_samples/Shell/store_return-reasons_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/returns/post.sh b/docs/api/store/code_samples/Shell/store_returns/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/returns/post.sh rename to docs/api/store/code_samples/Shell/store_returns/post.sh diff --git a/docs/api/store/code_samples/Shell/shipping-options/get.sh b/docs/api/store/code_samples/Shell/store_shipping-options/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/shipping-options/get.sh rename to docs/api/store/code_samples/Shell/store_shipping-options/get.sh diff --git a/docs/api/store/code_samples/Shell/shipping-options_{cart_id}/get.sh b/docs/api/store/code_samples/Shell/store_shipping-options_{cart_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/shipping-options_{cart_id}/get.sh rename to docs/api/store/code_samples/Shell/store_shipping-options_{cart_id}/get.sh diff --git a/docs/api/store/code_samples/Shell/swaps/post.sh b/docs/api/store/code_samples/Shell/store_swaps/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/swaps/post.sh rename to docs/api/store/code_samples/Shell/store_swaps/post.sh diff --git a/docs/api/store/code_samples/Shell/swaps_{cart_id}/get.sh b/docs/api/store/code_samples/Shell/store_swaps_{cart_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/swaps_{cart_id}/get.sh rename to docs/api/store/code_samples/Shell/store_swaps_{cart_id}/get.sh diff --git a/docs/api/store/code_samples/Shell/variants/get.sh b/docs/api/store/code_samples/Shell/store_variants/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/variants/get.sh rename to docs/api/store/code_samples/Shell/store_variants/get.sh diff --git a/docs/api/store/code_samples/Shell/variants_{variant_id}/get.sh b/docs/api/store/code_samples/Shell/store_variants_{variant_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/variants_{variant_id}/get.sh rename to docs/api/store/code_samples/Shell/store_variants_{variant_id}/get.sh diff --git a/docs/api/store/components/schemas/AddressCreatePayload.yaml b/docs/api/store/components/schemas/AddressCreatePayload.yaml new file mode 100644 index 0000000000..1094c0f176 --- /dev/null +++ b/docs/api/store/components/schemas/AddressCreatePayload.yaml @@ -0,0 +1,57 @@ +type: object +description: Address fields used when creating an address. +required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code +properties: + first_name: + description: First name + type: string + example: Arno + last_name: + description: Last name + type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: + description: Address line 1 + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + type: string + example: Suite 369 + city: + description: City + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + description: Province + type: string + example: Kentucky + postal_code: + description: Postal Code + type: string + example: 72093 + metadata: + type: object + example: + car: white + description: An optional key-value map with additional details diff --git a/docs/api/store/components/schemas/AddressFields.yaml b/docs/api/store/components/schemas/AddressPayload.yaml similarity index 94% rename from docs/api/store/components/schemas/AddressFields.yaml rename to docs/api/store/components/schemas/AddressPayload.yaml index 6e4c4d6358..89fa9ff576 100644 --- a/docs/api/store/components/schemas/AddressFields.yaml +++ b/docs/api/store/components/schemas/AddressPayload.yaml @@ -1,53 +1,50 @@ -title: Address Fields -description: Address fields used when creating/updating an address. type: object +description: Address fields used when creating/updating an address. properties: - company: - type: string - description: Company name - example: Acme first_name: - type: string description: First name + type: string example: Arno last_name: - type: string description: Last name - example: Willms - address_1: type: string + example: Willms + phone: + type: string + description: Phone Number + example: 16128234334802 + company: + type: string + address_1: description: Address line 1 + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + type: string example: Suite 369 city: - type: string description: City + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + type: string externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. example: st province: - type: string description: Province + type: string example: Kentucky postal_code: - type: string description: Postal Code - example: 72093 - phone: type: string - description: Phone Number - example: 16128234334802 + example: 72093 metadata: type: object - description: An optional key-value map with additional details example: car: white + description: An optional key-value map with additional details diff --git a/docs/api/store/components/schemas/Cart.yaml b/docs/api/store/components/schemas/Cart.yaml index 92c5146ff8..649b1149fd 100644 --- a/docs/api/store/components/schemas/Cart.yaml +++ b/docs/api/store/components/schemas/Cart.yaml @@ -174,6 +174,10 @@ properties: type: integer example: 1000 discount_total: + description: The total of discount rounded + type: integer + example: 800 + raw_discount_total: description: The total of discount type: integer example: 800 diff --git a/docs/api/store/components/schemas/ExtendedStoreDTO.yaml b/docs/api/store/components/schemas/ExtendedStoreDTO.yaml new file mode 100644 index 0000000000..af6132c641 --- /dev/null +++ b/docs/api/store/components/schemas/ExtendedStoreDTO.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: ./Store.yaml + - type: object + required: + - payment_providers + - fulfillment_providers + - feature_flags + - modules + properties: + payment_providers: + $ref: ./PaymentProvider.yaml + fulfillment_providers: + $ref: ./FulfillmentProvider.yaml + feature_flags: + $ref: ./FeatureFlagsResponse.yaml + modules: + $ref: ./ModulesResponse.yaml diff --git a/docs/api/store/components/schemas/FeatureFlagsResponse.yaml b/docs/api/store/components/schemas/FeatureFlagsResponse.yaml new file mode 100644 index 0000000000..ce55d9ccc4 --- /dev/null +++ b/docs/api/store/components/schemas/FeatureFlagsResponse.yaml @@ -0,0 +1,13 @@ +type: array +items: + type: object + required: + - key + - value + properties: + key: + description: The key of the feature flag. + type: string + value: + description: The value of the feature flag. + type: boolean diff --git a/docs/api/store/components/schemas/LineItem.yaml b/docs/api/store/components/schemas/LineItem.yaml index e809ce5e3c..67b1ee5cd0 100644 --- a/docs/api/store/components/schemas/LineItem.yaml +++ b/docs/api/store/components/schemas/LineItem.yaml @@ -199,6 +199,10 @@ properties: type: integer example: 0 discount_total: + description: The total of discount of the line item rounded + type: integer + example: 0 + raw_discount_total: description: The total of discount of the line item type: integer example: 0 diff --git a/docs/api/store/components/schemas/LineItemAdjustment.yaml b/docs/api/store/components/schemas/LineItemAdjustment.yaml index fe1b9049e8..5dcc6f496f 100644 --- a/docs/api/store/components/schemas/LineItemAdjustment.yaml +++ b/docs/api/store/components/schemas/LineItemAdjustment.yaml @@ -36,7 +36,7 @@ properties: $ref: ./Discount.yaml amount: description: The adjustment amount - type: integer + type: number example: 1000 metadata: description: An optional key-value map with additional details diff --git a/docs/api/store/components/schemas/ModulesResponse.yaml b/docs/api/store/components/schemas/ModulesResponse.yaml new file mode 100644 index 0000000000..f90e78d9f9 --- /dev/null +++ b/docs/api/store/components/schemas/ModulesResponse.yaml @@ -0,0 +1,13 @@ +type: array +items: + type: object + required: + - module + - resolution + properties: + module: + description: The key of the module. + type: string + resolution: + description: The resolution path of the module or false if module is not installed. + type: string diff --git a/docs/api/store/components/schemas/Order.yaml b/docs/api/store/components/schemas/Order.yaml index 26d73485be..8406e48d2f 100644 --- a/docs/api/store/components/schemas/Order.yaml +++ b/docs/api/store/components/schemas/Order.yaml @@ -267,10 +267,14 @@ properties: type: integer description: The total of shipping example: 1000 - discount_total: + raw_discount_total: description: The total of discount type: integer example: 800 + discount_total: + description: The total of discount rounded + type: integer + example: 800 tax_total: description: The total of tax type: integer diff --git a/docs/api/store/components/schemas/PricedShippingOption.yaml b/docs/api/store/components/schemas/PricedShippingOption.yaml new file mode 100644 index 0000000000..a5f479328b --- /dev/null +++ b/docs/api/store/components/schemas/PricedShippingOption.yaml @@ -0,0 +1,27 @@ +title: Priced Shipping Option +type: object +allOf: + - $ref: ./ShippingOption.yaml + - type: object + properties: + price_incl_tax: + type: number + description: Price including taxes + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + tax_amount: + type: number + description: The taxes applied. diff --git a/docs/api/store/components/schemas/ProductCategory.yaml b/docs/api/store/components/schemas/ProductCategory.yaml index 9d15054cd5..3dfe3b8ca6 100644 --- a/docs/api/store/components/schemas/ProductCategory.yaml +++ b/docs/api/store/components/schemas/ProductCategory.yaml @@ -5,7 +5,6 @@ type: object required: - category_children - created_at - - deleted_at - handle - id - is_active @@ -44,6 +43,10 @@ properties: type: boolean description: A flag to make product category visible/hidden in the store front default: false + rank: + type: integer + description: An integer that depicts the rank of category in a tree node + default: 0 category_children: description: Available if the relation `category_children` are expanded. type: array @@ -75,8 +78,3 @@ properties: description: The date with timezone at which the resource was updated. type: string format: date-time - deleted_at: - description: The date with timezone at which the resource was deleted. - nullable: true - type: string - format: date-time diff --git a/docs/api/store/components/schemas/StockLocationExpandedDTO.yaml b/docs/api/store/components/schemas/StockLocationExpandedDTO.yaml new file mode 100644 index 0000000000..e2d6b28a56 --- /dev/null +++ b/docs/api/store/components/schemas/StockLocationExpandedDTO.yaml @@ -0,0 +1,6 @@ +allOf: + - $ref: ./StockLocationDTO.yaml + - type: object + properties: + sales_channels: + $ref: ./SalesChannel.yaml diff --git a/docs/api/store/components/schemas/StoreAuthRes.yaml b/docs/api/store/components/schemas/StoreAuthRes.yaml index ffb6903bf2..d46f399b85 100644 --- a/docs/api/store/components/schemas/StoreAuthRes.yaml +++ b/docs/api/store/components/schemas/StoreAuthRes.yaml @@ -1,4 +1,12 @@ type: object +x-expanded-relations: + field: customer + relations: + - orders + - orders.items + - shipping_addresses +required: + - customer properties: customer: $ref: ./Customer.yaml diff --git a/docs/api/store/components/schemas/StoreCartShippingOptionsListRes.yaml b/docs/api/store/components/schemas/StoreCartShippingOptionsListRes.yaml new file mode 100644 index 0000000000..fa027c42a6 --- /dev/null +++ b/docs/api/store/components/schemas/StoreCartShippingOptionsListRes.yaml @@ -0,0 +1,13 @@ +type: object +x-expanded-relations: + field: shipping_options + implicit: + - profile + - requirements +required: + - shipping_options +properties: + shipping_options: + type: array + items: + $ref: ./PricedShippingOption.yaml diff --git a/docs/api/store/components/schemas/StoreCartsRes.yaml b/docs/api/store/components/schemas/StoreCartsRes.yaml index f8895507ed..bcc2ca7b8d 100644 --- a/docs/api/store/components/schemas/StoreCartsRes.yaml +++ b/docs/api/store/components/schemas/StoreCartsRes.yaml @@ -1,4 +1,61 @@ type: object +x-expanded-relations: + field: cart + relations: + - billing_address + - discounts + - discounts.rule + - gift_cards + - items + - items.adjustments + - items.variant + - payment + - payment_sessions + - region + - region.countries + - region.payment_providers + - shipping_address + - shipping_methods + eager: + - region.fulfillment_providers + - region.payment_providers + - shipping_methods.shipping_option + implicit: + - items + - items.variant + - items.variant.product + - items.tax_lines + - items.adjustments + - gift_cards + - discounts + - discounts.rule + - shipping_methods + - shipping_methods.tax_lines + - shipping_address + - region + - region.tax_rates + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - item_tax_total + - refundable_amount + - refunded_total + - shipping_tax_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total +required: + - cart properties: cart: $ref: ./Cart.yaml diff --git a/docs/api/store/components/schemas/StoreCollectionsListRes.yaml b/docs/api/store/components/schemas/StoreCollectionsListRes.yaml index 252256786c..32822ecdb6 100644 --- a/docs/api/store/components/schemas/StoreCollectionsListRes.yaml +++ b/docs/api/store/components/schemas/StoreCollectionsListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - collections + - count + - offset + - limit properties: collections: type: array diff --git a/docs/api/store/components/schemas/StoreCollectionsRes.yaml b/docs/api/store/components/schemas/StoreCollectionsRes.yaml index 7802152206..e21873dbc1 100644 --- a/docs/api/store/components/schemas/StoreCollectionsRes.yaml +++ b/docs/api/store/components/schemas/StoreCollectionsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - collection properties: collection: $ref: ./ProductCollection.yaml diff --git a/docs/api/store/components/schemas/StoreCompleteCartRes.yaml b/docs/api/store/components/schemas/StoreCompleteCartRes.yaml index eb30651ad6..0359a68f13 100644 --- a/docs/api/store/components/schemas/StoreCompleteCartRes.yaml +++ b/docs/api/store/components/schemas/StoreCompleteCartRes.yaml @@ -1,4 +1,7 @@ type: object +required: + - type + - data properties: type: type: string diff --git a/docs/api/store/components/schemas/StoreCustomersListOrdersRes.yaml b/docs/api/store/components/schemas/StoreCustomersListOrdersRes.yaml index 1b4106242e..2733f8b01b 100644 --- a/docs/api/store/components/schemas/StoreCustomersListOrdersRes.yaml +++ b/docs/api/store/components/schemas/StoreCustomersListOrdersRes.yaml @@ -1,15 +1,101 @@ type: object +x-expanded-relations: + field: orders + relations: + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.tracking_links + - items + - items.variant + - payments + - region + - shipping_address + - shipping_methods + eager: + - region.fulfillment_providers + - region.payment_providers + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - customer + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_address + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total +required: + - orders + - count + - offset + - limit properties: orders: type: array items: $ref: ./Order.yaml count: - type: integer description: The total number of items available + type: integer offset: - type: integer description: The number of items skipped before these items - limit: type: integer + limit: description: The number of items per page + type: integer diff --git a/docs/api/store/components/schemas/StoreCustomersListPaymentMethodsRes.yaml b/docs/api/store/components/schemas/StoreCustomersListPaymentMethodsRes.yaml index 4fb8d8304a..a2ebfb8cfa 100644 --- a/docs/api/store/components/schemas/StoreCustomersListPaymentMethodsRes.yaml +++ b/docs/api/store/components/schemas/StoreCustomersListPaymentMethodsRes.yaml @@ -1,15 +1,20 @@ type: object +required: + - payment_methods properties: payment_methods: type: array items: type: object + required: + - provider_id + - data properties: provider_id: - type: string description: The id of the Payment Provider where the payment method is saved. + type: string data: - type: object description: >- The data needed for the Payment Provider to use the saved payment method. + type: object diff --git a/docs/api/store/components/schemas/StoreCustomersRes.yaml b/docs/api/store/components/schemas/StoreCustomersRes.yaml index ffb6903bf2..3569d05363 100644 --- a/docs/api/store/components/schemas/StoreCustomersRes.yaml +++ b/docs/api/store/components/schemas/StoreCustomersRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: customer + relations: + - billing_address + - shipping_addresses +required: + - customer properties: customer: $ref: ./Customer.yaml diff --git a/docs/api/store/components/schemas/StoreCustomersResetPasswordRes.yaml b/docs/api/store/components/schemas/StoreCustomersResetPasswordRes.yaml new file mode 100644 index 0000000000..4c256ac6ce --- /dev/null +++ b/docs/api/store/components/schemas/StoreCustomersResetPasswordRes.yaml @@ -0,0 +1,6 @@ +type: object +required: + - customer +properties: + customer: + $ref: ./Customer.yaml diff --git a/docs/api/store/components/schemas/StoreGetAuthEmailRes.yaml b/docs/api/store/components/schemas/StoreGetAuthEmailRes.yaml index bcc2e3fce2..6e24297835 100644 --- a/docs/api/store/components/schemas/StoreGetAuthEmailRes.yaml +++ b/docs/api/store/components/schemas/StoreGetAuthEmailRes.yaml @@ -1,5 +1,7 @@ type: object +required: + - exists properties: exists: - type: boolean description: Whether email exists or not. + type: boolean diff --git a/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml b/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml index d343bc439f..eaf81a7222 100644 --- a/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml +++ b/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: product_category + relations: + - category_children + - parent_category +required: + - product_category properties: product_category: $ref: ./ProductCategory.yaml diff --git a/docs/api/store/components/schemas/StoreGetProductCategoriesRes.yaml b/docs/api/store/components/schemas/StoreGetProductCategoriesRes.yaml new file mode 100644 index 0000000000..f053d45d1e --- /dev/null +++ b/docs/api/store/components/schemas/StoreGetProductCategoriesRes.yaml @@ -0,0 +1,25 @@ +type: object +x-expanded-relations: + field: product_categories + relations: + - category_children + - parent_category +required: + - product_categories + - count + - offset + - limit +properties: + product_categories: + type: array + items: + $ref: ./ProductCategory.yaml + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/store/components/schemas/StoreGiftCardsRes.yaml b/docs/api/store/components/schemas/StoreGiftCardsRes.yaml index d72a7917c2..b866fde0a4 100644 --- a/docs/api/store/components/schemas/StoreGiftCardsRes.yaml +++ b/docs/api/store/components/schemas/StoreGiftCardsRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - gift_card properties: gift_card: $ref: ./GiftCard.yaml diff --git a/docs/api/store/components/schemas/StoreOrderEditsRes.yaml b/docs/api/store/components/schemas/StoreOrderEditsRes.yaml index d266863926..4f5087710f 100644 --- a/docs/api/store/components/schemas/StoreOrderEditsRes.yaml +++ b/docs/api/store/components/schemas/StoreOrderEditsRes.yaml @@ -1,4 +1,41 @@ type: object +x-expanded-relations: + field: order_edit + relations: + - changes + - changes.line_item + - changes.line_item.variant + - changes.original_line_item + - changes.original_line_item.variant + - items + - items.adjustments + - items.tax_lines + - items.variant + - payment_collection + implicit: + - items + - items.tax_lines + - items.adjustments + - items.variant + totals: + - difference_due + - discount_total + - gift_card_tax_total + - gift_card_total + - shipping_total + - subtotal + - tax_total + - total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total +required: + - order_edit properties: order_edit: $ref: ./OrderEdit.yaml diff --git a/docs/api/store/components/schemas/StoreOrdersRes.yaml b/docs/api/store/components/schemas/StoreOrdersRes.yaml index 43b8e917ca..2cd84fe12d 100644 --- a/docs/api/store/components/schemas/StoreOrdersRes.yaml +++ b/docs/api/store/components/schemas/StoreOrdersRes.yaml @@ -1,4 +1,86 @@ type: object +required: + - order +x-expanded-relations: + field: order + relations: + - customer + - discounts + - discounts.rule + - fulfillments + - fulfillments.tracking_links + - items + - items.variant + - payments + - region + - shipping_address + - shipping_methods + eager: + - fulfillments.items + - region.fulfillment_providers + - region.payment_providers + - shipping_methods.shipping_option + implicit: + - claims + - claims.additional_items + - claims.additional_items.adjustments + - claims.additional_items.refundable + - claims.additional_items.tax_lines + - discounts + - discounts.rule + - gift_card_transactions + - gift_card_transactions.gift_card + - gift_cards + - items + - items.adjustments + - items.refundable + - items.tax_lines + - items.variant + - items.variant.product + - refunds + - region + - shipping_methods + - shipping_methods.tax_lines + - swaps + - swaps.additional_items + - swaps.additional_items.adjustments + - swaps.additional_items.refundable + - swaps.additional_items.tax_lines + totals: + - discount_total + - gift_card_tax_total + - gift_card_total + - paid_total + - refundable_amount + - refunded_total + - shipping_total + - subtotal + - tax_total + - total + - claims.additional_items.discount_total + - claims.additional_items.gift_card_total + - claims.additional_items.original_tax_total + - claims.additional_items.original_total + - claims.additional_items.refundable + - claims.additional_items.subtotal + - claims.additional_items.tax_total + - claims.additional_items.total + - items.discount_total + - items.gift_card_total + - items.original_tax_total + - items.original_total + - items.refundable + - items.subtotal + - items.tax_total + - items.total + - swaps.additional_items.discount_total + - swaps.additional_items.gift_card_total + - swaps.additional_items.original_tax_total + - swaps.additional_items.original_total + - swaps.additional_items.refundable + - swaps.additional_items.subtotal + - swaps.additional_items.tax_total + - swaps.additional_items.total properties: order: $ref: ./Order.yaml diff --git a/docs/api/store/components/schemas/StorePaymentCollectionsRes.yaml b/docs/api/store/components/schemas/StorePaymentCollectionsRes.yaml index a7748cf4f4..235443c942 100644 --- a/docs/api/store/components/schemas/StorePaymentCollectionsRes.yaml +++ b/docs/api/store/components/schemas/StorePaymentCollectionsRes.yaml @@ -1,4 +1,14 @@ type: object +x-expanded-relations: + field: payment_collection + relations: + - payment_sessions + - region + eager: + - region.fulfillment_providers + - region.payment_providers +required: + - payment_collection properties: payment_collection: $ref: ./PaymentCollection.yaml diff --git a/docs/api/store/components/schemas/StorePaymentCollectionsSessionRes.yaml b/docs/api/store/components/schemas/StorePaymentCollectionsSessionRes.yaml index 4a421583a8..075c9ef9e2 100644 --- a/docs/api/store/components/schemas/StorePaymentCollectionsSessionRes.yaml +++ b/docs/api/store/components/schemas/StorePaymentCollectionsSessionRes.yaml @@ -1,4 +1,6 @@ type: object +required: + - payment_session properties: payment_session: $ref: ./PaymentSession.yaml diff --git a/docs/api/store/components/schemas/StorePostCartsCartReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml index 86402c2bd1..787339ceb5 100644 --- a/docs/api/store/components/schemas/StorePostCartsCartReq.yaml +++ b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml @@ -20,14 +20,14 @@ properties: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: ./Address.yaml + - $ref: ./AddressPayload.yaml description: A full billing address object. - type: string description: The billing address ID shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: ./Address.yaml + - $ref: ./AddressPayload.yaml description: A full shipping address object. - type: string description: The shipping address ID diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml index dffdfc21c3..2974d52c0a 100644 --- a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml @@ -1,2 +1,2 @@ anyOf: - - $ref: ./AddressFields.yaml + - $ref: ./AddressPayload.yaml diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml index 8f4dcf9c92..84aed96646 100644 --- a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml @@ -4,13 +4,4 @@ required: properties: address: description: The Address to add to the Customer. - allOf: - - $ref: ./AddressFields.yaml - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: ./AddressCreatePayload.yaml diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml index 1579b30340..6b2089aeb1 100644 --- a/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml @@ -9,7 +9,7 @@ properties: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: ./AddressFields.yaml + - $ref: ./AddressPayload.yaml description: The full billing address object - type: string description: The ID of an existing billing address diff --git a/docs/api/store/components/schemas/StorePostSearchRes.yaml b/docs/api/store/components/schemas/StorePostSearchRes.yaml index 43237f6eb7..b2eec4718a 100644 --- a/docs/api/store/components/schemas/StorePostSearchRes.yaml +++ b/docs/api/store/components/schemas/StorePostSearchRes.yaml @@ -1,7 +1,11 @@ -type: object -properties: - hits: - type: array - description: >- - Array of results. The format of the items depends on the search engine - installed on the server. +allOf: + - type: object + required: + - hits + properties: + hits: + description: >- + Array of results. The format of the items depends on the search engine + installed on the server. + type: array + - type: object diff --git a/docs/api/store/components/schemas/StoreProductCategoriesListRes.yaml b/docs/api/store/components/schemas/StoreProductTagsListRes.yaml similarity index 74% rename from docs/api/store/components/schemas/StoreProductCategoriesListRes.yaml rename to docs/api/store/components/schemas/StoreProductTagsListRes.yaml index 0b6a32c916..405eac0731 100644 --- a/docs/api/store/components/schemas/StoreProductCategoriesListRes.yaml +++ b/docs/api/store/components/schemas/StoreProductTagsListRes.yaml @@ -1,9 +1,14 @@ type: object +required: + - product_tags + - count + - offset + - limit properties: - product_categories: + product_tags: type: array items: - $ref: ./ProductCategory.yaml + $ref: ./ProductTag.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/components/schemas/StoreProductTypesListRes.yaml b/docs/api/store/components/schemas/StoreProductTypesListRes.yaml index 4cb021af96..774ce804cc 100644 --- a/docs/api/store/components/schemas/StoreProductTypesListRes.yaml +++ b/docs/api/store/components/schemas/StoreProductTypesListRes.yaml @@ -1,4 +1,9 @@ type: object +required: + - product_types + - count + - offset + - limit properties: product_types: type: array diff --git a/docs/api/store/components/schemas/StoreProductsListRes.yaml b/docs/api/store/components/schemas/StoreProductsListRes.yaml index 976580d53a..f5b0ce9a4c 100644 --- a/docs/api/store/components/schemas/StoreProductsListRes.yaml +++ b/docs/api/store/components/schemas/StoreProductsListRes.yaml @@ -1,4 +1,21 @@ type: object +x-expanded-relations: + field: products + relations: + - collection + - images + - options + - options.values + - tags + - type + - variants + - variants.options + - variants.prices +required: + - products + - count + - offset + - limit properties: products: type: array diff --git a/docs/api/store/components/schemas/StoreProductsRes.yaml b/docs/api/store/components/schemas/StoreProductsRes.yaml index 8a64340be6..18276b4392 100644 --- a/docs/api/store/components/schemas/StoreProductsRes.yaml +++ b/docs/api/store/components/schemas/StoreProductsRes.yaml @@ -1,4 +1,18 @@ type: object +x-expanded-relations: + field: product + relations: + - collection + - images + - options + - options.values + - tags + - type + - variants + - variants.options + - variants.prices +required: + - product properties: product: $ref: ./PricedProduct.yaml diff --git a/docs/api/store/components/schemas/StoreRegionsListRes.yaml b/docs/api/store/components/schemas/StoreRegionsListRes.yaml index dc541b0eb1..429be83f52 100644 --- a/docs/api/store/components/schemas/StoreRegionsListRes.yaml +++ b/docs/api/store/components/schemas/StoreRegionsListRes.yaml @@ -1,4 +1,15 @@ type: object +x-expanded-relations: + field: regions + relations: + - countries + - payment_providers + - fulfillment_providers + eager: + - payment_providers + - fulfillment_providers +required: + - regions properties: regions: type: array diff --git a/docs/api/store/components/schemas/StoreRegionsRes.yaml b/docs/api/store/components/schemas/StoreRegionsRes.yaml index b4080ea096..f8a5d38f26 100644 --- a/docs/api/store/components/schemas/StoreRegionsRes.yaml +++ b/docs/api/store/components/schemas/StoreRegionsRes.yaml @@ -1,4 +1,15 @@ type: object +x-expanded-relations: + field: region + relations: + - countries + - payment_providers + - fulfillment_providers + eager: + - payment_providers + - fulfillment_providers +required: + - region properties: region: $ref: ./Region.yaml diff --git a/docs/api/store/components/schemas/StoreReturnReasonsListRes.yaml b/docs/api/store/components/schemas/StoreReturnReasonsListRes.yaml index c52e27f424..0f212752fc 100644 --- a/docs/api/store/components/schemas/StoreReturnReasonsListRes.yaml +++ b/docs/api/store/components/schemas/StoreReturnReasonsListRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: return_reasons + relations: + - parent_return_reason + - return_reason_children +required: + - return_reasons properties: return_reasons: type: array diff --git a/docs/api/store/components/schemas/StoreReturnReasonsRes.yaml b/docs/api/store/components/schemas/StoreReturnReasonsRes.yaml index ac6e4045bd..f5a1907b17 100644 --- a/docs/api/store/components/schemas/StoreReturnReasonsRes.yaml +++ b/docs/api/store/components/schemas/StoreReturnReasonsRes.yaml @@ -1,4 +1,11 @@ type: object +x-expanded-relations: + field: return_reason + relations: + - parent_return_reason + - return_reason_children +required: + - return_reason properties: return_reason: $ref: ./ReturnReason.yaml diff --git a/docs/api/store/components/schemas/StoreReturnsRes.yaml b/docs/api/store/components/schemas/StoreReturnsRes.yaml index 3291cf0e08..e786e22d89 100644 --- a/docs/api/store/components/schemas/StoreReturnsRes.yaml +++ b/docs/api/store/components/schemas/StoreReturnsRes.yaml @@ -1,4 +1,13 @@ type: object +x-expanded-relations: + field: return + relations: + - items + - items.reason + eager: + - items +required: + - return properties: return: $ref: ./Return.yaml diff --git a/docs/api/store/components/schemas/StoreShippingOptionsListRes.yaml b/docs/api/store/components/schemas/StoreShippingOptionsListRes.yaml index f7fe30ecaf..fab21b5ea1 100644 --- a/docs/api/store/components/schemas/StoreShippingOptionsListRes.yaml +++ b/docs/api/store/components/schemas/StoreShippingOptionsListRes.yaml @@ -1,6 +1,12 @@ type: object +x-expanded-relations: + field: shipping_options + relations: + - requirements +required: + - shipping_options properties: shipping_options: type: array items: - $ref: ./ShippingOption.yaml + $ref: ./PricedShippingOption.yaml diff --git a/docs/api/store/components/schemas/StoreSwapsRes.yaml b/docs/api/store/components/schemas/StoreSwapsRes.yaml index 3eaa21eadf..f1b319e8de 100644 --- a/docs/api/store/components/schemas/StoreSwapsRes.yaml +++ b/docs/api/store/components/schemas/StoreSwapsRes.yaml @@ -1,4 +1,21 @@ type: object +x-expanded-relations: + field: swap + relations: + - additional_items + - additional_items.variant + - cart + - fulfillments + - order + - payment + - return_order + - return_order.shipping_method + - shipping_address + - shipping_methods + eager: + - fulfillments.items +required: + - swap properties: swap: $ref: ./Swap.yaml diff --git a/docs/api/store/components/schemas/StoreVariantsListRes.yaml b/docs/api/store/components/schemas/StoreVariantsListRes.yaml index 4f6be3d191..8f824f9351 100644 --- a/docs/api/store/components/schemas/StoreVariantsListRes.yaml +++ b/docs/api/store/components/schemas/StoreVariantsListRes.yaml @@ -1,4 +1,12 @@ type: object +x-expanded-relations: + field: variants + relations: + - prices + - options + - product +required: + - variants properties: variants: type: array diff --git a/docs/api/store/components/schemas/StoreVariantsRes.yaml b/docs/api/store/components/schemas/StoreVariantsRes.yaml index 7fed2ab768..04ab6f681e 100644 --- a/docs/api/store/components/schemas/StoreVariantsRes.yaml +++ b/docs/api/store/components/schemas/StoreVariantsRes.yaml @@ -1,4 +1,12 @@ type: object +x-expanded-relations: + field: variant + relations: + - prices + - options + - product +required: + - variant properties: variant: $ref: ./PricedVariant.yaml diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 4097c80001..1250218303 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -381,147 +381,147 @@ tags: description: >- Auth endpoints that allow authorization of customers and manages their sessions. - - name: Cart + - name: Carts description: Cart endpoints that allow handling carts in Medusa. - - name: Collection + - name: Collections description: Collection endpoints that allow handling collections in Medusa. - - name: Customer + - name: Customers description: Customer endpoints that allow handling customers in Medusa. - - name: Gift Card + - name: Gift Cards description: Gift Card endpoints that allow handling gift cards in Medusa. - - name: Order + - name: Orders description: Order endpoints that allow handling orders in Medusa. - - name: Product + - name: Products description: Product endpoints that allow handling products in Medusa. - - name: Product Variant + - name: Product Variants description: Product Variant endpoints that allow handling product variants in Medusa. - - name: Region + - name: Regions description: Region endpoints that allow handling regions in Medusa. - - name: Return Reason + - name: Return Reasons description: Return Reason endpoints that allow handling return reasons in Medusa. - - name: Return + - name: Returns description: Return endpoints that allow handling returns in Medusa. - - name: Shipping Option + - name: Shipping Options description: Shipping Option endpoints that allow handling shipping options in Medusa. - - name: Swap + - name: Swaps description: Swap endpoints that allow handling swaps in Medusa. servers: - - url: https://api.medusa-commerce.com/store + - url: https://api.medusa-commerce.com paths: - /auth: - $ref: paths/auth.yaml - /auth/{email}: - $ref: paths/auth_{email}.yaml - /carts/{id}/shipping-methods: - $ref: paths/carts_{id}_shipping-methods.yaml - /carts/{id}/taxes: - $ref: paths/carts_{id}_taxes.yaml - /carts/{id}/complete: - $ref: paths/carts_{id}_complete.yaml - /carts: - $ref: paths/carts.yaml - /carts/{id}/payment-sessions: - $ref: paths/carts_{id}_payment-sessions.yaml - /carts/{id}/discounts/{code}: - $ref: paths/carts_{id}_discounts_{code}.yaml - /carts/{id}/line-items/{line_id}: - $ref: paths/carts_{id}_line-items_{line_id}.yaml - /carts/{id}/payment-sessions/{provider_id}: - $ref: paths/carts_{id}_payment-sessions_{provider_id}.yaml - /carts/{id}: - $ref: paths/carts_{id}.yaml - /carts/{id}/payment-sessions/{provider_id}/refresh: - $ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml - /carts/{id}/payment-session: - $ref: paths/carts_{id}_payment-session.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /collections: - $ref: paths/collections.yaml - /customers/me/addresses: - $ref: paths/customers_me_addresses.yaml - /customers: - $ref: paths/customers.yaml - /customers/me/addresses/{address_id}: - $ref: paths/customers_me_addresses_{address_id}.yaml - /customers/me: - $ref: paths/customers_me.yaml - /customers/me/payment-methods: - $ref: paths/customers_me_payment-methods.yaml - /customers/me/orders: - $ref: paths/customers_me_orders.yaml - /customers/password-token: - $ref: paths/customers_password-token.yaml - /customers/password-reset: - $ref: paths/customers_password-reset.yaml - /gift-cards/{code}: - $ref: paths/gift-cards_{code}.yaml - /order-edits/{id}/complete: - $ref: paths/order-edits_{id}_complete.yaml - /order-edits/{id}/decline: - $ref: paths/order-edits_{id}_decline.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml - /orders/customer/confirm: - $ref: paths/orders_customer_confirm.yaml - /orders/cart/{cart_id}: - $ref: paths/orders_cart_{cart_id}.yaml - /orders/{id}: - $ref: paths/orders_{id}.yaml - /orders: - $ref: paths/orders.yaml - /orders/batch/customer/token: - $ref: paths/orders_batch_customer_token.yaml - /payment-collections/{id}/sessions/batch/authorize: - $ref: paths/payment-collections_{id}_sessions_batch_authorize.yaml - /payment-collections/{id}/sessions/{session_id}/authorize: - $ref: paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml - /payment-collections/{id}: - $ref: paths/payment-collections_{id}.yaml - /payment-collections/{id}/sessions/batch: - $ref: paths/payment-collections_{id}_sessions_batch.yaml - /payment-collections/{id}/sessions: - $ref: paths/payment-collections_{id}_sessions.yaml - /payment-collections/{id}/sessions/{session_id}: - $ref: paths/payment-collections_{id}_sessions_{session_id}.yaml - /product-categories/{id}: - $ref: paths/product-categories_{id}.yaml - /product-categories: - $ref: paths/product-categories.yaml - /product-tags: - $ref: paths/product-tags.yaml - /product-types: - $ref: paths/product-types.yaml - /products/{id}: - $ref: paths/products_{id}.yaml - /products: - $ref: paths/products.yaml - /products/search: - $ref: paths/products_search.yaml - /regions/{id}: - $ref: paths/regions_{id}.yaml - /regions: - $ref: paths/regions.yaml - /return-reasons/{id}: - $ref: paths/return-reasons_{id}.yaml - /return-reasons: - $ref: paths/return-reasons.yaml - /returns: - $ref: paths/returns.yaml - /shipping-options: - $ref: paths/shipping-options.yaml - /shipping-options/{cart_id}: - $ref: paths/shipping-options_{cart_id}.yaml - /swaps: - $ref: paths/swaps.yaml - /swaps/{cart_id}: - $ref: paths/swaps_{cart_id}.yaml - /variants/{variant_id}: - $ref: paths/variants_{variant_id}.yaml - /variants: - $ref: paths/variants.yaml - /carts/{id}/line-items: - $ref: paths/carts_{id}_line-items.yaml + /store/auth: + $ref: paths/store_auth.yaml + /store/auth/{email}: + $ref: paths/store_auth_{email}.yaml + /store/carts: + $ref: paths/store_carts.yaml + /store/carts/{id}: + $ref: paths/store_carts_{id}.yaml + /store/carts/{id}/complete: + $ref: paths/store_carts_{id}_complete.yaml + /store/carts/{id}/discounts/{code}: + $ref: paths/store_carts_{id}_discounts_{code}.yaml + /store/carts/{id}/line-items: + $ref: paths/store_carts_{id}_line-items.yaml + /store/carts/{id}/line-items/{line_id}: + $ref: paths/store_carts_{id}_line-items_{line_id}.yaml + /store/carts/{id}/payment-session: + $ref: paths/store_carts_{id}_payment-session.yaml + /store/carts/{id}/payment-sessions: + $ref: paths/store_carts_{id}_payment-sessions.yaml + /store/carts/{id}/payment-sessions/{provider_id}: + $ref: paths/store_carts_{id}_payment-sessions_{provider_id}.yaml + /store/carts/{id}/payment-sessions/{provider_id}/refresh: + $ref: paths/store_carts_{id}_payment-sessions_{provider_id}_refresh.yaml + /store/carts/{id}/shipping-methods: + $ref: paths/store_carts_{id}_shipping-methods.yaml + /store/carts/{id}/taxes: + $ref: paths/store_carts_{id}_taxes.yaml + /store/collections: + $ref: paths/store_collections.yaml + /store/collections/{id}: + $ref: paths/store_collections_{id}.yaml + /store/customers: + $ref: paths/store_customers.yaml + /store/customers/me: + $ref: paths/store_customers_me.yaml + /store/customers/me/addresses: + $ref: paths/store_customers_me_addresses.yaml + /store/customers/me/addresses/{address_id}: + $ref: paths/store_customers_me_addresses_{address_id}.yaml + /store/customers/me/orders: + $ref: paths/store_customers_me_orders.yaml + /store/customers/me/payment-methods: + $ref: paths/store_customers_me_payment-methods.yaml + /store/customers/password-reset: + $ref: paths/store_customers_password-reset.yaml + /store/customers/password-token: + $ref: paths/store_customers_password-token.yaml + /store/gift-cards/{code}: + $ref: paths/store_gift-cards_{code}.yaml + /store/order-edits/{id}: + $ref: paths/store_order-edits_{id}.yaml + /store/order-edits/{id}/complete: + $ref: paths/store_order-edits_{id}_complete.yaml + /store/order-edits/{id}/decline: + $ref: paths/store_order-edits_{id}_decline.yaml + /store/orders: + $ref: paths/store_orders.yaml + /store/orders/batch/customer/token: + $ref: paths/store_orders_batch_customer_token.yaml + /store/orders/cart/{cart_id}: + $ref: paths/store_orders_cart_{cart_id}.yaml + /store/orders/customer/confirm: + $ref: paths/store_orders_customer_confirm.yaml + /store/orders/{id}: + $ref: paths/store_orders_{id}.yaml + /store/payment-collections/{id}: + $ref: paths/store_payment-collections_{id}.yaml + /store/payment-collections/{id}/sessions: + $ref: paths/store_payment-collections_{id}_sessions.yaml + /store/payment-collections/{id}/sessions/batch: + $ref: paths/store_payment-collections_{id}_sessions_batch.yaml + /store/payment-collections/{id}/sessions/batch/authorize: + $ref: paths/store_payment-collections_{id}_sessions_batch_authorize.yaml + /store/payment-collections/{id}/sessions/{session_id}: + $ref: paths/store_payment-collections_{id}_sessions_{session_id}.yaml + /store/payment-collections/{id}/sessions/{session_id}/authorize: + $ref: paths/store_payment-collections_{id}_sessions_{session_id}_authorize.yaml + /store/product-categories: + $ref: paths/store_product-categories.yaml + /store/product-categories/{id}: + $ref: paths/store_product-categories_{id}.yaml + /store/product-tags: + $ref: paths/store_product-tags.yaml + /store/product-types: + $ref: paths/store_product-types.yaml + /store/products: + $ref: paths/store_products.yaml + /store/products/search: + $ref: paths/store_products_search.yaml + /store/products/{id}: + $ref: paths/store_products_{id}.yaml + /store/regions: + $ref: paths/store_regions.yaml + /store/regions/{id}: + $ref: paths/store_regions_{id}.yaml + /store/return-reasons: + $ref: paths/store_return-reasons.yaml + /store/return-reasons/{id}: + $ref: paths/store_return-reasons_{id}.yaml + /store/returns: + $ref: paths/store_returns.yaml + /store/shipping-options: + $ref: paths/store_shipping-options.yaml + /store/shipping-options/{cart_id}: + $ref: paths/store_shipping-options_{cart_id}.yaml + /store/swaps: + $ref: paths/store_swaps.yaml + /store/swaps/{cart_id}: + $ref: paths/store_swaps_{cart_id}.yaml + /store/variants: + $ref: paths/store_variants.yaml + /store/variants/{variant_id}: + $ref: paths/store_variants_{variant_id}.yaml components: securitySchemes: cookie_auth: diff --git a/docs/api/store/paths/auth.yaml b/docs/api/store/paths/store_auth.yaml similarity index 90% rename from docs/api/store/paths/auth.yaml rename to docs/api/store/paths/store_auth.yaml index e6b8bdfa0f..7cb59f50a9 100644 --- a/docs/api/store/paths/auth.yaml +++ b/docs/api/store/paths/store_auth.yaml @@ -1,3 +1,42 @@ +get: + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/store_auth/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_auth/get.sh + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreAuthRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml post: operationId: PostAuth summary: Customer Login @@ -15,11 +54,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/post.js + $ref: ../code_samples/JavaScript/store_auth/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/post.sh + $ref: ../code_samples/Shell/store_auth/post.sh tags: - Auth responses: @@ -52,7 +91,7 @@ delete: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/delete.sh + $ref: ../code_samples/Shell/store_auth/delete.sh security: - cookie_auth: [] tags: @@ -72,42 +111,3 @@ delete: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml -get: - operationId: GetAuth - summary: Get Current Customer - description: Gets the currently logged in Customer. - x-authenticated: true - x-codegen: - method: getSession - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/auth/get.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/auth/get.sh - security: - - cookie_auth: [] - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/StoreAuthRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml diff --git a/docs/api/store/paths/auth_{email}.yaml b/docs/api/store/paths/store_auth_{email}.yaml similarity index 88% rename from docs/api/store/paths/auth_{email}.yaml rename to docs/api/store/paths/store_auth_{email}.yaml index fb414e798e..b02b775028 100644 --- a/docs/api/store/paths/auth_{email}.yaml +++ b/docs/api/store/paths/store_auth_{email}.yaml @@ -16,11 +16,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth_{email}/get.js + $ref: ../code_samples/JavaScript/store_auth_{email}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth_{email}/get.sh + $ref: ../code_samples/Shell/store_auth_{email}/get.sh tags: - Auth responses: diff --git a/docs/api/store/paths/carts.yaml b/docs/api/store/paths/store_carts.yaml similarity index 90% rename from docs/api/store/paths/carts.yaml rename to docs/api/store/paths/store_carts.yaml index abce30a7cb..5925c934d4 100644 --- a/docs/api/store/paths/carts.yaml +++ b/docs/api/store/paths/store_carts.yaml @@ -17,13 +17,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts/post.js + $ref: ../code_samples/JavaScript/store_carts/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts/post.sh + $ref: ../code_samples/Shell/store_carts/post.sh tags: - - Cart + - Carts responses: '200': description: Successfully created a new Cart diff --git a/docs/api/store/paths/carts_{id}.yaml b/docs/api/store/paths/store_carts_{id}.yaml similarity index 87% rename from docs/api/store/paths/carts_{id}.yaml rename to docs/api/store/paths/store_carts_{id}.yaml index 6b2602f54e..1b46a1d457 100644 --- a/docs/api/store/paths/carts_{id}.yaml +++ b/docs/api/store/paths/store_carts_{id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}/get.js + $ref: ../code_samples/JavaScript/store_carts_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}/get.sh + $ref: ../code_samples/Shell/store_carts_{id}/get.sh tags: - - Cart + - Carts responses: '200': description: OK @@ -61,13 +61,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}/post.js + $ref: ../code_samples/JavaScript/store_carts_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}/post.sh + $ref: ../code_samples/Shell/store_carts_{id}/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_complete.yaml b/docs/api/store/paths/store_carts_{id}_complete.yaml similarity index 91% rename from docs/api/store/paths/carts_{id}_complete.yaml rename to docs/api/store/paths/store_carts_{id}_complete.yaml index ce23f42808..2113e2d024 100644 --- a/docs/api/store/paths/carts_{id}_complete.yaml +++ b/docs/api/store/paths/store_carts_{id}_complete.yaml @@ -21,13 +21,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_complete/post.js + $ref: ../code_samples/JavaScript/store_carts_{id}_complete/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_complete/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_complete/post.sh tags: - - Cart + - Carts responses: '200': description: >- diff --git a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml b/docs/api/store/paths/store_carts_{id}_discounts_{code}.yaml similarity index 85% rename from docs/api/store/paths/carts_{id}_discounts_{code}.yaml rename to docs/api/store/paths/store_carts_{id}_discounts_{code}.yaml index 56b4494909..740838c76b 100644 --- a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml +++ b/docs/api/store/paths/store_carts_{id}_discounts_{code}.yaml @@ -21,13 +21,13 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_discounts_{code}/delete.js + $ref: ../code_samples/JavaScript/store_carts_{id}_discounts_{code}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_discounts_{code}/delete.sh + $ref: ../code_samples/Shell/store_carts_{id}_discounts_{code}/delete.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_line-items.yaml b/docs/api/store/paths/store_carts_{id}_line-items.yaml similarity index 87% rename from docs/api/store/paths/carts_{id}_line-items.yaml rename to docs/api/store/paths/store_carts_{id}_line-items.yaml index 268a70bac2..c542c8af12 100644 --- a/docs/api/store/paths/carts_{id}_line-items.yaml +++ b/docs/api/store/paths/store_carts_{id}_line-items.yaml @@ -20,13 +20,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_line-items/post.js + $ref: ../code_samples/JavaScript/store_carts_{id}_line-items/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_line-items/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_line-items/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml b/docs/api/store/paths/store_carts_{id}_line-items_{line_id}.yaml similarity index 85% rename from docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml rename to docs/api/store/paths/store_carts_{id}_line-items_{line_id}.yaml index b2e1b8c367..bd9d50e7a3 100644 --- a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml +++ b/docs/api/store/paths/store_carts_{id}_line-items_{line_id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - x-codegen: - method: deleteLineItem - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/carts_{id}_line-items_{line_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/carts_{id}_line-items_{line_id}/delete.sh - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/StoreCartsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostCartsCartLineItemsItem summary: Update a Line Item @@ -73,13 +26,62 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_line-items_{line_id}/post.js + $ref: >- + ../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_line-items_{line_id}/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_line-items_{line_id}/post.sh tags: - - Cart + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codegen: + method: deleteLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_carts_{id}_line-items_{line_id}/delete.sh + tags: + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_payment-session.yaml b/docs/api/store/paths/store_carts_{id}_payment-session.yaml similarity index 87% rename from docs/api/store/paths/carts_{id}_payment-session.yaml rename to docs/api/store/paths/store_carts_{id}_payment-session.yaml index f6a044fb97..248f6c3733 100644 --- a/docs/api/store/paths/carts_{id}_payment-session.yaml +++ b/docs/api/store/paths/store_carts_{id}_payment-session.yaml @@ -22,13 +22,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_payment-session/post.js + $ref: ../code_samples/JavaScript/store_carts_{id}_payment-session/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_payment-session/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_payment-session/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_payment-sessions.yaml b/docs/api/store/paths/store_carts_{id}_payment-sessions.yaml similarity index 85% rename from docs/api/store/paths/carts_{id}_payment-sessions.yaml rename to docs/api/store/paths/store_carts_{id}_payment-sessions.yaml index 92f77fa1d9..22ef8e378f 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions.yaml +++ b/docs/api/store/paths/store_carts_{id}_payment-sessions.yaml @@ -17,13 +17,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_payment-sessions/post.js + $ref: ../code_samples/JavaScript/store_carts_{id}_payment-sessions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_payment-sessions/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_payment-sessions/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml b/docs/api/store/paths/store_carts_{id}_payment-sessions_{provider_id}.yaml similarity index 86% rename from docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml rename to docs/api/store/paths/store_carts_{id}_payment-sessions_{provider_id}.yaml index 03220c3c5f..5d8877f3f2 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml +++ b/docs/api/store/paths/store_carts_{id}_payment-sessions_{provider_id}.yaml @@ -1,54 +1,3 @@ -delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session - description: Deletes a Payment Session on a Cart. May be useful if a payment has failed. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: >- - The id of the Payment Provider used to create the Payment Session to be - deleted. - schema: - type: string - x-codegen: - method: deletePaymentSession - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: >- - ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/delete.sh - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/StoreCartsRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostCartsCartPaymentSessionUpdate summary: Update a Payment Session @@ -78,14 +27,65 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js + ../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/post.sh + ../code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/post.sh tags: - - Cart + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: Deletes a Payment Session on a Cart. May be useful if a payment has failed. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: >- + The id of the Payment Provider used to create the Payment Session to be + deleted. + schema: + type: string + x-codegen: + method: deletePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}/delete.sh + tags: + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml b/docs/api/store/paths/store_carts_{id}_payment-sessions_{provider_id}_refresh.yaml similarity index 86% rename from docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml rename to docs/api/store/paths/store_carts_{id}_payment-sessions_{provider_id}_refresh.yaml index 1d054b5d08..13808738e2 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml +++ b/docs/api/store/paths/store_carts_{id}_payment-sessions_{provider_id}_refresh.yaml @@ -26,14 +26,14 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/post.js + ../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/post.sh + ../code_samples/Shell/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_shipping-methods.yaml b/docs/api/store/paths/store_carts_{id}_shipping-methods.yaml similarity index 86% rename from docs/api/store/paths/carts_{id}_shipping-methods.yaml rename to docs/api/store/paths/store_carts_{id}_shipping-methods.yaml index 9151a80e1a..cc7833976c 100644 --- a/docs/api/store/paths/carts_{id}_shipping-methods.yaml +++ b/docs/api/store/paths/store_carts_{id}_shipping-methods.yaml @@ -20,13 +20,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_shipping-methods/post.js + $ref: ../code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_shipping-methods/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_shipping-methods/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/carts_{id}_taxes.yaml b/docs/api/store/paths/store_carts_{id}_taxes.yaml similarity index 92% rename from docs/api/store/paths/carts_{id}_taxes.yaml rename to docs/api/store/paths/store_carts_{id}_taxes.yaml index 21591b1d43..994b1daffd 100644 --- a/docs/api/store/paths/carts_{id}_taxes.yaml +++ b/docs/api/store/paths/store_carts_{id}_taxes.yaml @@ -17,9 +17,9 @@ post: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_taxes/post.sh + $ref: ../code_samples/Shell/store_carts_{id}_taxes/post.sh tags: - - Cart + - Carts responses: '200': description: OK diff --git a/docs/api/store/paths/collections.yaml b/docs/api/store/paths/store_collections.yaml similarity index 88% rename from docs/api/store/paths/collections.yaml rename to docs/api/store/paths/store_collections.yaml index 22d770bca8..3ebc694a93 100644 --- a/docs/api/store/paths/collections.yaml +++ b/docs/api/store/paths/store_collections.yaml @@ -17,6 +17,15 @@ get: schema: type: integer default: 10 + - in: query + name: handle + style: form + explode: false + description: Filter by the collection handle + schema: + type: array + items: + type: string - in: query name: created_at description: Date comparison for when resulting collections were created. @@ -68,13 +77,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections/get.js + $ref: ../code_samples/JavaScript/store_collections/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections/get.sh + $ref: ../code_samples/Shell/store_collections/get.sh tags: - - Collection + - Collections responses: '200': description: OK diff --git a/docs/api/store/paths/collections_{id}.yaml b/docs/api/store/paths/store_collections_{id}.yaml similarity index 85% rename from docs/api/store/paths/collections_{id}.yaml rename to docs/api/store/paths/store_collections_{id}.yaml index 0ea79a1461..57782abd2c 100644 --- a/docs/api/store/paths/collections_{id}.yaml +++ b/docs/api/store/paths/store_collections_{id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/get.js + $ref: ../code_samples/JavaScript/store_collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/get.sh + $ref: ../code_samples/Shell/store_collections_{id}/get.sh tags: - - Collection + - Collections responses: '200': description: OK diff --git a/docs/api/store/paths/customers.yaml b/docs/api/store/paths/store_customers.yaml similarity index 91% rename from docs/api/store/paths/customers.yaml rename to docs/api/store/paths/store_customers.yaml index 68378b419c..4d1c1131b1 100644 --- a/docs/api/store/paths/customers.yaml +++ b/docs/api/store/paths/store_customers.yaml @@ -13,13 +13,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers/post.js + $ref: ../code_samples/JavaScript/store_customers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers/post.sh + $ref: ../code_samples/Shell/store_customers/post.sh tags: - - Customer + - Customers responses: '200': description: OK diff --git a/docs/api/store/paths/customers_me.yaml b/docs/api/store/paths/store_customers_me.yaml similarity index 87% rename from docs/api/store/paths/customers_me.yaml rename to docs/api/store/paths/store_customers_me.yaml index ac589e5ce1..b09af257ae 100644 --- a/docs/api/store/paths/customers_me.yaml +++ b/docs/api/store/paths/store_customers_me.yaml @@ -11,15 +11,15 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me/get.js + $ref: ../code_samples/JavaScript/store_customers_me/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me/get.sh + $ref: ../code_samples/Shell/store_customers_me/get.sh security: - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK @@ -55,15 +55,15 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me/post.js + $ref: ../code_samples/JavaScript/store_customers_me/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me/post.sh + $ref: ../code_samples/Shell/store_customers_me/post.sh security: - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK diff --git a/docs/api/store/paths/customers_me_addresses.yaml b/docs/api/store/paths/store_customers_me_addresses.yaml similarity index 87% rename from docs/api/store/paths/customers_me_addresses.yaml rename to docs/api/store/paths/store_customers_me_addresses.yaml index ba83e00c9b..841ec61ba6 100644 --- a/docs/api/store/paths/customers_me_addresses.yaml +++ b/docs/api/store/paths/store_customers_me_addresses.yaml @@ -14,15 +14,15 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_addresses/post.js + $ref: ../code_samples/JavaScript/store_customers_me_addresses/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_addresses/post.sh + $ref: ../code_samples/Shell/store_customers_me_addresses/post.sh security: - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: A successful response diff --git a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml b/docs/api/store/paths/store_customers_me_addresses_{address_id}.yaml similarity index 85% rename from docs/api/store/paths/customers_me_addresses_{address_id}.yaml rename to docs/api/store/paths/store_customers_me_addresses_{address_id}.yaml index 9b0b70531a..94b1dd6731 100644 --- a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml +++ b/docs/api/store/paths/store_customers_me_addresses_{address_id}.yaml @@ -1,50 +1,3 @@ -delete: - operationId: DeleteCustomersCustomerAddressesAddress - summary: Delete an Address - description: Removes an Address from the Customer's saved addresses. - x-authenticated: true - parameters: - - in: path - name: address_id - required: true - description: The id of the Address to remove. - schema: - type: string - x-codegen: - method: deleteAddress - x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/customers_me_addresses_{address_id}/delete.js - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/customers_me_addresses_{address_id}/delete.sh - security: - - cookie_auth: [] - tags: - - Customer - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/StoreCustomersRes.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml post: operationId: PostCustomersCustomerAddressesAddress summary: Update a Shipping Address @@ -69,15 +22,65 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_addresses_{address_id}/post.js + $ref: >- + ../code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_addresses_{address_id}/post.sh + $ref: >- + ../code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh security: - cookie_auth: [] tags: - - Customer + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCustomersRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresses. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string + x-codegen: + method: deleteAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh + security: + - cookie_auth: [] + tags: + - Customers responses: '200': description: OK diff --git a/docs/api/store/paths/customers_me_orders.yaml b/docs/api/store/paths/store_customers_me_orders.yaml similarity index 97% rename from docs/api/store/paths/customers_me_orders.yaml rename to docs/api/store/paths/store_customers_me_orders.yaml index b58425bcb1..960f944c96 100644 --- a/docs/api/store/paths/customers_me_orders.yaml +++ b/docs/api/store/paths/store_customers_me_orders.yaml @@ -175,15 +175,15 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_orders/get.js + $ref: ../code_samples/JavaScript/store_customers_me_orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_orders/get.sh + $ref: ../code_samples/Shell/store_customers_me_orders/get.sh security: - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK diff --git a/docs/api/store/paths/customers_me_payment-methods.yaml b/docs/api/store/paths/store_customers_me_payment-methods.yaml similarity index 86% rename from docs/api/store/paths/customers_me_payment-methods.yaml rename to docs/api/store/paths/store_customers_me_payment-methods.yaml index 96f715aad0..3f5dcd6639 100644 --- a/docs/api/store/paths/customers_me_payment-methods.yaml +++ b/docs/api/store/paths/store_customers_me_payment-methods.yaml @@ -12,15 +12,15 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_payment-methods/get.js + $ref: ../code_samples/JavaScript/store_customers_me_payment-methods/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_payment-methods/get.sh + $ref: ../code_samples/Shell/store_customers_me_payment-methods/get.sh security: - cookie_auth: [] tags: - - Customer + - Customers responses: '200': description: OK diff --git a/docs/api/store/paths/customers_password-reset.yaml b/docs/api/store/paths/store_customers_password-reset.yaml similarity index 80% rename from docs/api/store/paths/customers_password-reset.yaml rename to docs/api/store/paths/store_customers_password-reset.yaml index 8ae3b378c6..78f71d059f 100644 --- a/docs/api/store/paths/customers_password-reset.yaml +++ b/docs/api/store/paths/store_customers_password-reset.yaml @@ -15,20 +15,20 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_password-reset/post.js + $ref: ../code_samples/JavaScript/store_customers_password-reset/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_password-reset/post.sh + $ref: ../code_samples/Shell/store_customers_password-reset/post.sh tags: - - Customer + - Customers responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/StoreCustomersRes.yaml + $ref: ../components/schemas/StoreCustomersResetPasswordRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_password-token.yaml b/docs/api/store/paths/store_customers_password-token.yaml similarity index 86% rename from docs/api/store/paths/customers_password-token.yaml rename to docs/api/store/paths/store_customers_password-token.yaml index f010c0f30d..f49a22542c 100644 --- a/docs/api/store/paths/customers_password-token.yaml +++ b/docs/api/store/paths/store_customers_password-token.yaml @@ -17,13 +17,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_password-token/post.js + $ref: ../code_samples/JavaScript/store_customers_password-token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_password-token/post.sh + $ref: ../code_samples/Shell/store_customers_password-token/post.sh tags: - - Customer + - Customers responses: '204': description: OK diff --git a/docs/api/store/paths/gift-cards_{code}.yaml b/docs/api/store/paths/store_gift-cards_{code}.yaml similarity index 86% rename from docs/api/store/paths/gift-cards_{code}.yaml rename to docs/api/store/paths/store_gift-cards_{code}.yaml index 61acd5b360..dfba240fbb 100644 --- a/docs/api/store/paths/gift-cards_{code}.yaml +++ b/docs/api/store/paths/store_gift-cards_{code}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{code}/get.js + $ref: ../code_samples/JavaScript/store_gift-cards_{code}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{code}/get.sh + $ref: ../code_samples/Shell/store_gift-cards_{code}/get.sh tags: - - Gift Card + - Gift Cards responses: '200': description: OK diff --git a/docs/api/store/paths/order-edits_{id}.yaml b/docs/api/store/paths/store_order-edits_{id}.yaml similarity index 86% rename from docs/api/store/paths/order-edits_{id}.yaml rename to docs/api/store/paths/store_order-edits_{id}.yaml index 971517ac96..4d77c09cf4 100644 --- a/docs/api/store/paths/order-edits_{id}.yaml +++ b/docs/api/store/paths/store_order-edits_{id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/get.js + $ref: ../code_samples/JavaScript/store_order-edits_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/get.sh + $ref: ../code_samples/Shell/store_order-edits_{id}/get.sh tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/store/paths/order-edits_{id}_complete.yaml b/docs/api/store/paths/store_order-edits_{id}_complete.yaml similarity index 83% rename from docs/api/store/paths/order-edits_{id}_complete.yaml rename to docs/api/store/paths/store_order-edits_{id}_complete.yaml index 97cff00d7b..39d132b04a 100644 --- a/docs/api/store/paths/order-edits_{id}_complete.yaml +++ b/docs/api/store/paths/store_order-edits_{id}_complete.yaml @@ -15,13 +15,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_complete/post.js + $ref: ../code_samples/JavaScript/store_order-edits_{id}_complete/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_complete/post.sh + $ref: ../code_samples/Shell/store_order-edits_{id}_complete/post.sh tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/store/paths/order-edits_{id}_decline.yaml b/docs/api/store/paths/store_order-edits_{id}_decline.yaml similarity index 85% rename from docs/api/store/paths/order-edits_{id}_decline.yaml rename to docs/api/store/paths/store_order-edits_{id}_decline.yaml index 47292e7f17..94fdff9486 100644 --- a/docs/api/store/paths/order-edits_{id}_decline.yaml +++ b/docs/api/store/paths/store_order-edits_{id}_decline.yaml @@ -20,13 +20,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_decline/post.js + $ref: ../code_samples/JavaScript/store_order-edits_{id}_decline/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_decline/post.sh + $ref: ../code_samples/Shell/store_order-edits_{id}_decline/post.sh tags: - - OrderEdit + - Order Edits responses: '200': description: OK diff --git a/docs/api/store/paths/orders.yaml b/docs/api/store/paths/store_orders.yaml similarity index 93% rename from docs/api/store/paths/orders.yaml rename to docs/api/store/paths/store_orders.yaml index bcf397aff9..9479e9bbc0 100644 --- a/docs/api/store/paths/orders.yaml +++ b/docs/api/store/paths/store_orders.yaml @@ -46,13 +46,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders/get.js + $ref: ../code_samples/JavaScript/store_orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders/get.sh + $ref: ../code_samples/Shell/store_orders/get.sh tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/store/paths/orders_batch_customer_token.yaml b/docs/api/store/paths/store_orders_batch_customer_token.yaml similarity index 85% rename from docs/api/store/paths/orders_batch_customer_token.yaml rename to docs/api/store/paths/store_orders_batch_customer_token.yaml index 71f6cfb30e..e8346ff429 100644 --- a/docs/api/store/paths/orders_batch_customer_token.yaml +++ b/docs/api/store/paths/store_orders_batch_customer_token.yaml @@ -15,16 +15,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_batch_customer_token/post.js + $ref: ../code_samples/JavaScript/store_orders_batch_customer_token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_batch_customer_token/post.sh + $ref: ../code_samples/Shell/store_orders_batch_customer_token/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Orders responses: '200': description: OK diff --git a/docs/api/store/paths/orders_cart_{cart_id}.yaml b/docs/api/store/paths/store_orders_cart_{cart_id}.yaml similarity index 85% rename from docs/api/store/paths/orders_cart_{cart_id}.yaml rename to docs/api/store/paths/store_orders_cart_{cart_id}.yaml index 296e93bc86..30780eb6ce 100644 --- a/docs/api/store/paths/orders_cart_{cart_id}.yaml +++ b/docs/api/store/paths/store_orders_cart_{cart_id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_cart_{cart_id}/get.js + $ref: ../code_samples/JavaScript/store_orders_cart_{cart_id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_cart_{cart_id}/get.sh + $ref: ../code_samples/Shell/store_orders_cart_{cart_id}/get.sh tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/store/paths/orders_customer_confirm.yaml b/docs/api/store/paths/store_orders_customer_confirm.yaml similarity index 86% rename from docs/api/store/paths/orders_customer_confirm.yaml rename to docs/api/store/paths/store_orders_customer_confirm.yaml index 9fba54cfd5..e9b166bac6 100644 --- a/docs/api/store/paths/orders_customer_confirm.yaml +++ b/docs/api/store/paths/store_orders_customer_confirm.yaml @@ -15,16 +15,16 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_customer_confirm/post.js + $ref: ../code_samples/JavaScript/store_orders_customer_confirm/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_customer_confirm/post.sh + $ref: ../code_samples/Shell/store_orders_customer_confirm/post.sh security: - api_token: [] - cookie_auth: [] tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/store/paths/orders_{id}.yaml b/docs/api/store/paths/store_orders_{id}.yaml similarity index 89% rename from docs/api/store/paths/orders_{id}.yaml rename to docs/api/store/paths/store_orders_{id}.yaml index d511afd673..10f587f07d 100644 --- a/docs/api/store/paths/orders_{id}.yaml +++ b/docs/api/store/paths/store_orders_{id}.yaml @@ -25,13 +25,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}/get.js + $ref: ../code_samples/JavaScript/store_orders_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}/get.sh + $ref: ../code_samples/Shell/store_orders_{id}/get.sh tags: - - Order + - Orders responses: '200': description: OK diff --git a/docs/api/store/paths/payment-collections_{id}.yaml b/docs/api/store/paths/store_payment-collections_{id}.yaml similarity index 86% rename from docs/api/store/paths/payment-collections_{id}.yaml rename to docs/api/store/paths/store_payment-collections_{id}.yaml index 8c6cf5f81c..fd4b2aa306 100644 --- a/docs/api/store/paths/payment-collections_{id}.yaml +++ b/docs/api/store/paths/store_payment-collections_{id}.yaml @@ -22,21 +22,21 @@ get: type: string x-codegen: method: retrieve - queryParams: GetPaymentCollectionsParams + queryParams: StoreGetPaymentCollectionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}/get.js + $ref: ../code_samples/JavaScript/store_payment-collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/get.sh + $ref: ../code_samples/Shell/store_payment-collections_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/store/paths/payment-collections_{id}_sessions.yaml b/docs/api/store/paths/store_payment-collections_{id}_sessions.yaml similarity index 85% rename from docs/api/store/paths/payment-collections_{id}_sessions.yaml rename to docs/api/store/paths/store_payment-collections_{id}_sessions.yaml index ad8cf6c210..24230b7395 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions.yaml +++ b/docs/api/store/paths/store_payment-collections_{id}_sessions.yaml @@ -21,16 +21,17 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}_sessions/post.js + $ref: >- + ../code_samples/JavaScript/store_payment-collections_{id}_sessions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}_sessions/post.sh + $ref: ../code_samples/Shell/store_payment-collections_{id}_sessions/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml b/docs/api/store/paths/store_payment-collections_{id}_sessions_batch.yaml similarity index 86% rename from docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml rename to docs/api/store/paths/store_payment-collections_{id}_sessions_batch.yaml index 15c827e38f..c894269f3b 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml +++ b/docs/api/store/paths/store_payment-collections_{id}_sessions_batch.yaml @@ -23,16 +23,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js + ../code_samples/JavaScript/store_payment-collections_{id}_sessions_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}_sessions_batch/post.sh + $ref: >- + ../code_samples/Shell/store_payment-collections_{id}_sessions_batch/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml b/docs/api/store/paths/store_payment-collections_{id}_sessions_batch_authorize.yaml similarity index 86% rename from docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml rename to docs/api/store/paths/store_payment-collections_{id}_sessions_batch_authorize.yaml index 14eaf4a628..a3bb6178f7 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml +++ b/docs/api/store/paths/store_payment-collections_{id}_sessions_batch_authorize.yaml @@ -23,17 +23,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/post.js + ../code_samples/JavaScript/store_payment-collections_{id}_sessions_batch_authorize/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/post.sh + ../code_samples/Shell/store_payment-collections_{id}_sessions_batch_authorize/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml b/docs/api/store/paths/store_payment-collections_{id}_sessions_{session_id}.yaml similarity index 85% rename from docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml rename to docs/api/store/paths/store_payment-collections_{id}_sessions_{session_id}.yaml index fb1fb511c5..746d8cec0c 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml +++ b/docs/api/store/paths/store_payment-collections_{id}_sessions_{session_id}.yaml @@ -25,14 +25,14 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/post.js + ../code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}/post.sh + ../code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}/post.sh tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml b/docs/api/store/paths/store_payment-collections_{id}_sessions_{session_id}_authorize.yaml similarity index 85% rename from docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml rename to docs/api/store/paths/store_payment-collections_{id}_sessions_{session_id}_authorize.yaml index 70064e284b..3d41bc7feb 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml +++ b/docs/api/store/paths/store_payment-collections_{id}_sessions_{session_id}_authorize.yaml @@ -23,17 +23,17 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/post.js + ../code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}_authorize/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/post.sh + ../code_samples/Shell/store_payment-collections_{id}_sessions_{session_id}_authorize/post.sh security: - api_token: [] - cookie_auth: [] tags: - - PaymentCollection + - Payment Collections responses: '200': description: OK diff --git a/docs/api/store/paths/product-categories.yaml b/docs/api/store/paths/store_product-categories.yaml similarity index 79% rename from docs/api/store/paths/product-categories.yaml rename to docs/api/store/paths/store_product-categories.yaml index 2cc95446f2..0a830b4fdd 100644 --- a/docs/api/store/paths/product-categories.yaml +++ b/docs/api/store/paths/store_product-categories.yaml @@ -6,7 +6,7 @@ get: parameters: - in: query name: q - description: Query used for searching product category names orhandles. + description: Query used for searching product category names or handles. schema: type: string - in: query @@ -14,6 +14,11 @@ get: description: Returns categories scoped by parent schema: type: string + - in: query + name: include_descendants_tree + description: Include all nested descendants of category + schema: + type: boolean - in: query name: offset description: How many product categories to skip in the result. @@ -33,23 +38,23 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-categories/get.js + $ref: ../code_samples/JavaScript/store_product-categories/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories/get.sh + $ref: ../code_samples/Shell/store_product-categories/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/StoreProductCategoriesListRes.yaml + $ref: ../components/schemas/StoreGetProductCategoriesRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/product-categories_{id}.yaml b/docs/api/store/paths/store_product-categories_{id}.yaml similarity index 86% rename from docs/api/store/paths/product-categories_{id}.yaml rename to docs/api/store/paths/store_product-categories_{id}.yaml index 62fcb28473..a066d66be8 100644 --- a/docs/api/store/paths/product-categories_{id}.yaml +++ b/docs/api/store/paths/store_product-categories_{id}.yaml @@ -26,21 +26,21 @@ get: type: string x-codegen: method: retrieve - queryParams: StoreGetProductCategoryParams + queryParams: StoreGetProductCategoriesCategoryParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-categories_{id}/get.js + $ref: ../code_samples/JavaScript/store_product-categories_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/get.sh + $ref: ../code_samples/Shell/store_product-categories_{id}/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Category + - Product Categories responses: '200': description: OK diff --git a/docs/api/store/paths/product-tags.yaml b/docs/api/store/paths/store_product-tags.yaml similarity index 84% rename from docs/api/store/paths/product-tags.yaml rename to docs/api/store/paths/store_product-tags.yaml index b4a8e99fca..14ef6c1a86 100644 --- a/docs/api/store/paths/product-tags.yaml +++ b/docs/api/store/paths/store_product-tags.yaml @@ -3,6 +3,9 @@ get: summary: List Product Tags description: Retrieve a list of Product Tags. x-authenticated: true + x-codegen: + method: list + queryParams: StoreGetProductTagsParams parameters: - in: query name: limit @@ -97,32 +100,20 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-tags/get.js + $ref: ../code_samples/JavaScript/store_product-tags/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-tags/get.sh + $ref: ../code_samples/Shell/store_product-tags/get.sh tags: - - Product Tag + - Product Tags responses: '200': description: OK content: application/json: schema: - type: object - properties: - product_tags: - $ref: ../components/schemas/ProductTag.yaml - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + $ref: ../components/schemas/StoreProductTagsListRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/store_product-types.yaml similarity index 95% rename from docs/api/store/paths/product-types.yaml rename to docs/api/store/paths/store_product-types.yaml index 38eb9d78ca..c562e8f096 100644 --- a/docs/api/store/paths/product-types.yaml +++ b/docs/api/store/paths/store_product-types.yaml @@ -100,16 +100,16 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-types/get.js + $ref: ../code_samples/JavaScript/store_product-types/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-types/get.sh + $ref: ../code_samples/Shell/store_product-types/get.sh security: - api_token: [] - cookie_auth: [] tags: - - Product Type + - Product Types responses: '200': description: OK diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/store_products.yaml similarity index 97% rename from docs/api/store/paths/products.yaml rename to docs/api/store/paths/store_products.yaml index ccddde8462..6e57992712 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/store_products.yaml @@ -188,13 +188,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products/get.js + $ref: ../code_samples/JavaScript/store_products/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products/get.sh + $ref: ../code_samples/Shell/store_products/get.sh tags: - - Product + - Products responses: '200': description: OK diff --git a/docs/api/store/paths/products_search.yaml b/docs/api/store/paths/store_products_search.yaml similarity index 89% rename from docs/api/store/paths/products_search.yaml rename to docs/api/store/paths/store_products_search.yaml index 8600b8ac69..733b0dcb8d 100644 --- a/docs/api/store/paths/products_search.yaml +++ b/docs/api/store/paths/store_products_search.yaml @@ -26,13 +26,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_search/post.js + $ref: ../code_samples/JavaScript/store_products_search/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_search/post.sh + $ref: ../code_samples/Shell/store_products_search/post.sh tags: - - Product + - Products responses: '200': description: OK diff --git a/docs/api/store/paths/products_{id}.yaml b/docs/api/store/paths/store_products_{id}.yaml similarity index 93% rename from docs/api/store/paths/products_{id}.yaml rename to docs/api/store/paths/store_products_{id}.yaml index 6ad685401a..7cc2bcad51 100644 --- a/docs/api/store/paths/products_{id}.yaml +++ b/docs/api/store/paths/store_products_{id}.yaml @@ -57,13 +57,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/get.js + $ref: ../code_samples/JavaScript/store_products_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/get.sh + $ref: ../code_samples/Shell/store_products_{id}/get.sh tags: - - Product + - Products responses: '200': description: OK diff --git a/docs/api/store/paths/regions.yaml b/docs/api/store/paths/store_regions.yaml similarity index 94% rename from docs/api/store/paths/regions.yaml rename to docs/api/store/paths/store_regions.yaml index f8b0d9b9da..5004737470 100644 --- a/docs/api/store/paths/regions.yaml +++ b/docs/api/store/paths/store_regions.yaml @@ -66,13 +66,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions/get.js + $ref: ../code_samples/JavaScript/store_regions/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions/get.sh + $ref: ../code_samples/Shell/store_regions/get.sh tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/store/paths/regions_{id}.yaml b/docs/api/store/paths/store_regions_{id}.yaml similarity index 86% rename from docs/api/store/paths/regions_{id}.yaml rename to docs/api/store/paths/store_regions_{id}.yaml index 63026d4adb..1754659804 100644 --- a/docs/api/store/paths/regions_{id}.yaml +++ b/docs/api/store/paths/store_regions_{id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/get.js + $ref: ../code_samples/JavaScript/store_regions_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/get.sh + $ref: ../code_samples/Shell/store_regions_{id}/get.sh tags: - - Region + - Regions responses: '200': description: OK diff --git a/docs/api/store/paths/return-reasons.yaml b/docs/api/store/paths/store_return-reasons.yaml similarity index 83% rename from docs/api/store/paths/return-reasons.yaml rename to docs/api/store/paths/store_return-reasons.yaml index 56d00ff79b..cf06804410 100644 --- a/docs/api/store/paths/return-reasons.yaml +++ b/docs/api/store/paths/store_return-reasons.yaml @@ -8,13 +8,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons/get.js + $ref: ../code_samples/JavaScript/store_return-reasons/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons/get.sh + $ref: ../code_samples/Shell/store_return-reasons/get.sh tags: - - Return Reason + - Return Reasons responses: '200': description: OK diff --git a/docs/api/store/paths/return-reasons_{id}.yaml b/docs/api/store/paths/store_return-reasons_{id}.yaml similarity index 85% rename from docs/api/store/paths/return-reasons_{id}.yaml rename to docs/api/store/paths/store_return-reasons_{id}.yaml index ba1cc066b1..e7bc32989a 100644 --- a/docs/api/store/paths/return-reasons_{id}.yaml +++ b/docs/api/store/paths/store_return-reasons_{id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/get.js + $ref: ../code_samples/JavaScript/store_return-reasons_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/get.sh + $ref: ../code_samples/Shell/store_return-reasons_{id}/get.sh tags: - - Return Reason + - Return Reasons responses: '200': description: OK diff --git a/docs/api/store/paths/returns.yaml b/docs/api/store/paths/store_returns.yaml similarity index 87% rename from docs/api/store/paths/returns.yaml rename to docs/api/store/paths/store_returns.yaml index ee04bb1ff5..644e8b36fd 100644 --- a/docs/api/store/paths/returns.yaml +++ b/docs/api/store/paths/store_returns.yaml @@ -13,13 +13,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns/post.js + $ref: ../code_samples/JavaScript/store_returns/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns/post.sh + $ref: ../code_samples/Shell/store_returns/post.sh tags: - - Return + - Returns responses: '200': description: OK diff --git a/docs/api/store/paths/shipping-options.yaml b/docs/api/store/paths/store_shipping-options.yaml similarity index 89% rename from docs/api/store/paths/shipping-options.yaml rename to docs/api/store/paths/store_shipping-options.yaml index 790c76832a..7e695789cb 100644 --- a/docs/api/store/paths/shipping-options.yaml +++ b/docs/api/store/paths/store_shipping-options.yaml @@ -27,13 +27,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options/get.js + $ref: ../code_samples/JavaScript/store_shipping-options/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options/get.sh + $ref: ../code_samples/Shell/store_shipping-options/get.sh tags: - - Shipping Option + - Shipping Options responses: '200': description: OK diff --git a/docs/api/store/paths/shipping-options_{cart_id}.yaml b/docs/api/store/paths/store_shipping-options_{cart_id}.yaml similarity index 77% rename from docs/api/store/paths/shipping-options_{cart_id}.yaml rename to docs/api/store/paths/store_shipping-options_{cart_id}.yaml index 159495603b..47056d05e1 100644 --- a/docs/api/store/paths/shipping-options_{cart_id}.yaml +++ b/docs/api/store/paths/store_shipping-options_{cart_id}.yaml @@ -15,20 +15,20 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{cart_id}/get.js + $ref: ../code_samples/JavaScript/store_shipping-options_{cart_id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{cart_id}/get.sh + $ref: ../code_samples/Shell/store_shipping-options_{cart_id}/get.sh tags: - - Shipping Option + - Shipping Options responses: '200': description: OK content: application/json: schema: - $ref: ../components/schemas/StoreShippingOptionsListRes.yaml + $ref: ../components/schemas/StoreCartShippingOptionsListRes.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/swaps.yaml b/docs/api/store/paths/store_swaps.yaml similarity index 88% rename from docs/api/store/paths/swaps.yaml rename to docs/api/store/paths/store_swaps.yaml index 9ae0d63cf0..cd06c487bf 100644 --- a/docs/api/store/paths/swaps.yaml +++ b/docs/api/store/paths/store_swaps.yaml @@ -15,13 +15,13 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps/post.js + $ref: ../code_samples/JavaScript/store_swaps/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps/post.sh + $ref: ../code_samples/Shell/store_swaps/post.sh tags: - - Swap + - Swaps responses: '200': description: OK diff --git a/docs/api/store/paths/swaps_{cart_id}.yaml b/docs/api/store/paths/store_swaps_{cart_id}.yaml similarity index 86% rename from docs/api/store/paths/swaps_{cart_id}.yaml rename to docs/api/store/paths/store_swaps_{cart_id}.yaml index d50e68638d..8bccd19bbb 100644 --- a/docs/api/store/paths/swaps_{cart_id}.yaml +++ b/docs/api/store/paths/store_swaps_{cart_id}.yaml @@ -15,13 +15,13 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps_{cart_id}/get.js + $ref: ../code_samples/JavaScript/store_swaps_{cart_id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps_{cart_id}/get.sh + $ref: ../code_samples/Shell/store_swaps_{cart_id}/get.sh tags: - - Swap + - Swaps responses: '200': description: OK diff --git a/docs/api/store/paths/variants.yaml b/docs/api/store/paths/store_variants.yaml similarity index 97% rename from docs/api/store/paths/variants.yaml rename to docs/api/store/paths/store_variants.yaml index 90562879e6..fd071c0f97 100644 --- a/docs/api/store/paths/variants.yaml +++ b/docs/api/store/paths/store_variants.yaml @@ -89,9 +89,9 @@ get: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants/get.sh + $ref: ../code_samples/Shell/store_variants/get.sh tags: - - Product Variant + - Variants responses: '200': description: OK diff --git a/docs/api/store/paths/variants_{variant_id}.yaml b/docs/api/store/paths/store_variants_{variant_id}.yaml similarity index 95% rename from docs/api/store/paths/variants_{variant_id}.yaml rename to docs/api/store/paths/store_variants_{variant_id}.yaml index 59eaa551bb..9270e2839c 100644 --- a/docs/api/store/paths/variants_{variant_id}.yaml +++ b/docs/api/store/paths/store_variants_{variant_id}.yaml @@ -41,9 +41,9 @@ get: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants_{variant_id}/get.sh + $ref: ../code_samples/Shell/store_variants_{variant_id}/get.sh tags: - - Product Variant + - Variants responses: '200': description: OK diff --git a/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md b/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md index 3ba9c30c8b..9775cb4c9a 100644 --- a/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md +++ b/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md @@ -310,4 +310,4 @@ class MyFulfillmentService extends FulfillmentService { ## See Also -- Example Implementations: [Webshipper plugin](https://github.com/medusajs/medusa/tree/cab5821f55cfa448c575a20250c918b7fc6835c9/packages/medusa-fulfillment-webshipper) and the [manual fulfillment plugin](https://github.com/medusajs/medusa/tree/cab5821f55cfa448c575a20250c918b7fc6835c9/packages/medusa-fulfillment-manual) +- Example Implementations: [Webshipper plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-fulfillment-webshipper) and the [manual fulfillment plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-fulfillment-manual) diff --git a/docs/content/modules/carts-and-checkout/backend/add-payment-provider.md b/docs/content/modules/carts-and-checkout/backend/add-payment-provider.md index e0db0179a5..bee3a274d2 100644 --- a/docs/content/modules/carts-and-checkout/backend/add-payment-provider.md +++ b/docs/content/modules/carts-and-checkout/backend/add-payment-provider.md @@ -599,5 +599,5 @@ class MyPaymentService extends AbstractPaymentService { ## See Also -- Implementation Examples: [Stripe](https://github.com/medusajs/medusa/tree/2e6622ec5d0ae19d1782e583e099000f0a93b051/packages/medusa-payment-stripe) and [PayPal](https://github.com/medusajs/medusa/tree/2e6622ec5d0ae19d1782e583e099000f0a93b051/packages/medusa-payment-paypal) Payment Processors. +- Implementation Examples: [Stripe](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-stripe) and [PayPal](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-paypal) Payment Processors. - [Implement checkout flow on the storefront](../storefront/implement-checkout-flow.mdx). diff --git a/docs/content/references/services/classes/AnalyticsConfigService.md b/docs/content/references/services/classes/AnalyticsConfigService.md index 8d43258394..1056752d13 100644 --- a/docs/content/references/services/classes/AnalyticsConfigService.md +++ b/docs/content/references/services/classes/AnalyticsConfigService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/analytics-config.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L24) +[medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L21) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### analyticsConfigRepository\_ -• `Protected` `Readonly` **analyticsConfigRepository\_**: typeof `AnalyticsConfigRepository` +• `Protected` `Readonly` **analyticsConfigRepository\_**: `Repository`<`AnalyticsConfig`\> #### Defined in -[packages/medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L21) +[medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L18) ___ @@ -84,13 +84,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L18) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -98,13 +98,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L19) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -114,7 +114,25 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L22) +[medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L19) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -153,7 +171,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -176,7 +194,7 @@ Creates an analytics config. #### Defined in -[packages/medusa/src/services/analytics-config.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L56) +[medusa/src/services/analytics-config.ts:50](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L50) ___ @@ -198,7 +216,7 @@ Deletes an analytics config. #### Defined in -[packages/medusa/src/services/analytics-config.ts:103](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L103) +[medusa/src/services/analytics-config.ts:94](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L94) ___ @@ -218,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:32](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L32) +[medusa/src/services/analytics-config.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L28) ___ @@ -242,7 +260,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -265,7 +283,7 @@ Updates an analytics config. If the config does not exist, it will be created in #### Defined in -[packages/medusa/src/services/analytics-config.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/analytics-config.ts#L72) +[medusa/src/services/analytics-config.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/analytics-config.ts#L65) ___ @@ -289,4 +307,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/AuthService.md b/docs/content/references/services/classes/AuthService.md index a23d1b4914..61b7a0cd6b 100644 --- a/docs/content/references/services/classes/AuthService.md +++ b/docs/content/references/services/classes/AuthService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/auth.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L24) +[medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L22) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L22) +[medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L20) ___ @@ -86,13 +86,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L19) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -100,13 +100,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -116,7 +116,25 @@ ___ #### Defined in -[packages/medusa/src/services/auth.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L21) +[medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L19) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -155,7 +173,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -183,7 +201,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:97](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L97) +[medusa/src/services/auth.ts:95](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L95) ___ @@ -209,7 +227,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L54) +[medusa/src/services/auth.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L52) ___ @@ -237,7 +255,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:146](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L146) +[medusa/src/services/auth.ts:144](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L144) ___ @@ -262,7 +280,7 @@ the result of the comparison #### Defined in -[packages/medusa/src/services/auth.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/auth.ts#L38) +[medusa/src/services/auth.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/auth.ts#L36) ___ @@ -286,7 +304,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -310,4 +328,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/BatchJobService.md b/docs/content/references/services/classes/BatchJobService.md index a1c6d8b3c1..3bc9b94e86 100644 --- a/docs/content/references/services/classes/BatchJobService.md +++ b/docs/content/references/services/classes/BatchJobService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/batch-job.ts:93](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L93) +[medusa/src/services/batch-job.ts:91](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L91) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### batchJobRepository\_ -• `Protected` `Readonly` **batchJobRepository\_**: typeof `BatchJobRepository` +• `Protected` `Readonly` **batchJobRepository\_**: `Repository`<`BatchJob`\> #### Defined in -[packages/medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L41) +[medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L39) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L45) +[medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L43) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:42](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L42) +[medusa/src/services/batch-job.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L40) ___ @@ -104,13 +104,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/batch-job.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L38) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L43) +[medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L41) ___ @@ -128,13 +128,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L39) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -157,7 +157,25 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L27) +[medusa/src/services/batch-job.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L28) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -196,7 +214,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -216,7 +234,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:277](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L277) +[medusa/src/services/batch-job.ts:270](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L270) ___ @@ -236,7 +254,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:259](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L259) +[medusa/src/services/batch-job.ts:252](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L252) ___ @@ -256,7 +274,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:241](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L241) +[medusa/src/services/batch-job.ts:234](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L234) ___ @@ -276,7 +294,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:146](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L146) +[medusa/src/services/batch-job.ts:144](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L144) ___ @@ -297,7 +315,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:135](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L135) +[medusa/src/services/batch-job.ts:132](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L132) ___ @@ -318,7 +336,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:374](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L374) +[medusa/src/services/batch-job.ts:367](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L367) ___ @@ -339,7 +357,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:108](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L108) +[medusa/src/services/batch-job.ts:104](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L104) ___ @@ -360,7 +378,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:348](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L348) +[medusa/src/services/batch-job.ts:341](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L341) ___ @@ -380,7 +398,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:295](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L295) +[medusa/src/services/batch-job.ts:288](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L288) ___ @@ -400,7 +418,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:328](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L328) +[medusa/src/services/batch-job.ts:321](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L321) ___ @@ -424,7 +442,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -445,7 +463,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:165](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L165) +[medusa/src/services/batch-job.ts:161](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L161) ___ @@ -466,7 +484,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:206](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/batch-job.ts#L206) +[medusa/src/services/batch-job.ts:200](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/batch-job.ts#L200) ___ @@ -490,4 +508,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/CacheService.md b/docs/content/references/services/classes/CacheService.md deleted file mode 100644 index 1c52458bec..0000000000 --- a/docs/content/references/services/classes/CacheService.md +++ /dev/null @@ -1,119 +0,0 @@ -# Class: CacheService - -## Implements - -- `ICacheService` - -## Constructors - -### constructor - -• **new CacheService**(`__namedParameters`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | - -#### Defined in - -[packages/medusa/src/services/cache.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cache.ts#L10) - -## Properties - -### redis\_ - -• `Protected` `Readonly` **redis\_**: `Redis` - -#### Defined in - -[packages/medusa/src/services/cache.ts:8](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cache.ts#L8) - -## Methods - -### get - -▸ **get**<`T`\>(`cacheKey`): `Promise`<``null`` \| `T`\> - -Retrieve a cached value belonging to the given key. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cacheKey` | `string` | - -#### Returns - -`Promise`<``null`` \| `T`\> - -#### Implementation of - -ICacheService.get - -#### Defined in - -[packages/medusa/src/services/cache.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cache.ts#L40) - -___ - -### invalidate - -▸ **invalidate**(`key`): `Promise`<`void`\> - -Invalidate cache for a specific key. a key can be either a specific key or more global such as "ps:*". - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `key` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -ICacheService.invalidate - -#### Defined in - -[packages/medusa/src/services/cache.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cache.ts#L56) - -___ - -### set - -▸ **set**(`key`, `data`, `ttl?`): `Promise`<`void`\> - -Set a key/value pair to the cache. -It is also possible to manage the ttl through environment variable using CACHE_TTL. If the ttl is 0 it will -act like the value should not be cached at all. - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `key` | `string` | `undefined` | -| `data` | `Record`<`string`, `unknown`\> | `undefined` | -| `ttl` | `number` | `DEFAULT_CACHE_TIME` | - -#### Returns - -`Promise`<`void`\> - -#### Implementation of - -ICacheService.set - -#### Defined in - -[packages/medusa/src/services/cache.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cache.ts#L22) diff --git a/docs/content/references/services/classes/CartService.md b/docs/content/references/services/classes/CartService.md index af8f829e4d..75519bfbc6 100644 --- a/docs/content/references/services/classes/CartService.md +++ b/docs/content/references/services/classes/CartService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/cart.ts:137](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L137) +[medusa/src/services/cart.ts:134](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L134) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,27 +66,27 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: typeof `AddressRepository` +• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[packages/medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L112) +[medusa/src/services/cart.ts:109](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L109) ___ ### cartRepository\_ -• `Protected` `Readonly` **cartRepository\_**: typeof `CartRepository` +• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> #### Defined in -[packages/medusa/src/services/cart.ts:111](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L111) +[medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L108) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:130](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L130) +[medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L127) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L123) +[medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L120) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L125) +[medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L122) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L115) +[medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L112) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:133](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L133) +[medusa/src/services/cart.ts:130](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L130) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L126) +[medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L123) ___ @@ -156,17 +156,17 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:132](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L132) +[medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L129) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: typeof `LineItemRepository` +• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } #### Defined in -[packages/medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L114) +[medusa/src/services/cart.ts:111](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L111) ___ @@ -176,7 +176,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L121) +[medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L118) ___ @@ -184,13 +184,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/cart.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L107) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L129) +[medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L126) ___ @@ -210,17 +210,17 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L122) +[medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L119) ___ ### paymentSessionRepository\_ -• `Protected` `Readonly` **paymentSessionRepository\_**: typeof `PaymentSessionRepository` +• `Protected` `Readonly` **paymentSessionRepository\_**: `Repository`<`PaymentSession`\> #### Defined in -[packages/medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L113) +[medusa/src/services/cart.ts:110](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L110) ___ @@ -230,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:131](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L131) +[medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L128) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L117) +[medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L114) ___ @@ -250,7 +250,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:135](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L135) +[medusa/src/services/cart.ts:132](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L132) ___ @@ -260,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L116) +[medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L113) ___ @@ -270,7 +270,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L120) +[medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L117) ___ @@ -280,17 +280,17 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L119) +[medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L116) ___ ### shippingMethodRepository\_ -• `Protected` `Readonly` **shippingMethodRepository\_**: typeof `ShippingMethodRepository` +• `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\> #### Defined in -[packages/medusa/src/services/cart.ts:110](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L110) +[medusa/src/services/cart.ts:107](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L107) ___ @@ -300,7 +300,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L124) +[medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L121) ___ @@ -310,7 +310,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L118) +[medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L115) ___ @@ -320,7 +320,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L127) +[medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L124) ___ @@ -330,7 +330,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L128) +[medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L125) ___ @@ -338,13 +338,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L108) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -362,7 +362,25 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:101](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L101) +[medusa/src/services/cart.ts:101](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L101) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -393,7 +411,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:619](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L619) +[medusa/src/services/cart.ts:614](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L614) ___ @@ -421,7 +439,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:745](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L745) +[medusa/src/services/cart.ts:747](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L747) ___ @@ -439,7 +457,7 @@ shop. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrId` | `string` \| `Cart` | the id or the cart to add shipping method to | +| `cartOrId` | `string` \| `Cart` | the id of the cart to add shipping method to | | `optionId` | `string` | id of shipping option to add as valid method | | `data` | `Record`<`string`, `unknown`\> | the fulmillment data for the method | @@ -451,7 +469,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:2068](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2068) +[medusa/src/services/cart.ts:2091](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2091) ___ @@ -479,7 +497,7 @@ void #### Defined in -[packages/medusa/src/services/cart.ts:992](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L992) +[medusa/src/services/cart.ts:1008](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1008) ___ @@ -505,7 +523,7 @@ Throws if discount regions does not include the cart region #### Defined in -[packages/medusa/src/services/cart.ts:1414](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1414) +[medusa/src/services/cart.ts:1429](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1429) ___ @@ -531,7 +549,7 @@ Throws if discount regions does not include the cart region #### Defined in -[packages/medusa/src/services/cart.ts:1426](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1426) +[medusa/src/services/cart.ts:1441](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1441) ___ @@ -552,7 +570,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:1379](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1379) +[medusa/src/services/cart.ts:1394](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1394) ___ @@ -591,7 +609,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -620,7 +638,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1592](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1592) +[medusa/src/services/cart.ts:1607](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1607) ___ @@ -644,7 +662,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/cart.ts:320](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L320) +[medusa/src/services/cart.ts:306](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L306) ___ @@ -668,7 +686,7 @@ the resultign customer object #### Defined in -[packages/medusa/src/services/cart.ts:1266](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1266) +[medusa/src/services/cart.ts:1280](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1280) ___ @@ -688,7 +706,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2477](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2477) +[medusa/src/services/cart.ts:2497](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2497) ___ @@ -709,7 +727,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2527](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2527) +[medusa/src/services/cart.ts:2549](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2549) ___ @@ -735,7 +753,7 @@ Use decorateTotals instead #### Defined in -[packages/medusa/src/services/cart.ts:2700](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2700) +[medusa/src/services/cart.ts:2724](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2724) ___ @@ -759,7 +777,7 @@ the deleted cart or undefined if the cart was not found. #### Defined in -[packages/medusa/src/services/cart.ts:2392](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2392) +[medusa/src/services/cart.ts:2414](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2414) ___ @@ -784,7 +802,7 @@ the resulting cart. #### Defined in -[packages/medusa/src/services/cart.ts:1959](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1959) +[medusa/src/services/cart.ts:1984](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1984) ___ @@ -804,7 +822,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2508](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2508) +[medusa/src/services/cart.ts:2530](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2530) ___ @@ -830,7 +848,7 @@ custom shipping option #### Defined in -[packages/medusa/src/services/cart.ts:2175](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2175) +[medusa/src/services/cart.ts:2198](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2198) ___ @@ -850,7 +868,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2751](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2751) +[medusa/src/services/cart.ts:2775](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2775) ___ @@ -870,7 +888,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:456](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L456) +[medusa/src/services/cart.ts:444](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L444) ___ @@ -893,7 +911,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/cart.ts:201](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L201) +[medusa/src/services/cart.ts:196](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L196) ___ @@ -918,7 +936,7 @@ void #### Defined in -[packages/medusa/src/services/cart.ts:1212](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1212) +[medusa/src/services/cart.ts:1226](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1226) ___ @@ -938,7 +956,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2621](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2621) +[medusa/src/services/cart.ts:2648](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2648) ___ @@ -963,7 +981,7 @@ the resulting cart. #### Defined in -[packages/medusa/src/services/cart.ts:2013](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2013) +[medusa/src/services/cart.ts:2036](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2036) ___ @@ -988,7 +1006,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1502](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1502) +[medusa/src/services/cart.ts:1517](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1517) ___ @@ -1013,7 +1031,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:488](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L488) +[medusa/src/services/cart.ts:476](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L476) ___ @@ -1039,7 +1057,7 @@ the cart document. #### Defined in -[packages/medusa/src/services/cart.ts:219](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L219) +[medusa/src/services/cart.ts:213](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L213) ___ @@ -1063,7 +1081,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:268](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L268) +[medusa/src/services/cart.ts:258](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L258) ___ @@ -1085,7 +1103,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:300](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L300) +[medusa/src/services/cart.ts:286](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L286) ___ @@ -1113,7 +1131,7 @@ resolves to the updated result. #### Defined in -[packages/medusa/src/services/cart.ts:2435](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2435) +[medusa/src/services/cart.ts:2457](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2457) ___ @@ -1136,7 +1154,7 @@ Selects a payment session for a cart and creates a payment object in the externa #### Defined in -[packages/medusa/src/services/cart.ts:1666](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1666) +[medusa/src/services/cart.ts:1686](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1686) ___ @@ -1164,7 +1182,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/cart.ts:1781](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1781) +[medusa/src/services/cart.ts:1804](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1804) ___ @@ -1190,7 +1208,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:2258](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2258) +[medusa/src/services/cart.ts:2284](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2284) ___ @@ -1214,7 +1232,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -1234,7 +1252,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2642](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2642) +[medusa/src/services/cart.ts:2666](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2666) ___ @@ -1255,7 +1273,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:1035](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1035) +[medusa/src/services/cart.ts:1049](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1049) ___ @@ -1271,7 +1289,7 @@ Updates the cart's billing address. | :------ | :------ | :------ | | `cart` | `Cart` | the cart to update | | `addressOrId` | `string` \| `AddressPayload` \| `Partial`<`Address`\> | the value to set the billing address to | -| `addrRepo` | `AddressRepository` | the repository to use for address updates | +| `addrRepo` | `Repository`<`Address`\> | the repository to use for address updates | #### Returns @@ -1281,7 +1299,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1292](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1292) +[medusa/src/services/cart.ts:1307](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1307) ___ @@ -1306,7 +1324,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1248](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1248) +[medusa/src/services/cart.ts:1262](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1262) ___ @@ -1332,7 +1350,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:915](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L915) +[medusa/src/services/cart.ts:924](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L924) ___ @@ -1357,7 +1375,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1554](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1554) +[medusa/src/services/cart.ts:1569](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1569) ___ @@ -1373,7 +1391,7 @@ Updates the cart's shipping address. | :------ | :------ | :------ | | `cart` | `Cart` | the cart to update | | `addressOrId` | `string` \| `AddressPayload` \| `Partial`<`Address`\> | the value to set the shipping address to | -| `addrRepo` | `AddressRepository` | the repository to use for address updates | +| `addrRepo` | `Repository`<`Address`\> | the repository to use for address updates | #### Returns @@ -1383,7 +1401,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1330](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L1330) +[medusa/src/services/cart.ts:1345](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L1345) ___ @@ -1405,7 +1423,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2194](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L2194) +[medusa/src/services/cart.ts:2217](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L2217) ___ @@ -1431,7 +1449,7 @@ a boolean indicating validation result #### Defined in -[packages/medusa/src/services/cart.ts:585](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L585) +[medusa/src/services/cart.ts:580](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L580) ___ @@ -1458,7 +1476,7 @@ boolean representing whether shipping method is validated #### Defined in -[packages/medusa/src/services/cart.ts:554](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/cart.ts#L554) +[medusa/src/services/cart.ts:549](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/cart.ts#L549) ___ @@ -1482,4 +1500,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ClaimItemService.md b/docs/content/references/services/classes/ClaimItemService.md index 500c3e28e8..981e467e32 100644 --- a/docs/content/references/services/classes/ClaimItemService.md +++ b/docs/content/references/services/classes/ClaimItemService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/claim-item.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L30) +[medusa/src/services/claim-item.ts:26](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L26) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,37 +66,37 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### claimImageRepository\_ -• `Protected` `Readonly` **claimImageRepository\_**: typeof `ClaimImageRepository` +• `Protected` `Readonly` **claimImageRepository\_**: `Repository`<`ClaimImage`\> #### Defined in -[packages/medusa/src/services/claim-item.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L25) +[medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L24) ___ ### claimItemRepository\_ -• `Protected` `Readonly` **claimItemRepository\_**: typeof `ClaimItemRepository` +• `Protected` `Readonly` **claimItemRepository\_**: `Repository`<`ClaimItem`\> #### Defined in -[packages/medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L23) +[medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L22) ___ ### claimTagRepository\_ -• `Protected` `Readonly` **claimTagRepository\_**: typeof `ClaimTagRepository` +• `Protected` `Readonly` **claimTagRepository\_**: `Repository`<`ClaimTag`\> #### Defined in -[packages/medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L24) +[medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L23) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L22) +[medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L21) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L21) +[medusa/src/services/claim-item.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L20) ___ @@ -124,13 +124,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/claim-item.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L27) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -138,13 +138,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/claim-item.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L28) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -162,7 +162,25 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:15](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L15) +[medusa/src/services/claim-item.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L14) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -201,7 +219,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -221,7 +239,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L49) +[medusa/src/services/claim-item.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L43) ___ @@ -244,7 +262,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/claim-item.ts:221](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L221) +[medusa/src/services/claim-item.ts:205](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L205) ___ @@ -269,7 +287,7 @@ the ClaimItem #### Defined in -[packages/medusa/src/services/claim-item.ts:240](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L240) +[medusa/src/services/claim-item.ts:224](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L224) ___ @@ -293,7 +311,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -314,7 +332,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:139](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim-item.ts#L139) +[medusa/src/services/claim-item.ts:127](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim-item.ts#L127) ___ @@ -338,4 +356,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ClaimService.md b/docs/content/references/services/classes/ClaimService.md index 70f3ba5f7e..2019ce5fc2 100644 --- a/docs/content/references/services/classes/ClaimService.md +++ b/docs/content/references/services/classes/ClaimService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/claim.ts:89](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L89) +[medusa/src/services/claim.ts:86](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L86) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: typeof `AddressRepository` +• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[packages/medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L71) +[medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L68) ___ @@ -86,17 +86,17 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L75) +[medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L72) ___ ### claimRepository\_ -• `Protected` `Readonly` **claimRepository\_**: typeof `ClaimRepository` +• `Protected` `Readonly` **claimRepository\_**: `Repository`<`ClaimOrder`\> #### Defined in -[packages/medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L72) +[medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L69) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L76) +[medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L73) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L77) +[medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L74) ___ @@ -126,17 +126,17 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L78) +[medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L75) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: typeof `LineItemRepository` +• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } #### Defined in -[packages/medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L74) +[medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L71) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L79) +[medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L76) ___ @@ -154,13 +154,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L68) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L80) +[medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L77) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:87](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L87) +[medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L84) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L81) +[medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L78) ___ @@ -200,17 +200,17 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L82) +[medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L79) ___ ### shippingMethodRepository\_ -• `Protected` `Readonly` **shippingMethodRepository\_**: typeof `ShippingMethodRepository` +• `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\> #### Defined in -[packages/medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L73) +[medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L70) ___ @@ -220,7 +220,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:83](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L83) +[medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L80) ___ @@ -230,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L84) +[medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L81) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:85](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L85) +[medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L82) ___ @@ -248,13 +248,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L69) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -275,7 +275,25 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L59) +[medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L59) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -314,7 +332,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -334,7 +352,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:810](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L810) +[medusa/src/services/claim.ts:813](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L813) ___ @@ -354,7 +372,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:658](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L658) +[medusa/src/services/claim.ts:661](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L661) ___ @@ -380,7 +398,7 @@ created claim #### Defined in -[packages/medusa/src/services/claim.ts:337](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L337) +[medusa/src/services/claim.ts:331](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L331) ___ @@ -394,6 +412,7 @@ ___ | :------ | :------ | :------ | | `id` | `string` | the object containing all data required to create a claim | | `config` | `Object` | config object | +| `config.location_id?` | `string` | - | | `config.metadata?` | `Record`<`string`, `unknown`\> | config metadata | | `config.no_notification?` | `boolean` | config no notification | @@ -405,7 +424,7 @@ created claim #### Defined in -[packages/medusa/src/services/claim.ts:510](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L510) +[medusa/src/services/claim.ts:512](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L512) ___ @@ -430,7 +449,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:730](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L730) +[medusa/src/services/claim.ts:733](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L733) ___ @@ -460,7 +479,7 @@ the refund amount #### Defined in -[packages/medusa/src/services/claim.ts:279](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L279) +[medusa/src/services/claim.ts:273](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L273) ___ @@ -483,7 +502,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/claim.ts:866](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L866) +[medusa/src/services/claim.ts:869](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L869) ___ @@ -503,7 +522,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:684](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L684) +[medusa/src/services/claim.ts:687](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L687) ___ @@ -528,7 +547,7 @@ the order document #### Defined in -[packages/medusa/src/services/claim.ts:886](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L886) +[medusa/src/services/claim.ts:888](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L888) ___ @@ -552,7 +571,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -573,7 +592,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:131](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L131) +[medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L125) ___ @@ -593,7 +612,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:212](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/claim.ts#L212) +[medusa/src/services/claim.ts:206](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/claim.ts#L206) ___ @@ -617,4 +636,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/CurrencyService.md b/docs/content/references/services/classes/CurrencyService.md index 6d015c3e86..acbab853e0 100644 --- a/docs/content/references/services/classes/CurrencyService.md +++ b/docs/content/references/services/classes/CurrencyService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/currency.ts:32](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L32) +[medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L29) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### currencyRepository\_ -• `Protected` `Readonly` **currencyRepository\_**: typeof `CurrencyRepository` +• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> #### Defined in -[packages/medusa/src/services/currency.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L28) +[medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L25) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L29) +[medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L26) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L30) +[medusa/src/services/currency.ts:27](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L27) ___ @@ -104,13 +104,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L25) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -118,13 +118,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L26) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -140,7 +140,25 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L21) +[medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L21) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -179,7 +197,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -207,7 +225,7 @@ an array containing the currencies as #### Defined in -[packages/medusa/src/services/currency.ts:81](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L81) +[medusa/src/services/currency.ts:78](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L78) ___ @@ -231,7 +249,7 @@ The currency #### Defined in -[packages/medusa/src/services/currency.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L50) +[medusa/src/services/currency.ts:47](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L47) ___ @@ -255,7 +273,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -280,7 +298,7 @@ The updated currency #### Defined in -[packages/medusa/src/services/currency.ts:103](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/currency.ts#L103) +[medusa/src/services/currency.ts:100](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/currency.ts#L100) ___ @@ -304,4 +322,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/CustomShippingOptionService.md b/docs/content/references/services/classes/CustomShippingOptionService.md index ccebd38bb1..dffbaf5372 100644 --- a/docs/content/references/services/classes/CustomShippingOptionService.md +++ b/docs/content/references/services/classes/CustomShippingOptionService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L20) +[medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/custom-shipping-option.ts#L18) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customShippingOptionRepository\_ -• `Protected` **customShippingOptionRepository\_**: typeof `CustomShippingOptionRepository` +• `Protected` **customShippingOptionRepository\_**: `Repository`<`CustomShippingOption`\> #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L18) +[medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/custom-shipping-option.ts#L16) ___ @@ -84,13 +84,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:15](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -98,13 +98,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L16) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -143,7 +161,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -174,7 +192,7 @@ resolves to the creation result #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:89](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L89) +[medusa/src/services/custom-shipping-option.ts:80](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/custom-shipping-option.ts#L80) ___ @@ -199,7 +217,7 @@ custom shipping options matching the query #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L65) +[medusa/src/services/custom-shipping-option.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/custom-shipping-option.ts#L58) ___ @@ -224,7 +242,7 @@ the requested custom shipping option. #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/custom-shipping-option.ts#L37) +[medusa/src/services/custom-shipping-option.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/custom-shipping-option.ts#L31) ___ @@ -248,7 +266,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -272,4 +290,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/CustomerGroupService.md b/docs/content/references/services/classes/CustomerGroupService.md index c856542c46..c871976d0d 100644 --- a/docs/content/references/services/classes/CustomerGroupService.md +++ b/docs/content/references/services/classes/CustomerGroupService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L27) +[medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L24) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customerGroupRepository\_ -• `Protected` `Readonly` **customerGroupRepository\_**: typeof `CustomerGroupRepository` +• `Protected` `Readonly` **customerGroupRepository\_**: `Repository`<`CustomerGroup`\> & { `addCustomers`: (`groupId`: `string`, `customerIds`: `string`[]) => `Promise`<`CustomerGroup`\> ; `findWithRelationsAndCount`: (`relations`: `FindOptionsRelations`<`CustomerGroup`\>, `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`CustomerGroup`[], `number`]\> ; `removeCustomers`: (`groupId`: `string`, `customerIds`: `string`[]) => `Promise`<`DeleteResult`\> } #### Defined in -[packages/medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L24) +[medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L21) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L25) +[medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L22) ___ @@ -94,13 +94,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L21) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -108,13 +108,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L22) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -139,7 +157,7 @@ the customer group after insertion #### Defined in -[packages/medusa/src/services/customer-group.ts:94](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L94) +[medusa/src/services/customer-group.ts:89](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L89) ___ @@ -178,7 +196,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -192,15 +210,7 @@ Creates a customer group with the provided data. | Name | Type | Description | | :------ | :------ | :------ | -| `group` | `Object` | the customer group to create | -| `group.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `group.customers?` | (`undefined` \| { email?: string \| undefined; first\_name?: string \| undefined; last\_name?: string \| undefined; billing\_address\_id?: string \| null \| undefined; billing\_address?: { customer\_id?: string \| null \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 10 more ...; updated\_at?: { ...; } \| undef...)[] | - | -| `group.deleted_at?` | ``null`` \| { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `group.id?` | `string` | - | -| `group.metadata?` | { [x: string]: unknown; } | - | -| `group.name?` | `string` | - | -| `group.price_lists?` | (`undefined` \| { name?: string \| undefined; description?: string \| undefined; type?: PriceListType \| undefined; status?: PriceListStatus \| undefined; starts\_at?: { ...; } \| ... 1 more ... \| undefined; ... 7 more ...; updated\_at?: { ...; } \| undefined; })[] | - | -| `group.updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | +| `group` | `DeepPartial`<`CustomerGroup`\> | the customer group to create | #### Returns @@ -210,7 +220,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/customer-group.ts:70](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L70) +[medusa/src/services/customer-group.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L65) ___ @@ -234,7 +244,7 @@ a promise #### Defined in -[packages/medusa/src/services/customer-group.ts:158](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L158) +[medusa/src/services/customer-group.ts:153](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L153) ___ @@ -256,7 +266,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:261](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L261) +[medusa/src/services/customer-group.ts:257](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L257) ___ @@ -281,7 +291,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer-group.ts:181](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L181) +[medusa/src/services/customer-group.ts:176](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L176) ___ @@ -306,7 +316,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer-group.ts:199](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L199) +[medusa/src/services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L194) ___ @@ -331,7 +341,7 @@ the customergroup with the provided id #### Defined in -[packages/medusa/src/services/customer-group.ts:240](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L240) +[medusa/src/services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L236) ___ @@ -352,7 +362,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L40) +[medusa/src/services/customer-group.ts:35](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L35) ___ @@ -376,7 +386,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -401,7 +411,7 @@ resulting customer group #### Defined in -[packages/medusa/src/services/customer-group.ts:125](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer-group.ts#L125) +[medusa/src/services/customer-group.ts:120](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer-group.ts#L120) ___ @@ -425,4 +435,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/CustomerService.md b/docs/content/references/services/classes/CustomerService.md index a7945223d5..96e6b66980 100644 --- a/docs/content/references/services/classes/CustomerService.md +++ b/docs/content/references/services/classes/CustomerService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/customer.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L39) +[medusa/src/services/customer.ts:46](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L46) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,27 +68,27 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: typeof `AddressRepository` +• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[packages/medusa/src/services/customer.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L27) +[medusa/src/services/customer.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L37) ___ ### customerRepository\_ -• `Protected` `Readonly` **customerRepository\_**: typeof `CustomerRepository` +• `Protected` `Readonly` **customerRepository\_**: `Repository`<`Customer`\> & { `listAndCount`: (`query`: `Omit`<`FindOneOptions`<`Customer`\>, ``"where"`` \| ``"select"`` \| ``"relations"``\> & { `order?`: `FindOptionsOrder`<`Customer`\> ; `relations?`: `FindOptionsRelations`<`Customer`\> ; `select?`: `FindOptionsSelect`<`Customer`\> ; `skip?`: `number` ; `take?`: `number` ; `where`: `FindOptionsWhere`<`Customer`\> \| `FindOptionsWhere`<`Customer`\>[] } & { `where`: `FindOptionsWhere`<`Customer` & { `groups?`: `FindOperator`<`string`[]\> }\> } & `Omit`<`FindManyOptions`<`Customer`\>, ``"where"`` \| ``"select"`` \| ``"relations"``\> & { `order?`: `FindOptionsOrder`<`Customer`\> ; `relations?`: `FindOptionsRelations`<`Customer`\> ; `select?`: `FindOptionsSelect`<`Customer`\> ; `skip?`: `number` ; `take?`: `number` ; `where`: `FindOptionsWhere`<`Customer`\> \| `FindOptionsWhere`<`Customer`\>[] } & { `where`: `FindOptionsWhere`<`Customer` & { `groups?`: `FindOperator`<`string`[]\> }\> }, `q`: `undefined` \| `string`) => `Promise`<[`Customer`[], `number`]\> } #### Defined in -[packages/medusa/src/services/customer.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L26) +[medusa/src/services/customer.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L36) ___ @@ -98,35 +98,35 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L28) +[medusa/src/services/customer.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L38) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/customer.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L30) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` `Readonly` **transactionManager\_**: `undefined` \| `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/customer.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -144,7 +144,25 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:33](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L33) +[medusa/src/services/customer.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L40) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -165,7 +183,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:498](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L498) +[medusa/src/services/customer.ts:519](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L519) ___ @@ -204,7 +222,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -222,7 +240,7 @@ the result of the count operation #### Defined in -[packages/medusa/src/services/customer.ts:158](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L158) +[medusa/src/services/customer.ts:178](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L178) ___ @@ -249,7 +267,7 @@ the result of create #### Defined in -[packages/medusa/src/services/customer.ts:285](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L285) +[medusa/src/services/customer.ts:306](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L306) ___ @@ -273,7 +291,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/customer.ts:546](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L546) +[medusa/src/services/customer.ts:565](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L565) ___ @@ -301,7 +319,7 @@ the generated JSON web token #### Defined in -[packages/medusa/src/services/customer.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L64) +[medusa/src/services/customer.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L68) ___ @@ -325,7 +343,7 @@ hashed password #### Defined in -[packages/medusa/src/services/customer.ts:272](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L272) +[medusa/src/services/customer.ts:293](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L293) ___ @@ -337,7 +355,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | -| `selector` | `Selector`<`Customer`\> & { `q?`: `string` } | the query object for find | +| `selector` | `Selector`<`Customer`\> & { `groups?`: `string`[] ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | #### Returns @@ -348,7 +366,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L107) +[medusa/src/services/customer.ts:111](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L111) ___ @@ -360,7 +378,7 @@ ___ | Name | Type | Description | | :------ | :------ | :------ | -| `selector` | `Selector`<`Customer`\> & { `q?`: `string` } | the query object for find | +| `selector` | `Selector`<`Customer`\> & { `groups?`: `string`[] ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | #### Returns @@ -371,7 +389,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer.ts:131](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L131) +[medusa/src/services/customer.ts:143](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L143) ___ @@ -392,7 +410,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:228](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L228) +[medusa/src/services/customer.ts:249](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L249) ___ @@ -413,7 +431,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:481](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L481) +[medusa/src/services/customer.ts:502](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L502) ___ @@ -438,7 +456,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:253](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L253) +[medusa/src/services/customer.ts:274](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L274) ___ @@ -465,7 +483,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:195](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L195) +[medusa/src/services/customer.ts:216](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L216) ___ @@ -490,7 +508,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:240](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L240) +[medusa/src/services/customer.ts:261](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L261) ___ @@ -511,7 +529,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:218](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L218) +[medusa/src/services/customer.ts:239](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L239) ___ @@ -532,7 +550,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:209](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L209) +[medusa/src/services/customer.ts:230](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L230) ___ @@ -553,7 +571,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:164](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L164) +[medusa/src/services/customer.ts:185](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L185) ___ @@ -577,7 +595,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -602,7 +620,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/customer.ts:341](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L341) +[medusa/src/services/customer.ts:362](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L362) ___ @@ -624,7 +642,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:453](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L453) +[medusa/src/services/customer.ts:474](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L474) ___ @@ -639,7 +657,7 @@ Updates the customers' billing address. | Name | Type | Description | | :------ | :------ | :------ | | `customer` | `Customer` | the Customer to update | -| `addressOrId` | `undefined` \| `string` \| { `address_1?`: ``null`` \| `string` ; `address_2?`: ``null`` \| `string` ; `city?`: ``null`` \| `string` ; `company?`: ``null`` \| `string` ; `country?`: ``null`` \| { id?: number \| undefined; iso\_2?: string \| undefined; iso\_3?: string \| undefined; num\_code?: number \| undefined; name?: string \| undefined; display\_name?: string \| undefined; region\_id?: string \| ... 1 more ... \| undefined; region?: { ...; } \| undefined; } ; `country_code?`: ``null`` \| `string` ; `created_at?`: { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } ; `customer?`: ``null`` \| { email?: string \| undefined; first\_name?: string \| undefined; last\_name?: string \| undefined; billing\_address\_id?: string \| null \| undefined; billing\_address?: { customer\_id?: string \| null \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 10 more ...; updated\_at?: { ...; } \| undef... ; `customer_id?`: ``null`` \| `string` ; `deleted_at?`: ``null`` \| { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } ; `first_name?`: ``null`` \| `string` ; `id?`: `string` ; `last_name?`: ``null`` \| `string` ; `metadata?`: { [x: string]: unknown; } ; `phone?`: ``null`` \| `string` ; `postal_code?`: ``null`` \| `string` ; `province?`: ``null`` \| `string` ; `updated_at?`: { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } } | the value to set the billing address to | +| `addressOrId` | `undefined` \| `string` \| `DeepPartial`<`Address`\> | the value to set the billing address to | #### Returns @@ -649,7 +667,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/customer.ts:401](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/customer.ts#L401) +[medusa/src/services/customer.ts:422](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/customer.ts#L422) ___ @@ -673,4 +691,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/DiscountConditionService.md b/docs/content/references/services/classes/DiscountConditionService.md index 178c81ab22..69e1e9978f 100644 --- a/docs/content/references/services/classes/DiscountConditionService.md +++ b/docs/content/references/services/classes/DiscountConditionService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/discount-condition.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L37) +[medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L34) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -70,17 +70,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### discountConditionRepository\_ -• `Protected` `Readonly` **discountConditionRepository\_**: typeof `DiscountConditionRepository` +• `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: (`conditionId`: `string`, `resourceIds`: (`string` \| { `id`: `string` })[], `type`: `DiscountConditionType`, `overrideExisting`: `boolean`) => `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> ; `canApplyForCustomer`: (`discountRuleId`: `string`, `customerId`: `string`) => `Promise`<`boolean`\> ; `findOneWithDiscount`: (`conditionId`: `string`, `discountId`: `string`) => `Promise`<`undefined` \| `DiscountCondition` & { `discount`: `Discount` }\> ; `getJoinTableResourceIdentifiers`: (`type`: `string`) => { `conditionTable`: `DiscountConditionResourceType` ; `joinTable`: `string` ; `joinTableForeignKey`: `DiscountConditionJoinTableForeignKey` ; `joinTableKey`: `string` ; `resourceKey`: `string` } ; `isValidForProduct`: (`discountRuleId`: `string`, `productId`: `string`) => `Promise`<`boolean`\> ; `queryConditionTable`: (`__namedParameters`: `Object`) => `Promise`<`number`\> ; `removeConditionResources`: (`id`: `string`, `type`: `DiscountConditionType`, `resourceIds`: (`string` \| { `id`: `string` })[]) => `Promise`<`void` \| `DeleteResult`\> } #### Defined in -[packages/medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L31) +[medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L31) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L32) +[medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L32) ___ @@ -98,13 +98,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L34) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -112,13 +112,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/discount-condition.ts:35](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L35) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -157,7 +175,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -177,7 +195,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:220](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L220) +[medusa/src/services/discount-condition.ts:217](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L217) ___ @@ -197,7 +215,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:188](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L188) +[medusa/src/services/discount-condition.ts:184](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L184) ___ @@ -218,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L49) +[medusa/src/services/discount-condition.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L45) ___ @@ -242,7 +260,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -263,7 +281,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:116](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L116) +[medusa/src/services/discount-condition.ts:111](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L111) ___ @@ -287,7 +305,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ @@ -307,4 +325,4 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:79](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount-condition.ts#L79) +[medusa/src/services/discount-condition.ts:74](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount-condition.ts#L74) diff --git a/docs/content/references/services/classes/DiscountService.md b/docs/content/references/services/classes/DiscountService.md index e8f1dd1159..2d69eccd42 100644 --- a/docs/content/references/services/classes/DiscountService.md +++ b/docs/content/references/services/classes/DiscountService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/discount.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L69) +[medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L65) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -80,17 +80,17 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L56) +[medusa/src/services/discount.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L52) ___ ### discountConditionRepository\_ -• `Protected` `Readonly` **discountConditionRepository\_**: typeof `DiscountConditionRepository` +• `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: (`conditionId`: `string`, `resourceIds`: (`string` \| { `id`: `string` })[], `type`: `DiscountConditionType`, `overrideExisting`: `boolean`) => `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> ; `canApplyForCustomer`: (`discountRuleId`: `string`, `customerId`: `string`) => `Promise`<`boolean`\> ; `findOneWithDiscount`: (`conditionId`: `string`, `discountId`: `string`) => `Promise`<`undefined` \| `DiscountCondition` & { `discount`: `Discount` }\> ; `getJoinTableResourceIdentifiers`: (`type`: `string`) => { `conditionTable`: `DiscountConditionResourceType` ; `joinTable`: `string` ; `joinTableForeignKey`: `DiscountConditionJoinTableForeignKey` ; `joinTableKey`: `string` ; `resourceKey`: `string` } ; `isValidForProduct`: (`discountRuleId`: `string`, `productId`: `string`) => `Promise`<`boolean`\> ; `queryConditionTable`: (`__namedParameters`: `Object`) => `Promise`<`number`\> ; `removeConditionResources`: (`id`: `string`, `type`: `DiscountConditionType`, `resourceIds`: (`string` \| { `id`: `string` })[]) => `Promise`<`void` \| `DeleteResult`\> } #### Defined in -[packages/medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L60) +[medusa/src/services/discount.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L56) ___ @@ -100,27 +100,27 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L61) +[medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L57) ___ ### discountRepository\_ -• `Protected` `Readonly` **discountRepository\_**: typeof `DiscountRepository` +• `Protected` `Readonly` **discountRepository\_**: `Repository`<`Discount`\> #### Defined in -[packages/medusa/src/services/discount.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L55) +[medusa/src/services/discount.ts:51](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L51) ___ ### discountRuleRepository\_ -• `Protected` `Readonly` **discountRuleRepository\_**: typeof `DiscountRuleRepository` +• `Protected` `Readonly` **discountRuleRepository\_**: `Repository`<`DiscountRule`\> #### Defined in -[packages/medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L57) +[medusa/src/services/discount.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L53) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:66](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L66) +[medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L62) ___ @@ -140,17 +140,17 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L67) +[medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L63) ___ ### giftCardRepository\_ -• `Protected` `Readonly` **giftCardRepository\_**: typeof `GiftCardRepository` +• `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: (`query`: `ExtendedFindConfig`<`GiftCard`\>, `q?`: `string`) => `Promise`<[`GiftCard`[], `number`]\> } #### Defined in -[packages/medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L58) +[medusa/src/services/discount.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L54) ___ @@ -158,13 +158,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/discount.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L52) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -174,7 +174,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L63) +[medusa/src/services/discount.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L59) ___ @@ -184,7 +184,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L64) +[medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L60) ___ @@ -194,7 +194,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L65) +[medusa/src/services/discount.ts:61](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L61) ___ @@ -204,7 +204,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L62) +[medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L58) ___ @@ -212,13 +212,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/discount.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L53) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -243,7 +261,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:513](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L513) +[medusa/src/services/discount.ts:497](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L497) ___ @@ -282,7 +300,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -304,7 +322,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:614](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L614) +[medusa/src/services/discount.ts:599](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L599) ___ @@ -325,7 +343,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:791](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L791) +[medusa/src/services/discount.ts:778](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L778) ___ @@ -350,7 +368,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/discount.ts:187](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L187) +[medusa/src/services/discount.ts:172](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L172) ___ @@ -375,7 +393,7 @@ the newly created dynamic code #### Defined in -[packages/medusa/src/services/discount.ts:441](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L441) +[medusa/src/services/discount.ts:425](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L425) ___ @@ -399,7 +417,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/discount.ts:573](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L573) +[medusa/src/services/discount.ts:557](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L557) ___ @@ -424,7 +442,7 @@ the newly created dynamic code #### Defined in -[packages/medusa/src/services/discount.ts:492](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L492) +[medusa/src/services/discount.ts:476](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L476) ___ @@ -444,7 +462,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:760](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L760) +[medusa/src/services/discount.ts:747](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L747) ___ @@ -464,7 +482,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:756](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L756) +[medusa/src/services/discount.ts:743](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L743) ___ @@ -484,7 +502,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:750](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L750) +[medusa/src/services/discount.ts:737](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L737) ___ @@ -504,7 +522,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:768](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L768) +[medusa/src/services/discount.ts:755](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L755) ___ @@ -525,7 +543,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:772](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L772) +[medusa/src/services/discount.ts:759](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L759) ___ @@ -548,7 +566,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/discount.ts:125](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L125) +[medusa/src/services/discount.ts:119](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L119) ___ @@ -571,7 +589,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/discount.ts:141](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L141) +[medusa/src/services/discount.ts:136](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L136) ___ @@ -596,7 +614,7 @@ the discounts #### Defined in -[packages/medusa/src/services/discount.ts:314](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L314) +[medusa/src/services/discount.ts:301](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L301) ___ @@ -621,7 +639,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:548](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L548) +[medusa/src/services/discount.ts:532](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L532) ___ @@ -646,7 +664,7 @@ the discount #### Defined in -[packages/medusa/src/services/discount.ts:253](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L253) +[medusa/src/services/discount.ts:238](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L238) ___ @@ -671,7 +689,7 @@ the discount #### Defined in -[packages/medusa/src/services/discount.ts:286](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L286) +[medusa/src/services/discount.ts:272](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L272) ___ @@ -695,7 +713,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -720,7 +738,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:344](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L344) +[medusa/src/services/discount.ts:332](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L332) ___ @@ -741,7 +759,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:685](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L685) +[medusa/src/services/discount.ts:672](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L672) ___ @@ -762,7 +780,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:587](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L587) +[medusa/src/services/discount.ts:571](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L571) ___ @@ -792,7 +810,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/discount.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/discount.ts#L107) +[medusa/src/services/discount.ts:101](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/discount.ts#L101) ___ @@ -816,4 +834,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/DraftOrderService.md b/docs/content/references/services/classes/DraftOrderService.md index ae5e6e769e..5a1d6e0f42 100644 --- a/docs/content/references/services/classes/DraftOrderService.md +++ b/docs/content/references/services/classes/DraftOrderService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/draft-order.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L61) +[medusa/src/services/draft-order.ts:66](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L66) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L55) +[medusa/src/services/draft-order.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L60) ___ @@ -90,17 +90,17 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L59) +[medusa/src/services/draft-order.ts:64](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L64) ___ ### draftOrderRepository\_ -• `Protected` `Readonly` **draftOrderRepository\_**: typeof `DraftOrderRepository` +• `Protected` `Readonly` **draftOrderRepository\_**: `Repository`<`DraftOrder`\> #### Defined in -[packages/medusa/src/services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L51) +[medusa/src/services/draft-order.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L56) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L54) +[medusa/src/services/draft-order.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L59) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L56) +[medusa/src/services/draft-order.ts:61](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L61) ___ @@ -128,33 +128,33 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/draft-order.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L48) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### orderRepository\_ -• `Protected` `Readonly` **orderRepository\_**: typeof `OrderRepository` +• `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`[]\> } #### Defined in -[packages/medusa/src/services/draft-order.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L53) +[medusa/src/services/draft-order.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L58) ___ ### paymentRepository\_ -• `Protected` `Readonly` **paymentRepository\_**: typeof `PaymentRepository` +• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> #### Defined in -[packages/medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L52) +[medusa/src/services/draft-order.ts:57](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L57) ___ @@ -164,7 +164,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L57) +[medusa/src/services/draft-order.ts:62](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L62) ___ @@ -174,7 +174,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L58) +[medusa/src/services/draft-order.ts:63](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L63) ___ @@ -182,13 +182,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/draft-order.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L49) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -205,7 +205,25 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L43) +[medusa/src/services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L51) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -244,7 +262,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -268,7 +286,7 @@ the created draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:255](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L255) +[medusa/src/services/draft-order.ts:259](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L259) ___ @@ -292,7 +310,7 @@ empty promise #### Defined in -[packages/medusa/src/services/draft-order.ts:154](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L154) +[medusa/src/services/draft-order.ts:155](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L155) ___ @@ -317,7 +335,7 @@ list of draft orders #### Defined in -[packages/medusa/src/services/draft-order.ts:232](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L232) +[medusa/src/services/draft-order.ts:237](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L237) ___ @@ -342,7 +360,7 @@ draft orders #### Defined in -[packages/medusa/src/services/draft-order.ts:178](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L178) +[medusa/src/services/draft-order.ts:179](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L179) ___ @@ -367,7 +385,7 @@ the created order #### Defined in -[packages/medusa/src/services/draft-order.ts:416](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L416) +[medusa/src/services/draft-order.ts:420](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L420) ___ @@ -392,7 +410,7 @@ the draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:94](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L94) +[medusa/src/services/draft-order.ts:97](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L97) ___ @@ -417,7 +435,7 @@ the draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:128](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L128) +[medusa/src/services/draft-order.ts:130](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L130) ___ @@ -441,7 +459,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -467,7 +485,7 @@ the updated draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:445](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/draft-order.ts#L445) +[medusa/src/services/draft-order.ts:449](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/draft-order.ts#L449) ___ @@ -491,4 +509,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/EventBusService.md b/docs/content/references/services/classes/EventBusService.md index bbe0239a94..c64c24d6dd 100644 --- a/docs/content/references/services/classes/EventBusService.md +++ b/docs/content/references/services/classes/EventBusService.md @@ -3,33 +3,89 @@ Can keep track of multiple subscribers to different events and run the subscribers when events happen. Events will run asynchronously. +## Hierarchy + +- `TransactionBaseService` + + ↳ **`EventBusService`** + +## Implements + +- `IEventBusService` + ## Constructors ### constructor -• **new EventBusService**(`__namedParameters`, `config`, `singleton?`) +• **new EventBusService**(`__namedParameters`, `config`, `isSingleton?`) #### Parameters | Name | Type | Default value | | :------ | :------ | :------ | | `__namedParameters` | `InjectedDependencies` | `undefined` | -| `config` | `ConfigModule` | `undefined` | -| `singleton` | `boolean` | `true` | +| `config` | `any` | `undefined` | +| `isSingleton` | `boolean` | `true` | + +#### Overrides + +TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/event-bus.ts:80](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L80) +[medusa/src/services/event-bus.ts:32](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L32) ## Properties +### \_\_configModule\_\_ + +• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + +#### Inherited from + +TransactionBaseService.\_\_configModule\_\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) + +___ + +### \_\_container\_\_ + +• `Protected` `Readonly` **\_\_container\_\_**: `any` + +#### Inherited from + +TransactionBaseService.\_\_container\_\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) + +___ + +### \_\_moduleDeclaration\_\_ + +• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + +#### Inherited from + +TransactionBaseService.\_\_moduleDeclaration\_\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) + +___ + ### config\_ • `Protected` `Readonly` **config\_**: `ConfigModule` #### Defined in -[packages/medusa/src/services/event-bus.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L64) +[medusa/src/services/event-bus.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L24) ___ @@ -39,77 +95,31 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:78](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L78) +[medusa/src/services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L30) ___ -### eventToSubscribersMap\_ +### eventBusModuleService\_ -• `Protected` `Readonly` **eventToSubscribersMap\_**: `Map`<`string` \| `symbol`, `SubscriberDescriptor`[]\> +• `Protected` `Readonly` **eventBusModuleService\_**: `AbstractEventBusModuleService` #### Defined in -[packages/medusa/src/services/event-bus.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L69) - -___ - -### jobSchedulerService\_ - -• `Protected` `Readonly` **jobSchedulerService\_**: `default` - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:68](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L68) - -___ - -### logger\_ - -• `Protected` `Readonly` **logger\_**: `Logger` - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:66](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L66) +[medusa/src/services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L27) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` + +#### Inherited from + +TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/event-bus.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L65) - -___ - -### queue\_ - -• `Protected` **queue\_**: `Bull` - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:75](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L75) - -___ - -### redisClient\_ - -• `Protected` `Readonly` **redisClient\_**: `Redis` - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:73](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L73) - -___ - -### redisSubscriber\_ - -• `Protected` `Readonly` **redisSubscriber\_**: `Redis` - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:74](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L74) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -119,17 +129,17 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:76](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L76) +[medusa/src/services/event-bus.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L29) ___ -### stagedJobRepository\_ +### stagedJobService\_ -• `Protected` `Readonly` **stagedJobRepository\_**: typeof `StagedJobRepository` +• `Protected` `Readonly` **stagedJobService\_**: [`StagedJobService`](StagedJobService.md) #### Defined in -[packages/medusa/src/services/event-bus.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L67) +[medusa/src/services/event-bus.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L25) ___ @@ -137,47 +147,70 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` +#### Inherited from + +TransactionBaseService.transactionManager\_ + #### Defined in -[packages/medusa/src/services/event-bus.ts:77](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L77) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods -### createCronJob +### atomicPhase\_ -▸ **createCronJob**<`T`\>(`eventName`, `data`, `cron`, `handler`, `options?`): `Promise`<`void`\> +▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> -Registers a cron job. - -**`Deprecated`** - -All cron job logic has been refactored to the `JobSchedulerService`. This method will be removed in a future release. +Wraps some work within a transactional block. If the service already has +a transaction manager attached this will be reused, otherwise a new +transaction manager is created. #### Type parameters | Name | | :------ | -| `T` | +| `TResult` | +| `TError` | #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `eventName` | `string` | the name of the event | -| `data` | `T` | the data to be sent with the event | -| `cron` | `string` | the cron pattern | -| `handler` | `Subscriber`<`unknown`\> | the handler to call on each cron job | -| `options?` | `CreateJobOptions` | - | +| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | +| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | +| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | #### Returns -`Promise`<`void`\> +`Promise`<`TResult`\> -void +the result of the transactional work + +#### Inherited from + +TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/services/event-bus.ts:467](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L467) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -205,9 +238,13 @@ Calls all subscribers when an event occurs. the jobs from our queue +#### Implementation of + +EventBusTypes.IEventBusService.emit + #### Defined in -[packages/medusa/src/services/event-bus.ts:228](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L228) +[medusa/src/services/event-bus.ts:112](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L112) ▸ **emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\> @@ -225,7 +262,7 @@ Calls all subscribers when an event occurs. | :------ | :------ | :------ | | `eventName` | `string` | the name of the event to be process. | | `data` | `T` | the data to send to the subscriber. | -| `options?` | `any` | options to add the job with | +| `options?` | `Record`<`string`, `unknown`\> | options to add the job with | #### Returns @@ -233,9 +270,13 @@ Calls all subscribers when an event occurs. the job from our queue +#### Implementation of + +EventBusTypes.IEventBusService.emit + #### Defined in -[packages/medusa/src/services/event-bus.ts:237](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L237) +[medusa/src/services/event-bus.ts:121](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L121) ___ @@ -249,7 +290,31 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:326](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L326) +[medusa/src/services/event-bus.ts:184](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L184) + +___ + +### shouldRetryTransaction\_ + +▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | + +#### Returns + +`boolean` + +#### Inherited from + +TransactionBaseService.shouldRetryTransaction\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -263,7 +328,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:316](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L316) +[medusa/src/services/event-bus.ts:174](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L174) ___ @@ -277,7 +342,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:321](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L321) +[medusa/src/services/event-bus.ts:179](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L179) ___ @@ -292,8 +357,8 @@ Adds a function to a list of event subscribers. | Name | Type | Description | | :------ | :------ | :------ | | `event` | `string` \| `symbol` | the event that the subscriber will listen for. | -| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event | -| `context?` | `SubscriberContext` | context to use when attaching subscriber happens. Subscribers must return a Promise. | +| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. | +| `context?` | `SubscriberContext` | subscriber context | #### Returns @@ -301,24 +366,29 @@ Adds a function to a list of event subscribers. this +#### Implementation of + +EventBusTypes.IEventBusService.subscribe + #### Defined in -[packages/medusa/src/services/event-bus.ts:160](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L160) +[medusa/src/services/event-bus.ts:78](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L78) ___ ### unsubscribe -▸ **unsubscribe**(`event`, `subscriber`): [`EventBusService`](EventBusService.md) +▸ **unsubscribe**(`event`, `subscriber`, `context`): [`EventBusService`](EventBusService.md) -Adds a function to a list of event subscribers. +Removes function from the list of event subscribers. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `event` | `string` \| `symbol` | the event that the subscriber will listen for. | -| `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. | +| `event` | `string` \| `symbol` | the event of the subcriber. | +| `subscriber` | `Subscriber`<`unknown`\> | the function to be removed | +| `context` | `SubscriberContext` | subscriber context | #### Returns @@ -326,56 +396,38 @@ Adds a function to a list of event subscribers. this +#### Implementation of + +EventBusTypes.IEventBusService.unsubscribe + #### Defined in -[packages/medusa/src/services/event-bus.ts:203](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L203) +[medusa/src/services/event-bus.ts:98](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L98) ___ ### withTransaction -▸ **withTransaction**(`transactionManager`): [`EventBusService`](EventBusService.md) +▸ **withTransaction**(`transactionManager?`): [`EventBusService`](EventBusService.md) #### Parameters | Name | Type | | :------ | :------ | -| `transactionManager` | `any` | +| `transactionManager?` | `EntityManager` | #### Returns [`EventBusService`](EventBusService.md) -#### Defined in +#### Implementation of -[packages/medusa/src/services/event-bus.ts:128](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L128) +EventBusTypes.IEventBusService.withTransaction -___ +#### Overrides -### worker\_ - -▸ **worker_**<`T`\>(`job`): `Promise`<`unknown`\> - -Handles incoming jobs. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `job` | `BullJob`<`T`\> | The job object | - -#### Returns - -`Promise`<`unknown`\> - -resolves to the results of the subscriber calls. +TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/services/event-bus.ts:366](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/event-bus.ts#L366) +[medusa/src/services/event-bus.ts:49](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/event-bus.ts#L49) diff --git a/docs/content/references/services/classes/FulfillmentProviderService.md b/docs/content/references/services/classes/FulfillmentProviderService.md index a19530f26c..ec33f1343f 100644 --- a/docs/content/references/services/classes/FulfillmentProviderService.md +++ b/docs/content/references/services/classes/FulfillmentProviderService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L47) +[medusa/src/services/fulfillment-provider.ts:44](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L44) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,17 +78,17 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L43) +[medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L40) ___ ### fulfillmentProviderRepository\_ -• `Protected` `Readonly` **fulfillmentProviderRepository\_**: typeof `FulfillmentProviderRepository` +• `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\> #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L45) +[medusa/src/services/fulfillment-provider.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L42) ___ @@ -96,13 +96,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L40) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -110,13 +110,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L41) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -155,7 +173,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -169,7 +187,7 @@ ___ | :------ | :------ | | `option` | `ShippingOption` | | `data` | `Record`<`string`, `unknown`\> | -| `cart?` | `Cart` \| `Order` | +| `cart?` | `Order` \| `Cart` | #### Returns @@ -177,7 +195,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:151](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L151) +[medusa/src/services/fulfillment-provider.ts:147](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L147) ___ @@ -197,7 +215,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:126](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L126) +[medusa/src/services/fulfillment-provider.ts:122](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L122) ___ @@ -217,7 +235,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:144](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L144) +[medusa/src/services/fulfillment-provider.ts:140](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L140) ___ @@ -240,7 +258,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:111](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L111) +[medusa/src/services/fulfillment-provider.ts:107](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L107) ___ @@ -260,7 +278,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:169](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L169) +[medusa/src/services/fulfillment-provider.ts:165](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L165) ___ @@ -274,7 +292,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:71](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L71) +[medusa/src/services/fulfillment-provider.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L67) ___ @@ -294,7 +312,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:79](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L79) +[medusa/src/services/fulfillment-provider.ts:75](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L75) ___ @@ -314,7 +332,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L57) +[medusa/src/services/fulfillment-provider.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L53) ___ @@ -340,7 +358,7 @@ document to fetch #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:188](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L188) +[medusa/src/services/fulfillment-provider.ts:184](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L184) ___ @@ -362,7 +380,7 @@ the payment fulfillment provider #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:100](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L100) +[medusa/src/services/fulfillment-provider.ts:96](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L96) ___ @@ -386,7 +404,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -408,7 +426,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:131](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L131) +[medusa/src/services/fulfillment-provider.ts:127](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L127) ___ @@ -428,7 +446,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:164](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment-provider.ts#L164) +[medusa/src/services/fulfillment-provider.ts:160](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment-provider.ts#L160) ___ @@ -452,4 +470,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/FulfillmentService.md b/docs/content/references/services/classes/FulfillmentService.md index bf534f4624..7f640a2a7d 100644 --- a/docs/content/references/services/classes/FulfillmentService.md +++ b/docs/content/references/services/classes/FulfillmentService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/fulfillment.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L50) +[medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L47) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,27 +78,27 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L43) +[medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L40) ___ ### fulfillmentRepository\_ -• `Protected` `Readonly` **fulfillmentRepository\_**: typeof `FulfillmentRepository` +• `Protected` `Readonly` **fulfillmentRepository\_**: `Repository`<`Fulfillment`\> #### Defined in -[packages/medusa/src/services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L44) +[medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L41) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: typeof `LineItemRepository` +• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } #### Defined in -[packages/medusa/src/services/fulfillment.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L46) +[medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L43) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L41) +[medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L38) ___ @@ -116,13 +116,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L48) +[medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L45) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L42) +[medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L39) ___ @@ -152,17 +152,17 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L40) +[medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L37) ___ ### trackingLinkRepository\_ -• `Protected` `Readonly` **trackingLinkRepository\_**: typeof `TrackingLinkRepository` +• `Protected` `Readonly` **trackingLinkRepository\_**: `Repository`<`TrackingLink`\> #### Defined in -[packages/medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L45) +[medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L42) ___ @@ -170,13 +170,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L38) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -215,7 +233,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -241,13 +259,13 @@ the result of the save operation #### Defined in -[packages/medusa/src/services/fulfillment.ts:269](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L269) +[medusa/src/services/fulfillment.ts:260](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L260) ___ ### createFulfillment -▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`, `context?`): `Promise`<`Fulfillment`[]\> +▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\> Creates an order fulfillment If items needs to be fulfilled by different provider, we make @@ -261,8 +279,6 @@ those partitions. | `order` | `CreateFulfillmentOrder` | order to create fulfillment for | | `itemsToFulfill` | `FulFillmentItemType`[] | the items in the order to fulfill | | `custom` | `Partial`<`Fulfillment`\> | potential custom values to add | -| `context` | `Object` | - | -| `context.locationId?` | `string` | - | #### Returns @@ -272,7 +288,7 @@ the created fulfillments #### Defined in -[packages/medusa/src/services/fulfillment.ts:211](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L211) +[medusa/src/services/fulfillment.ts:205](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L205) ___ @@ -299,7 +315,7 @@ the shipped fulfillment #### Defined in -[packages/medusa/src/services/fulfillment.ts:321](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L321) +[medusa/src/services/fulfillment.ts:312](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L312) ___ @@ -324,7 +340,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/fulfillment.ts:115](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L115) +[medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L109) ___ @@ -345,7 +361,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:76](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L76) +[medusa/src/services/fulfillment.ts:70](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L70) ___ @@ -370,7 +386,7 @@ the fulfillment #### Defined in -[packages/medusa/src/services/fulfillment.ts:172](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L172) +[medusa/src/services/fulfillment.ts:167](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L167) ___ @@ -394,7 +410,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -423,7 +439,7 @@ a line item that has the requested fulfillment quantity #### Defined in -[packages/medusa/src/services/fulfillment.ts:140](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/fulfillment.ts#L140) +[medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/fulfillment.ts#L134) ___ @@ -447,4 +463,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/GiftCardService.md b/docs/content/references/services/classes/GiftCardService.md index 08f6c17d6d..cbc7356f0e 100644 --- a/docs/content/references/services/classes/GiftCardService.md +++ b/docs/content/references/services/classes/GiftCardService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/gift-card.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L47) +[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L39) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,27 +78,27 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L38) +[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L33) ___ ### giftCardRepository\_ -• `Protected` `Readonly` **giftCardRepository\_**: typeof `GiftCardRepository` +• `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: (`query`: `ExtendedFindConfig`<`GiftCard`\>, `q?`: `string`) => `Promise`<[`GiftCard`[], `number`]\> } #### Defined in -[packages/medusa/src/services/gift-card.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L34) +[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L29) ___ ### giftCardTransactionRepo\_ -• `Protected` `Readonly` **giftCardTransactionRepo\_**: typeof `GiftCardTransactionRepository` +• `Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\> #### Defined in -[packages/medusa/src/services/gift-card.ts:36](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L36) +[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L31) ___ @@ -106,13 +106,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/gift-card.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L40) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L37) +[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L32) ___ @@ -130,13 +130,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/gift-card.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L41) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -152,7 +152,25 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L43) +[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L35) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -191,7 +209,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -215,7 +233,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/gift-card.ts:153](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L153) +[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L122) ___ @@ -235,7 +253,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:138](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L138) +[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L106) ___ @@ -259,7 +277,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/gift-card.ts:322](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L322) +[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L295) ___ @@ -282,7 +300,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/gift-card.ts:114](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L114) +[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L98) ___ @@ -305,7 +323,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/gift-card.ts:85](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L85) +[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L74) ___ @@ -330,7 +348,7 @@ the gift card #### Defined in -[packages/medusa/src/services/gift-card.ts:242](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L242) +[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L215) ___ @@ -351,7 +369,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:256](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L256) +[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L229) ___ @@ -372,7 +390,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:208](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L208) +[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L182) ___ @@ -396,7 +414,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -421,7 +439,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/gift-card.ts:276](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L276) +[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L249) ___ @@ -445,7 +463,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ @@ -463,7 +481,7 @@ the generated gift card code #### Defined in -[packages/medusa/src/services/gift-card.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L69) +[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L58) ___ @@ -489,4 +507,4 @@ the tax rate for the gift card #### Defined in -[packages/medusa/src/services/gift-card.ts:189](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/gift-card.ts#L189) +[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/gift-card.ts#L161) diff --git a/docs/content/references/services/classes/IdempotencyKeyService.md b/docs/content/references/services/classes/IdempotencyKeyService.md index 481435cd78..5ae6db6a7a 100644 --- a/docs/content/references/services/classes/IdempotencyKeyService.md +++ b/docs/content/references/services/classes/IdempotencyKeyService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L25) +[medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L25) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### idempotencyKeyRepository\_ -• `Protected` `Readonly` **idempotencyKeyRepository\_**: typeof `IdempotencyKeyRepository` +• `Protected` `Readonly` **idempotencyKeyRepository\_**: `Repository`<`IdempotencyKey`\> #### Defined in -[packages/medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L23) +[medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L23) ___ @@ -84,13 +84,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -98,13 +98,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L21) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -143,7 +161,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -169,7 +187,7 @@ the created idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L67) +[medusa/src/services/idempotency-key.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L68) ___ @@ -196,7 +214,7 @@ the existing or created idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L41) +[medusa/src/services/idempotency-key.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L40) ___ @@ -220,13 +238,13 @@ result of the update operation #### Defined in -[packages/medusa/src/services/idempotency-key.ts:116](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L116) +[medusa/src/services/idempotency-key.ts:138](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L138) ___ ### retrieve -▸ **retrieve**(`idempotencyKey`): `Promise`<`IdempotencyKey`\> +▸ **retrieve**(`idempotencyKeyOrSelector`): `Promise`<`IdempotencyKey`\> Retrieves an idempotency key @@ -234,7 +252,7 @@ Retrieves an idempotency key | Name | Type | Description | | :------ | :------ | :------ | -| `idempotencyKey` | `string` | key to retrieve | +| `idempotencyKeyOrSelector` | `string` \| `Selector`<`IdempotencyKey`\> | key or selector to retrieve | #### Returns @@ -244,7 +262,7 @@ idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:85](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L85) +[medusa/src/services/idempotency-key.ts:86](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L86) ___ @@ -268,7 +286,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -283,17 +301,7 @@ Locks an idempotency. | Name | Type | Description | | :------ | :------ | :------ | | `idempotencyKey` | `string` | key to update | -| `update` | `Object` | update object | -| `update.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `update.id?` | `string` | - | -| `update.idempotency_key?` | `string` | - | -| `update.locked_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `update.recovery_point?` | `string` | - | -| `update.request_method?` | `string` | - | -| `update.request_params?` | { [x: string]: unknown; } | - | -| `update.request_path?` | `string` | - | -| `update.response_body?` | { [x: string]: unknown; } | - | -| `update.response_code?` | `number` | - | +| `update` | `DeepPartial`<`IdempotencyKey`\> | update object | #### Returns @@ -303,7 +311,7 @@ result of the update operation #### Defined in -[packages/medusa/src/services/idempotency-key.ts:145](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L145) +[medusa/src/services/idempotency-key.ts:167](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L167) ___ @@ -327,7 +335,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ @@ -356,4 +364,4 @@ new updated idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:174](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/idempotency-key.ts#L174) +[medusa/src/services/idempotency-key.ts:196](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/idempotency-key.ts#L196) diff --git a/docs/content/references/services/classes/LineItemAdjustmentService.md b/docs/content/references/services/classes/LineItemAdjustmentService.md index fa0b5d5fef..30c43d6865 100644 --- a/docs/content/references/services/classes/LineItemAdjustmentService.md +++ b/docs/content/references/services/classes/LineItemAdjustmentService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L39) +[medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L36) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,31 +78,31 @@ ___ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L37) +[medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L34) ___ ### lineItemAdjustmentRepo\_ -• `Private` `Readonly` **lineItemAdjustmentRepo\_**: typeof `LineItemAdjustmentRepository` +• `Private` `Readonly` **lineItemAdjustmentRepo\_**: `Repository`<`LineItemAdjustment`\> #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L36) +[medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L33) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L33) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -110,13 +110,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L34) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -155,7 +173,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -179,7 +197,7 @@ line item adjustment #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:90](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L90) +[medusa/src/services/line-item-adjustment.ts:86](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L86) ___ @@ -204,7 +222,7 @@ a line item adjustment or undefined if no adjustment was created #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:263](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L263) +[medusa/src/services/line-item-adjustment.ts:262](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L262) ___ @@ -230,7 +248,7 @@ otherwise returns an array of line item adjustments for each line item in the ca #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:291](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L291) +[medusa/src/services/line-item-adjustment.ts:290](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L290) ___ @@ -254,7 +272,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:155](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L155) +[medusa/src/services/line-item-adjustment.ts:153](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L153) ___ @@ -280,7 +298,7 @@ a line item adjustment or undefined if no adjustment was created #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:189](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L189) +[medusa/src/services/line-item-adjustment.ts:188](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L188) ___ @@ -305,7 +323,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:138](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L138) +[medusa/src/services/line-item-adjustment.ts:136](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L136) ___ @@ -330,7 +348,7 @@ the line item adjustment. #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L58) +[medusa/src/services/line-item-adjustment.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L53) ___ @@ -354,7 +372,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -379,7 +397,7 @@ line item adjustment #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item-adjustment.ts#L107) +[medusa/src/services/line-item-adjustment.ts:104](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item-adjustment.ts#L104) ___ @@ -403,4 +421,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/LineItemService.md b/docs/content/references/services/classes/LineItemService.md index c0facaf683..c26aaf84c1 100644 --- a/docs/content/references/services/classes/LineItemService.md +++ b/docs/content/references/services/classes/LineItemService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/line-item.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L59) +[medusa/src/services/line-item.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L56) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cartRepository\_ -• `Protected` `Readonly` **cartRepository\_**: typeof `CartRepository` +• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> #### Defined in -[packages/medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L50) +[medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L47) ___ @@ -86,17 +86,17 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L55) +[medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L52) ___ ### itemTaxLineRepo\_ -• `Protected` `Readonly` **itemTaxLineRepo\_**: typeof `LineItemTaxLineRepository` +• `Protected` `Readonly` **itemTaxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `LineItemTaxLine`[]) => `Promise`<`LineItemTaxLine`[]\> } #### Defined in -[packages/medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L49) +[medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L46) ___ @@ -106,17 +106,17 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L56) +[medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L53) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: typeof `LineItemRepository` +• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } #### Defined in -[packages/medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L48) +[medusa/src/services/line-item.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L45) ___ @@ -124,13 +124,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/line-item.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L45) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L53) +[medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L50) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L52) +[medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L49) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L51) +[medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L48) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L54) +[medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L51) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L57) +[medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L54) ___ @@ -188,13 +188,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L46) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -233,7 +251,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -246,48 +264,7 @@ ___ | Name | Type | | :------ | :------ | | `ids` | `string` \| `string`[] | -| `data` | `Object` | -| `data.adjustments?` | (`undefined` \| { id?: string \| undefined; item\_id?: string \| undefined; item?: { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; ... 37 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 38 more ...; updated\_at?: { ...; }...)[] | -| `data.allow_discounts?` | `boolean` | -| `data.cart?` | { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; billing\_address?: { customer\_id?: string \| null \| undefined; customer?: { ...; } \| ... 1 more ... \| undefined; ... 15 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 36 more ...; updated\_at?: ... | -| `data.cart_id?` | `string` | -| `data.claim_order?` | { payment\_status?: ClaimPaymentStatus \| undefined; fulfillment\_status?: ClaimFulfillmentStatus \| undefined; claim\_items?: ({ images?: ({ ...; } \| undefined)[] \| undefined; ... 14 more ...; updated\_at?: { ...; } \| undefined; } \| undefined)[] \| undefined; ... 17 more ...; id?: string \| undefined; } | -| `data.claim_order_id?` | `string` | -| `data.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.description?` | ``null`` \| `string` | -| `data.discount_total?` | ``null`` \| `number` | -| `data.fulfilled_quantity?` | ``null`` \| `number` | -| `data.gift_card_total?` | ``null`` \| `number` | -| `data.has_shipping?` | ``null`` \| `boolean` | -| `data.id?` | `string` | -| `data.includes_tax?` | `boolean` | -| `data.is_giftcard?` | `boolean` | -| `data.is_return?` | `boolean` | -| `data.metadata?` | { [x: string]: unknown; } | -| `data.order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.order_edit?` | ``null`` \| { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; ... 50 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.order_edit_id?` | ``null`` \| `string` | -| `data.order_id?` | ``null`` \| `string` | -| `data.original_item_id?` | ``null`` \| `string` | -| `data.original_tax_total?` | ``null`` \| `number` | -| `data.original_total?` | ``null`` \| `number` | -| `data.quantity?` | `number` | -| `data.refundable?` | ``null`` \| `number` | -| `data.returned_quantity?` | ``null`` \| `number` | -| `data.shipped_quantity?` | ``null`` \| `number` | -| `data.should_merge?` | `boolean` | -| `data.subtotal?` | ``null`` \| `number` | -| `data.swap?` | { fulfillment\_status?: SwapFulfillmentStatus \| undefined; payment\_status?: SwapPaymentStatus \| undefined; order\_id?: string \| undefined; ... 20 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.swap_id?` | `string` | -| `data.tax_lines?` | (`undefined` \| { item\_id?: string \| undefined; item?: { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; ... 37 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 38 more ...; updated\_at?: { ...; } \| undefined; } \| undefin...)[] | -| `data.tax_total?` | ``null`` \| `number` | -| `data.thumbnail?` | ``null`` \| `string` | -| `data.title?` | `string` | -| `data.total?` | ``null`` \| `number` | -| `data.unit_price?` | `number` | -| `data.updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.variant?` | { title?: string \| undefined; product\_id?: string \| undefined; product?: { title?: string \| undefined; subtitle?: string \| null \| undefined; description?: string \| null \| undefined; ... 30 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 23 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.variant_id?` | ``null`` \| `string` | +| `data` | `DeepPartial`<`LineItem`\> | | `options` | `Object` | | `options.setOriginalLineItemId?` | `boolean` | @@ -297,7 +274,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:496](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L496) +[medusa/src/services/line-item.ts:494](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L494) ___ @@ -328,7 +305,7 @@ the created line item #### Defined in -[packages/medusa/src/services/line-item.ts:377](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L377) +[medusa/src/services/line-item.ts:373](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L373) ___ @@ -354,7 +331,7 @@ the created line items #### Defined in -[packages/medusa/src/services/line-item.ts:135](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L135) +[medusa/src/services/line-item.ts:130](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L130) ___ @@ -368,16 +345,7 @@ Create a line item tax line. | Name | Type | Description | | :------ | :------ | :------ | -| `args` | `Object` | tax line partial passed to the repo create method | -| `args.code?` | ``null`` \| `string` | - | -| `args.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `args.id?` | `string` | - | -| `args.item?` | { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; billing\_address?: { customer\_id?: string \| ... 1 more ... \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 36 more ...; updated\_at?: {... | - | -| `args.item_id?` | `string` | - | -| `args.metadata?` | { [x: string]: unknown; } | - | -| `args.name?` | `string` | - | -| `args.rate?` | `number` | - | -| `args.updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | +| `args` | `DeepPartial`<`LineItemTaxLine`\> | tax line partial passed to the repo create method | #### Returns @@ -387,13 +355,13 @@ a new line item tax line #### Defined in -[packages/medusa/src/services/line-item.ts:488](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L488) +[medusa/src/services/line-item.ts:486](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L486) ___ ### delete -▸ **delete**(`id`): `Promise`<`undefined` \| `LineItem`\> +▸ **delete**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\> Deletes a line item. @@ -405,19 +373,19 @@ Deletes a line item. #### Returns -`Promise`<`undefined` \| `LineItem`\> +`Promise`<`undefined` \| ``null`` \| `LineItem`\> the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item.ts:448](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L448) +[medusa/src/services/line-item.ts:446](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L446) ___ ### deleteWithTaxLines -▸ **deleteWithTaxLines**(`id`): `Promise`<`undefined` \| `LineItem`\> +▸ **deleteWithTaxLines**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\> Deletes a line item with the tax lines. @@ -429,13 +397,13 @@ Deletes a line item with the tax lines. #### Returns -`Promise`<`undefined` \| `LineItem`\> +`Promise`<`undefined` \| ``null`` \| `LineItem`\> the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item.ts:467](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L467) +[medusa/src/services/line-item.ts:465](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L465) ___ @@ -467,7 +435,7 @@ Generate a single or multiple line item without persisting the data into the db #### Defined in -[packages/medusa/src/services/line-item.ts:196](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L196) +[medusa/src/services/line-item.ts:191](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L191) ___ @@ -497,7 +465,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:311](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L311) +[medusa/src/services/line-item.ts:306](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L306) ___ @@ -518,7 +486,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:88](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L88) +[medusa/src/services/line-item.ts:83](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L83) ___ @@ -543,7 +511,7 @@ the line item #### Defined in -[packages/medusa/src/services/line-item.ts:108](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L108) +[medusa/src/services/line-item.ts:104](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L104) ___ @@ -567,7 +535,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -592,7 +560,7 @@ the updated line item(s) #### Defined in -[packages/medusa/src/services/line-item.ts:405](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L405) +[medusa/src/services/line-item.ts:403](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L403) ___ @@ -621,7 +589,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:567](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/line-item.ts#L567) +[medusa/src/services/line-item.ts:565](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/line-item.ts#L565) ___ @@ -645,4 +613,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/MiddlewareService.md b/docs/content/references/services/classes/MiddlewareService.md index 3e92b7dfc6..1db57d07d6 100644 --- a/docs/content/references/services/classes/MiddlewareService.md +++ b/docs/content/references/services/classes/MiddlewareService.md @@ -10,7 +10,7 @@ Orchestrates dynamic middleware registered through the Medusa Middleware API #### Defined in -[packages/medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L22) +[medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L22) ## Properties @@ -20,7 +20,7 @@ Orchestrates dynamic middleware registered through the Medusa Middleware API #### Defined in -[packages/medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L17) +[medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L17) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L18) +[medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L18) ___ @@ -40,7 +40,7 @@ ___ #### Defined in -[packages/medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L19) +[medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L19) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[packages/medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L20) +[medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L20) ## Methods @@ -75,7 +75,7 @@ void #### Defined in -[packages/medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L60) +[medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L60) ___ @@ -100,7 +100,7 @@ void #### Defined in -[packages/medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L79) +[medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L79) ___ @@ -122,7 +122,7 @@ Adds a middleware function to be called before cart creation #### Defined in -[packages/medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L96) +[medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L96) ___ @@ -143,7 +143,7 @@ ___ #### Defined in -[packages/medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L29) +[medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L29) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L34) +[medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L34) ___ @@ -185,7 +185,7 @@ Adds post authentication middleware to an express app. #### Defined in -[packages/medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L106) +[medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L106) ___ @@ -207,7 +207,7 @@ Adds pre authentication middleware to an express app. #### Defined in -[packages/medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L117) +[medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L117) ___ @@ -221,7 +221,7 @@ ___ #### Defined in -[packages/medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L123) +[medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L123) ___ @@ -245,4 +245,4 @@ nothing if the middleware is a function #### Defined in -[packages/medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/middleware.ts#L43) +[medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/middleware.ts#L43) diff --git a/docs/content/references/services/classes/NewTotalsService.md b/docs/content/references/services/classes/NewTotalsService.md index a475db7e9d..7c22ba8222 100644 --- a/docs/content/references/services/classes/NewTotalsService.md +++ b/docs/content/references/services/classes/NewTotalsService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/new-totals.ts:68](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L68) +[medusa/src/services/new-totals.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L67) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,21 +76,21 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L65) +[medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L64) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/new-totals.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L61) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:66](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L66) +[medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L65) ___ @@ -110,21 +110,39 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L64) +[medusa/src/services/new-totals.ts:63](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L63) ___ ### transactionManager\_ -• `Protected` `Readonly` **transactionManager\_**: `undefined` \| `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/new-totals.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L62) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -163,7 +181,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -189,7 +207,7 @@ Calculate and return the gift cards totals #### Defined in -[packages/medusa/src/services/new-totals.ts:445](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L445) +[medusa/src/services/new-totals.ts:447](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L447) ___ @@ -220,7 +238,7 @@ Calculate and return the gift cards totals based on their transactions #### Defined in -[packages/medusa/src/services/new-totals.ts:524](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L524) +[medusa/src/services/new-totals.ts:526](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L526) ___ @@ -250,7 +268,7 @@ Return the amount that can be refund on a line item #### Defined in -[packages/medusa/src/services/new-totals.ts:331](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L331) +[medusa/src/services/new-totals.ts:333](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L333) ___ @@ -277,7 +295,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:401](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L401) +[medusa/src/services/new-totals.ts:403](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L403) ___ @@ -303,7 +321,7 @@ Calculate and return the items totals for either the legacy calculation or the n #### Defined in -[packages/medusa/src/services/new-totals.ts:90](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L90) +[medusa/src/services/new-totals.ts:87](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L87) ___ @@ -331,7 +349,7 @@ Calculate and return the legacy calculated totals using the tax rate #### Defined in -[packages/medusa/src/services/new-totals.ts:255](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L255) +[medusa/src/services/new-totals.ts:254](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L254) ___ @@ -360,7 +378,7 @@ Calculate and return the totals for an item #### Defined in -[packages/medusa/src/services/new-totals.ts:151](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L151) +[medusa/src/services/new-totals.ts:147](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L147) ___ @@ -387,7 +405,7 @@ Calculate and return the shipping methods totals for either the legacy calculati #### Defined in -[packages/medusa/src/services/new-totals.ts:570](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L570) +[medusa/src/services/new-totals.ts:572](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L572) ___ @@ -413,7 +431,7 @@ Calculate and return the shipping method totals legacy using teh tax rate #### Defined in -[packages/medusa/src/services/new-totals.ts:728](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L728) +[medusa/src/services/new-totals.ts:729](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L729) ___ @@ -440,7 +458,7 @@ Calculate and return the shipping method totals #### Defined in -[packages/medusa/src/services/new-totals.ts:645](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/new-totals.ts#L645) +[medusa/src/services/new-totals.ts:646](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/new-totals.ts#L646) ___ @@ -464,7 +482,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -488,4 +506,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/NoteService.md b/docs/content/references/services/classes/NoteService.md index cd35ef4c28..1e0814bd99 100644 --- a/docs/content/references/services/classes/NoteService.md +++ b/docs/content/references/services/classes/NoteService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/note.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L29) +[medusa/src/services/note.ts:27](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L27) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L27) +[medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L25) ___ @@ -84,23 +84,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/note.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L24) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### noteRepository\_ -• `Protected` `Readonly` **noteRepository\_**: typeof `NoteRepository` +• `Protected` `Readonly` **noteRepository\_**: `Repository`<`Note`\> #### Defined in -[packages/medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L26) +[medusa/src/services/note.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L24) ___ @@ -108,13 +108,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L25) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -132,7 +132,25 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L18) +[medusa/src/services/note.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L18) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -171,7 +189,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -197,7 +215,7 @@ resolves to the creation result #### Defined in -[packages/medusa/src/services/note.ts:103](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L103) +[medusa/src/services/note.ts:97](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L97) ___ @@ -219,7 +237,7 @@ Deletes a given note #### Defined in -[packages/medusa/src/services/note.ts:161](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L161) +[medusa/src/services/note.ts:155](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L155) ___ @@ -244,7 +262,7 @@ notes related to the given search. #### Defined in -[packages/medusa/src/services/note.ts:82](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L82) +[medusa/src/services/note.ts:76](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L76) ___ @@ -269,7 +287,7 @@ which resolves to the requested note. #### Defined in -[packages/medusa/src/services/note.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L47) +[medusa/src/services/note.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L41) ___ @@ -293,7 +311,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -318,7 +336,7 @@ resolves to the updated element #### Defined in -[packages/medusa/src/services/note.ts:139](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/note.ts#L139) +[medusa/src/services/note.ts:133](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/note.ts#L133) ___ @@ -342,4 +360,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/NotificationService.md b/docs/content/references/services/classes/NotificationService.md index 4f75fbe0b1..67a6a90ab4 100644 --- a/docs/content/references/services/classes/NotificationService.md +++ b/docs/content/references/services/classes/NotificationService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/notification.ts:36](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L36) +[medusa/src/services/notification.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L33) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L27) +[medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L24) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L28) +[medusa/src/services/notification.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L25) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L31) +[medusa/src/services/notification.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L28) ___ @@ -104,33 +104,33 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/notification.ts:23](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L23) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### notificationProviderRepository\_ -• `Protected` `Readonly` **notificationProviderRepository\_**: typeof `NotificationProviderRepository` +• `Protected` `Readonly` **notificationProviderRepository\_**: `Repository`<`NotificationProvider`\> #### Defined in -[packages/medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L34) +[medusa/src/services/notification.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L31) ___ ### notificationRepository\_ -• `Protected` `Readonly` **notificationRepository\_**: typeof `NotificationRepository` +• `Protected` `Readonly` **notificationRepository\_**: `Repository`<`Notification`\> #### Defined in -[packages/medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L32) +[medusa/src/services/notification.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L29) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L26) +[medusa/src/services/notification.ts:23](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L23) ___ @@ -148,13 +148,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L24) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -193,7 +211,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -220,7 +238,7 @@ the result of notification subscribed #### Defined in -[packages/medusa/src/services/notification.ts:174](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L174) +[medusa/src/services/notification.ts:165](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L165) ___ @@ -245,7 +263,7 @@ the notifications that satisfy the query. #### Defined in -[packages/medusa/src/services/notification.ts:86](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L86) +[medusa/src/services/notification.ts:77](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L77) ___ @@ -268,7 +286,7 @@ used to generate on demand invoices or other documents. #### Defined in -[packages/medusa/src/services/notification.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L62) +[medusa/src/services/notification.ts:51](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L51) ___ @@ -290,7 +308,7 @@ Takes a list of notification provider ids and persists them in the database. #### Defined in -[packages/medusa/src/services/notification.ts:70](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L70) +[medusa/src/services/notification.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L59) ___ @@ -316,7 +334,7 @@ the newly created notification #### Defined in -[packages/medusa/src/services/notification.ts:254](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L254) +[medusa/src/services/notification.ts:245](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L245) ___ @@ -341,7 +359,7 @@ the notification #### Defined in -[packages/medusa/src/services/notification.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L107) +[medusa/src/services/notification.ts:98](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L98) ___ @@ -366,7 +384,7 @@ the notification provider #### Defined in -[packages/medusa/src/services/notification.ts:155](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L155) +[medusa/src/services/notification.ts:146](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L146) ___ @@ -393,7 +411,7 @@ the created notification #### Defined in -[packages/medusa/src/services/notification.ts:206](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L206) +[medusa/src/services/notification.ts:197](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L197) ___ @@ -417,7 +435,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -440,7 +458,7 @@ Subscribes a given provider to an event. #### Defined in -[packages/medusa/src/services/notification.ts:134](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/notification.ts#L134) +[medusa/src/services/notification.ts:125](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/notification.ts#L125) ___ @@ -464,4 +482,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/OauthService.md b/docs/content/references/services/classes/OauthService.md index 19d52cb625..4fb2d698e6 100644 --- a/docs/content/references/services/classes/OauthService.md +++ b/docs/content/references/services/classes/OauthService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/oauth.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L31) +[medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L28) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L27) +[medusa/src/services/oauth.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L24) ___ @@ -86,17 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L29) - -___ - -### manager - -• `Protected` **manager**: `EntityManager` - -#### Defined in - -[packages/medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L26) +[medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L26) ___ @@ -104,23 +94,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L19) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### oauthRepository\_ -• `Protected` **oauthRepository\_**: typeof `OauthRepository` +• `Protected` **oauthRepository\_**: `Repository`<`Oauth`\> #### Defined in -[packages/medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L28) +[medusa/src/services/oauth.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L25) ___ @@ -128,13 +118,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/oauth.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -151,7 +141,25 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L21) +[medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L19) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -190,7 +198,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -210,7 +218,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:88](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L88) +[medusa/src/services/oauth.ts:87](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L87) ___ @@ -232,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:122](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L122) +[medusa/src/services/oauth.ts:121](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L121) ___ @@ -252,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:80](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L80) +[medusa/src/services/oauth.ts:79](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L79) ___ @@ -272,7 +280,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:156](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L156) +[medusa/src/services/oauth.ts:155](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L155) ___ @@ -292,7 +300,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:112](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L112) +[medusa/src/services/oauth.ts:111](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L111) ___ @@ -312,7 +320,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L57) +[medusa/src/services/oauth.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L54) ___ @@ -332,7 +340,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L41) +[medusa/src/services/oauth.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L36) ___ @@ -356,7 +364,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -377,7 +385,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:101](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/oauth.ts#L101) +[medusa/src/services/oauth.ts:100](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/oauth.ts#L100) ___ @@ -401,4 +409,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/OrderEditItemChangeService.md b/docs/content/references/services/classes/OrderEditItemChangeService.md index 867ea2d942..52ca738e1e 100644 --- a/docs/content/references/services/classes/OrderEditItemChangeService.md +++ b/docs/content/references/services/classes/OrderEditItemChangeService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L34) +[medusa/src/services/order-edit-item-change.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L33) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) +• `Protected` `Readonly` **eventBus\_**: `IEventBusService` #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L30) +[medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L29) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L31) +[medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L30) ___ @@ -94,23 +94,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L26) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### orderItemChangeRepository\_ -• `Protected` `Readonly` **orderItemChangeRepository\_**: typeof `OrderItemChangeRepository` +• `Protected` `Readonly` **orderItemChangeRepository\_**: `Repository`<`OrderItemChange`\> #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L29) +[medusa/src/services/order-edit-item-change.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L28) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:32](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L32) +[medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L31) ___ @@ -128,13 +128,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L27) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -151,7 +151,25 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L21) +[medusa/src/services/order-edit-item-change.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L22) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -190,7 +208,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -210,7 +228,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:86](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L86) +[medusa/src/services/order-edit-item-change.ts:81](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L81) ___ @@ -230,7 +248,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:102](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L102) +[medusa/src/services/order-edit-item-change.ts:97](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L97) ___ @@ -251,7 +269,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:73](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L73) +[medusa/src/services/order-edit-item-change.ts:69](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L69) ___ @@ -272,7 +290,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit-item-change.ts#L51) +[medusa/src/services/order-edit-item-change.ts:48](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit-item-change.ts#L48) ___ @@ -296,7 +314,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -320,4 +338,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/OrderEditService.md b/docs/content/references/services/classes/OrderEditService.md index 2b5554b0ba..4f688da64e 100644 --- a/docs/content/references/services/classes/OrderEditService.md +++ b/docs/content/references/services/classes/OrderEditService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L68) +[medusa/src/services/order-edit.ts:75](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L75) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,17 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L63) +[medusa/src/services/order-edit.ts:69](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L69) + +___ + +### inventoryService\_ + +• `Protected` `Readonly` **inventoryService\_**: `undefined` \| `IInventoryService` + +#### Defined in + +[medusa/src/services/order-edit.ts:73](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L73) ___ @@ -86,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L65) +[medusa/src/services/order-edit.ts:71](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L71) ___ @@ -96,21 +106,21 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L62) +[medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L68) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L54) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -120,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L61) +[medusa/src/services/order-edit.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L67) ___ @@ -130,17 +140,17 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L66) +[medusa/src/services/order-edit.ts:72](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L72) ___ ### orderEditRepository\_ -• `Protected` `Readonly` **orderEditRepository\_**: typeof `OrderEditRepository` +• `Protected` `Readonly` **orderEditRepository\_**: `Repository`<`OrderEdit`\> #### Defined in -[packages/medusa/src/services/order-edit.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L57) +[medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L63) ___ @@ -150,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L59) +[medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L65) ___ @@ -160,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L64) +[medusa/src/services/order-edit.ts:70](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L70) ___ @@ -170,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L60) +[medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L66) ___ @@ -178,13 +188,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order-edit.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L55) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -205,7 +215,25 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L45) +[medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L54) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -226,7 +254,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:534](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L534) +[medusa/src/services/order-edit.ts:540](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L540) ___ @@ -265,7 +293,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -287,7 +315,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:678](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L678) +[medusa/src/services/order-edit.ts:686](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L686) ___ @@ -309,7 +337,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:717](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L717) +[medusa/src/services/order-edit.ts:725](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L725) ___ @@ -331,7 +359,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:156](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L156) +[medusa/src/services/order-edit.ts:162](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L162) ___ @@ -354,7 +382,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:258](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L258) +[medusa/src/services/order-edit.ts:260](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L260) ___ @@ -374,7 +402,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:491](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L491) +[medusa/src/services/order-edit.ts:490](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L490) ___ @@ -394,7 +422,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:234](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L234) +[medusa/src/services/order-edit.ts:238](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L238) ___ @@ -414,7 +442,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:790](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L790) +[medusa/src/services/order-edit.ts:808](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L808) ___ @@ -435,7 +463,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:606](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L606) +[medusa/src/services/order-edit.ts:612](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L612) ___ @@ -456,7 +484,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:148](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L148) +[medusa/src/services/order-edit.ts:154](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L154) ___ @@ -477,7 +505,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:124](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L124) +[medusa/src/services/order-edit.ts:130](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L130) ___ @@ -499,7 +527,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L439) +[medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L439) ___ @@ -520,7 +548,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L382) +[medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L382) ___ @@ -542,7 +570,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:638](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L638) +[medusa/src/services/order-edit.ts:644](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L644) ___ @@ -563,13 +591,13 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:95](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L95) +[medusa/src/services/order-edit.ts:102](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L102) ___ ### retrieveActive -▸ `Protected` **retrieveActive**(`orderId`, `config?`): `Promise`<`undefined` \| `OrderEdit`\> +▸ `Protected` **retrieveActive**(`orderId`, `config?`): `Promise`<`undefined` \| ``null`` \| `OrderEdit`\> #### Parameters @@ -580,11 +608,11 @@ ___ #### Returns -`Promise`<`undefined` \| `OrderEdit`\> +`Promise`<`undefined` \| ``null`` \| `OrderEdit`\> #### Defined in -[packages/medusa/src/services/order-edit.ts:769](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L769) +[medusa/src/services/order-edit.ts:788](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L788) ___ @@ -608,7 +636,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -621,37 +649,7 @@ ___ | Name | Type | | :------ | :------ | | `orderEditId` | `string` | -| `data` | `Object` | -| `data.canceled_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.canceled_by?` | `string` | -| `data.changes?` | (`undefined` \| { type?: OrderEditItemChangeType \| undefined; order\_edit\_id?: string \| undefined; order\_edit?: { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; ... 52 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 7 ...)[] | -| `data.confirmed_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.confirmed_by?` | `string` | -| `data.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.created_by?` | `string` | -| `data.declined_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.declined_by?` | `string` | -| `data.declined_reason?` | `string` | -| `data.difference_due?` | `number` | -| `data.discount_total?` | `number` | -| `data.gift_card_tax_total?` | `number` | -| `data.gift_card_total?` | `number` | -| `data.id?` | `string` | -| `data.internal_note?` | `string` | -| `data.items?` | (`undefined` \| { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; billing\_address?: { customer\_id?: string \| ... 1 more ... \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 36 more ...; updated\_at?: {...)[] | -| `data.order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.order_id?` | `string` | -| `data.payment_collection?` | { type?: PaymentCollectionType \| undefined; status?: PaymentCollectionStatus \| undefined; description?: string \| null \| undefined; ... 13 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.payment_collection_id?` | `string` | -| `data.requested_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.requested_by?` | `string` | -| `data.shipping_total?` | `number` | -| `data.status?` | `OrderEditStatus` | -| `data.subtotal?` | `number` | -| `data.tax_total?` | ``null`` \| `number` | -| `data.total?` | `number` | -| `data.updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.loadStatus?` | | +| `data` | `DeepPartial`<`OrderEdit`\> | #### Returns @@ -659,7 +657,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:205](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L205) +[medusa/src/services/order-edit.ts:211](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L211) ___ @@ -686,7 +684,7 @@ Create or update order edit item change line item and apply the quantity #### Defined in -[packages/medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L309) +[medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L309) ___ @@ -710,7 +708,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ @@ -730,4 +728,4 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:836](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order-edit.ts#L836) +[medusa/src/services/order-edit.ts:860](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order-edit.ts#L860) diff --git a/docs/content/references/services/classes/OrderService.md b/docs/content/references/services/classes/OrderService.md index 2294fcc0e2..5c9ecaacfe 100644 --- a/docs/content/references/services/classes/OrderService.md +++ b/docs/content/references/services/classes/OrderService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/order.ts:125](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L125) +[medusa/src/services/order.ts:137](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L137) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +utils/dist/common/transaction-base-service.d.ts:5 ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +utils/dist/common/transaction-base-service.d.ts:4 ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +utils/dist/common/transaction-base-service.d.ts:6 ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: typeof `AddressRepository` +• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[packages/medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L117) +[medusa/src/services/order.ts:128](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L128) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L116) +[medusa/src/services/order.ts:127](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L127) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:104](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L104) +[medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L115) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:108](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L108) +[medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L119) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L119) +[medusa/src/services/order.ts:130](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L130) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L120) +[medusa/src/services/order.ts:132](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L132) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L121) +[medusa/src/services/order.ts:133](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L133) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:109](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L109) +[medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L120) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:110](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L110) +[medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L121) ___ @@ -166,7 +166,17 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L118) +[medusa/src/services/order.ts:129](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L129) + +___ + +### inventoryService\_ + +• `Protected` `Readonly` **inventoryService\_**: `IInventoryService` + +#### Defined in + +[medusa/src/services/order.ts:131](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L131) ___ @@ -176,7 +186,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:111](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L111) +[medusa/src/services/order.ts:122](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L122) ___ @@ -184,13 +194,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order.ts:100](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L100) +utils/dist/common/transaction-base-service.d.ts:7 ___ @@ -200,17 +210,17 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:113](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L113) +[medusa/src/services/order.ts:124](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L124) ___ ### orderRepository\_ -• `Protected` `Readonly` **orderRepository\_**: typeof `OrderRepository` +• `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`[]\> } #### Defined in -[packages/medusa/src/services/order.ts:103](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L103) +[medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L114) ___ @@ -220,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:105](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L105) +[medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L116) ___ @@ -230,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:123](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L123) +[medusa/src/services/order.ts:135](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L135) ___ @@ -240,7 +250,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L115) +[medusa/src/services/order.ts:126](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L126) ___ @@ -250,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:106](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L106) +[medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L117) ___ @@ -260,7 +270,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L107) +[medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L118) ___ @@ -270,7 +280,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L114) +[medusa/src/services/order.ts:125](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L125) ___ @@ -280,21 +290,21 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:112](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L112) +[medusa/src/services/order.ts:123](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L123) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order.ts:101](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L101) +utils/dist/common/transaction-base-service.d.ts:8 ___ @@ -325,7 +335,25 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:81](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L81) +[medusa/src/services/order.ts:95](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L95) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:9 ## Methods @@ -348,7 +376,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:945](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L945) +[medusa/src/services/order.ts:1011](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1011) ___ @@ -373,7 +401,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:1483](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1483) +[medusa/src/services/order.ts:1547](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1547) ___ @@ -412,7 +440,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +utils/dist/common/transaction-base-service.d.ts:24 ___ @@ -438,7 +466,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1097](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1097) +[medusa/src/services/order.ts:1163](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1163) ___ @@ -462,7 +490,7 @@ updated order #### Defined in -[packages/medusa/src/services/order.ts:1420](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1420) +[medusa/src/services/order.ts:1484](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1484) ___ @@ -486,7 +514,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1186](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1186) +[medusa/src/services/order.ts:1252](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1252) ___ @@ -508,7 +536,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:513](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L513) +[medusa/src/services/order.ts:571](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L571) ___ @@ -532,7 +560,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/order.ts:543](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L543) +[medusa/src/services/order.ts:601](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L601) ___ @@ -564,7 +592,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1291](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1291) +[medusa/src/services/order.ts:1357](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1357) ___ @@ -586,7 +614,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:733](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L733) +[medusa/src/services/order.ts:791](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L791) ___ @@ -615,7 +643,7 @@ the result of the refund operation. #### Defined in -[packages/medusa/src/services/order.ts:1509](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1509) +[medusa/src/services/order.ts:1573](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1573) ___ @@ -646,7 +674,7 @@ the resulting order following the update. #### Defined in -[packages/medusa/src/services/order.ts:787](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L787) +[medusa/src/services/order.ts:845](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L845) ___ @@ -669,7 +697,7 @@ Calculate and attach the different total fields on the object #### Defined in -[packages/medusa/src/services/order.ts:1706](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1706) +[medusa/src/services/order.ts:1770](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1770) ▸ **decorateTotals**(`order`, `context?`): `Promise`<`Order`\> @@ -688,7 +716,7 @@ Calculate and attach the different total fields on the object #### Defined in -[packages/medusa/src/services/order.ts:1708](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1708) +[medusa/src/services/order.ts:1772](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1772) ___ @@ -709,7 +737,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1577](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1577) +[medusa/src/services/order.ts:1641](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1641) ___ @@ -735,7 +763,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/order.ts:1462](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1462) +[medusa/src/services/order.ts:1526](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1526) ___ @@ -755,7 +783,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1966](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1966) +[medusa/src/services/order.ts:2035](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L2035) ___ @@ -778,7 +806,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:179](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L179) +[medusa/src/services/order.ts:189](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L189) ___ @@ -801,7 +829,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:196](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L196) +[medusa/src/services/order.ts:206](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L206) ___ @@ -833,7 +861,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:1891](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1891) +[medusa/src/services/order.ts:1960](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1960) ___ @@ -858,7 +886,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:339](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L339) +[medusa/src/services/order.ts:390](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L390) ___ @@ -883,7 +911,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:435](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L435) +[medusa/src/services/order.ts:486](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L486) ___ @@ -908,7 +936,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:476](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L476) +[medusa/src/services/order.ts:527](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L527) ___ @@ -929,7 +957,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:380](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L380) +[medusa/src/services/order.ts:430](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L430) ___ @@ -951,7 +979,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:418](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L418) +[medusa/src/services/order.ts:469](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L469) ___ @@ -975,7 +1003,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +utils/dist/common/transaction-base-service.d.ts:12 ___ @@ -1001,7 +1029,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:263](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L263) +[medusa/src/services/order.ts:312](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L312) ___ @@ -1028,7 +1056,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/order.ts:1008](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1008) +[medusa/src/services/order.ts:1074](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1074) ___ @@ -1053,7 +1081,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:875](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L875) +[medusa/src/services/order.ts:933](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L933) ___ @@ -1078,7 +1106,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:914](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L914) +[medusa/src/services/order.ts:980](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L980) ___ @@ -1107,7 +1135,7 @@ a line item that has the requested fulfillment quantity #### Defined in -[packages/medusa/src/services/order.ts:1258](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/order.ts#L1258) +[medusa/src/services/order.ts:1324](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/order.ts#L1324) ___ @@ -1131,4 +1159,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +utils/dist/common/transaction-base-service.d.ts:11 diff --git a/docs/content/references/services/classes/PaymentCollectionService.md b/docs/content/references/services/classes/PaymentCollectionService.md index 8ec161737e..9726cbd9b3 100644 --- a/docs/content/references/services/classes/PaymentCollectionService.md +++ b/docs/content/references/services/classes/PaymentCollectionService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/payment-collection.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L51) +[medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L46) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L47) +[medusa/src/services/payment-collection.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L42) ___ @@ -86,31 +86,31 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L45) +[medusa/src/services/payment-collection.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L40) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment-collection.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L43) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentCollectionRepository\_ -• `Protected` `Readonly` **paymentCollectionRepository\_**: typeof `PaymentCollectionRepository` +• `Protected` `Readonly` **paymentCollectionRepository\_**: `Repository`<`PaymentCollection`\> & { `getPaymentCollectionIdByPaymentId`: (`paymentId`: `string`, `config`: `FindConfig`<`PaymentCollection`\>) => `Promise`<`PaymentCollection`\> ; `getPaymentCollectionIdBySessionId`: (`sessionId`: `string`, `config`: `FindConfig`<`PaymentCollection`\>) => `Promise`<`PaymentCollection`\> } #### Defined in -[packages/medusa/src/services/payment-collection.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L49) +[medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L44) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L46) +[medusa/src/services/payment-collection.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L41) ___ @@ -128,13 +128,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L44) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -153,7 +153,25 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:36](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L36) +[medusa/src/services/payment-collection.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L33) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -192,7 +210,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -218,7 +236,7 @@ the payment collection and its payment session. #### Defined in -[packages/medusa/src/services/payment-collection.ts:535](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L535) +[medusa/src/services/payment-collection.ts:527](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L527) ___ @@ -242,7 +260,7 @@ the payment collection created. #### Defined in -[packages/medusa/src/services/payment-collection.ts:111](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L111) +[medusa/src/services/payment-collection.ts:103](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L103) ___ @@ -266,7 +284,7 @@ the payment collection removed. #### Defined in -[packages/medusa/src/services/payment-collection.ts:180](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L180) +[medusa/src/services/payment-collection.ts:172](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L172) ___ @@ -287,7 +305,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:218](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L218) +[medusa/src/services/payment-collection.ts:210](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L210) ___ @@ -311,7 +329,7 @@ the payment session authorized. #### Defined in -[packages/medusa/src/services/payment-collection.ts:506](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L506) +[medusa/src/services/payment-collection.ts:498](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L498) ___ @@ -337,7 +355,7 @@ the new payment session created. #### Defined in -[packages/medusa/src/services/payment-collection.ts:414](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L414) +[medusa/src/services/payment-collection.ts:406](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L406) ___ @@ -362,7 +380,7 @@ the payment collection. #### Defined in -[packages/medusa/src/services/payment-collection.ts:74](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L74) +[medusa/src/services/payment-collection.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L67) ___ @@ -388,7 +406,7 @@ the payment collection and its payment session. #### Defined in -[packages/medusa/src/services/payment-collection.ts:368](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L368) +[medusa/src/services/payment-collection.ts:360](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L360) ___ @@ -414,7 +432,7 @@ the payment collection and its payment sessions. #### Defined in -[packages/medusa/src/services/payment-collection.ts:233](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L233) +[medusa/src/services/payment-collection.ts:225](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L225) ___ @@ -438,7 +456,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -453,24 +471,7 @@ Updates a payment collection. | Name | Type | Description | | :------ | :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection to update | -| `data` | `Object` | info to be updated | -| `data.amount?` | `number` | - | -| `data.authorized_amount?` | ``null`` \| `number` | - | -| `data.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `data.created_by?` | `string` | - | -| `data.currency?` | { code?: string \| undefined; symbol?: string \| undefined; symbol\_native?: string \| undefined; name?: string \| undefined; includes\_tax?: boolean \| undefined; } | - | -| `data.currency_code?` | `string` | - | -| `data.deleted_at?` | ``null`` \| { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | -| `data.description?` | ``null`` \| `string` | - | -| `data.id?` | `string` | - | -| `data.metadata?` | { [x: string]: unknown; } | - | -| `data.payment_sessions?` | (`undefined` \| { cart\_id?: string \| null \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; billing\_address?: { customer\_id?: string \| ... 1 more ... \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 36 more ...; updated...)[] | - | -| `data.payments?` | (`undefined` \| { swap\_id?: string \| undefined; swap?: { fulfillment\_status?: SwapFulfillmentStatus \| undefined; payment\_status?: SwapPaymentStatus \| undefined; ... 21 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; })[] | - | -| `data.region?` | { name?: string \| undefined; currency\_code?: string \| undefined; currency?: { code?: string \| undefined; symbol?: string \| undefined; symbol\_native?: string \| undefined; name?: string \| undefined; includes\_tax?: boolean \| undefined; } \| undefined; ... 15 more ...; updated\_at?: { ...; } \| undefined; } | - | -| `data.region_id?` | `string` | - | -| `data.status?` | `PaymentCollectionStatus` | - | -| `data.type?` | `ORDER_EDIT` | - | -| `data.updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | - | +| `data` | `DeepPartial`<`PaymentCollection`\> | info to be updated | #### Returns @@ -480,7 +481,7 @@ the payment collection updated. #### Defined in -[packages/medusa/src/services/payment-collection.ts:146](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-collection.ts#L146) +[medusa/src/services/payment-collection.ts:138](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-collection.ts#L138) ___ @@ -504,4 +505,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/PaymentProviderService.md b/docs/content/references/services/classes/PaymentProviderService.md index e6c7c71580..5e11c03694 100644 --- a/docs/content/references/services/classes/PaymentProviderService.md +++ b/docs/content/references/services/classes/PaymentProviderService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/payment-provider.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L64) +[medusa/src/services/payment-provider.ts:70](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L70) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L53) +[medusa/src/services/payment-provider.ts:55](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L55) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L59) +[medusa/src/services/payment-provider.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L65) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L62) +[medusa/src/services/payment-provider.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L68) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L60) +[medusa/src/services/payment-provider.ts:66](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L66) ___ @@ -116,53 +116,53 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment-provider.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L51) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentProviderRepository\_ -• `Protected` `Readonly` **paymentProviderRepository\_**: typeof `PaymentProviderRepository` +• `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\> #### Defined in -[packages/medusa/src/services/payment-provider.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L56) +[medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L58) ___ ### paymentRepository\_ -• `Protected` `Readonly` **paymentRepository\_**: typeof `PaymentRepository` +• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> #### Defined in -[packages/medusa/src/services/payment-provider.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L57) +[medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L59) ___ ### paymentSessionRepository\_ -• `Protected` `Readonly` **paymentSessionRepository\_**: typeof `PaymentSessionRepository` +• `Protected` `Readonly` **paymentSessionRepository\_**: `Repository`<`PaymentSession`\> #### Defined in -[packages/medusa/src/services/payment-provider.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L54) +[medusa/src/services/payment-provider.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L56) ___ ### refundRepository\_ -• `Protected` `Readonly` **refundRepository\_**: typeof `RefundRepository` +• `Protected` `Readonly` **refundRepository\_**: `Repository`<`Refund`\> #### Defined in -[packages/medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L58) +[medusa/src/services/payment-provider.ts:64](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L64) ___ @@ -170,13 +170,45 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment-provider.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L52) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) + +___ + +### paymentService\_ + +• `Protected` `get` **paymentService_**(): [`PaymentService`](PaymentService.md) + +#### Returns + +[`PaymentService`](PaymentService.md) + +#### Defined in + +[medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L60) ## Methods @@ -215,7 +247,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -236,7 +268,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:395](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L395) +[medusa/src/services/payment-provider.ts:523](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L523) ___ @@ -258,7 +290,7 @@ Build the create session context for both legacy and new API #### Defined in -[packages/medusa/src/services/payment-provider.ts:641](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L641) +[medusa/src/services/payment-provider.ts:840](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L840) ___ @@ -278,7 +310,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:448](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L448) +[medusa/src/services/payment-provider.ts:597](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L597) ___ @@ -298,7 +330,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:473](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L473) +[medusa/src/services/payment-provider.ts:636](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L636) ___ @@ -318,38 +350,48 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:357](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L357) +[medusa/src/services/payment-provider.ts:471](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L471) ___ ### createSession -▸ **createSession**<`TInput`\>(`providerIdOrSessionInput`, ...`cart`): `Promise`<`PaymentSession`\> +▸ **createSession**(`providerId`, `cart`): `Promise`<`PaymentSession`\> -Creates a payment session with the given provider. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `TInput` | extends `string` \| `PaymentSessionInput` = `string` \| `PaymentSessionInput` | +**`Deprecated`** #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `providerIdOrSessionInput` | `TInput` | the id of the provider to create payment with or the input data | -| `...cart` | `TInput` extends `string` ? [`Cart`] : [undefined?] | a cart object used to calculate the amount, etc. from | +| Name | Type | +| :------ | :------ | +| `providerId` | `string` | +| `cart` | `Cart` | #### Returns `Promise`<`PaymentSession`\> -the payment session +#### Defined in + +[medusa/src/services/payment-provider.ts:205](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L205) + +▸ **createSession**(`sessionInput`): `Promise`<`PaymentSession`\> + +Creates a payment session with the given provider. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sessionInput` | `PaymentSessionInput` | + +#### Returns + +`Promise`<`PaymentSession`\> #### Defined in -[packages/medusa/src/services/payment-provider.ts:180](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L180) +[medusa/src/services/payment-provider.ts:211](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L211) ___ @@ -369,7 +411,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:303](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L303) +[medusa/src/services/payment-provider.ts:402](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L402) ___ @@ -389,7 +431,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:468](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L468) +[medusa/src/services/payment-provider.ts:625](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L625) ___ @@ -403,7 +445,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:97](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L97) +[medusa/src/services/payment-provider.ts:102](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L102) ___ @@ -411,6 +453,8 @@ ___ ▸ **listPayments**(`selector`, `config?`): `Promise`<`Payment`[]\> +List all the payments according to the given selector and config. + #### Parameters | Name | Type | @@ -424,7 +468,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:132](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L132) +[medusa/src/services/payment-provider.ts:154](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L154) ___ @@ -449,7 +493,7 @@ Process the collected data. Can be used every time we need to process some colle #### Defined in -[packages/medusa/src/services/payment-provider.ts:731](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L731) +[medusa/src/services/payment-provider.ts:930](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L930) ___ @@ -478,7 +522,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:238](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L238) +[medusa/src/services/payment-provider.ts:301](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L301) ___ @@ -501,7 +545,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:578](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L578) +[medusa/src/services/payment-provider.ts:766](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L766) ___ @@ -524,7 +568,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:493](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L493) +[medusa/src/services/payment-provider.ts:667](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L667) ___ @@ -544,19 +588,21 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:78](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L78) +[medusa/src/services/payment-provider.ts:83](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L83) ___ ### retrievePayment -▸ **retrievePayment**(`id`, `relations?`): `Promise`<`Payment`\> +▸ **retrievePayment**(`paymentId`, `relations?`): `Promise`<`Payment`\> + +Retrieve a payment entity with the given id. #### Parameters | Name | Type | Default value | | :------ | :------ | :------ | -| `id` | `string` | `undefined` | +| `paymentId` | `string` | `undefined` | | `relations` | `string`[] | `[]` | #### Returns @@ -565,13 +611,13 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:104](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L104) +[medusa/src/services/payment-provider.ts:114](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L114) ___ ### retrieveProvider -▸ **retrieveProvider**<`TProvider`\>(`providerId`): `TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `any` +▸ **retrieveProvider**<`TProvider`\>(`providerId`): `TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `TProvider` extends `AbstractPaymentProcessor` ? `AbstractPaymentProcessor` : `any` Finds a provider given an id @@ -589,13 +635,13 @@ Finds a provider given an id #### Returns -`TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `any` +`TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `TProvider` extends `AbstractPaymentProcessor` ? `AbstractPaymentProcessor` : `any` the payment provider #### Defined in -[packages/medusa/src/services/payment-provider.ts:333](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L333) +[medusa/src/services/payment-provider.ts:442](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L442) ___ @@ -616,19 +662,21 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:618](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L618) +[medusa/src/services/payment-provider.ts:817](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L817) ___ ### retrieveSession -▸ **retrieveSession**(`id`, `relations?`): `Promise`<`PaymentSession`\> +▸ **retrieveSession**(`paymentSessionId`, `relations?`): `Promise`<`PaymentSession`\> + +Return the payment session for the given id. #### Parameters | Name | Type | Default value | | :------ | :------ | :------ | -| `id` | `string` | `undefined` | +| `paymentSessionId` | `string` | `undefined` | | `relations` | `string`[] | `[]` | #### Returns @@ -637,7 +685,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:145](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L145) +[medusa/src/services/payment-provider.ts:172](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L172) ___ @@ -667,7 +715,7 @@ Create or update a Payment session data. #### Defined in -[packages/medusa/src/services/payment-provider.ts:681](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L681) +[medusa/src/services/payment-provider.ts:882](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L882) ___ @@ -691,7 +739,27 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) + +___ + +### throwFromPaymentProcessorError + +▸ `Private` **throwFromPaymentProcessorError**(`errObj`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `errObj` | `PaymentProcessorError` | + +#### Returns + +`void` + +#### Defined in + +[medusa/src/services/payment-provider.ts:949](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L949) ___ @@ -714,7 +782,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:383](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L383) +[medusa/src/services/payment-provider.ts:512](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L512) ___ @@ -742,7 +810,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:268](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L268) +[medusa/src/services/payment-provider.ts:342](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L342) ___ @@ -763,7 +831,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:427](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment-provider.ts#L427) +[medusa/src/services/payment-provider.ts:569](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment-provider.ts#L569) ___ @@ -787,4 +855,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/PaymentService.md b/docs/content/references/services/classes/PaymentService.md index b6d5bb1399..4762a5d5a7 100644 --- a/docs/content/references/services/classes/PaymentService.md +++ b/docs/content/references/services/classes/PaymentService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/payment.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L40) +[medusa/src/services/payment.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L39) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,21 +76,21 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L28) +[medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L27) ___ ### manager\_ -• `Protected` `Readonly` **manager\_**: `EntityManager` +• `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L26) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -100,17 +100,17 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L29) +[medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L28) ___ ### paymentRepository\_ -• `Protected` `Readonly` **paymentRepository\_**: typeof `PaymentRepository` +• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> #### Defined in -[packages/medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L30) +[medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L29) ___ @@ -118,13 +118,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L27) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -145,7 +145,25 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L31) +[medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L30) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -184,7 +202,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -208,7 +226,7 @@ the payment captured. #### Defined in -[packages/medusa/src/services/payment.ts:161](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L161) +[medusa/src/services/payment.ts:153](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L153) ___ @@ -232,7 +250,7 @@ the payment created. #### Defined in -[packages/medusa/src/services/payment.ts:96](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L96) +[medusa/src/services/payment.ts:92](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L92) ___ @@ -259,7 +277,7 @@ the refund created. #### Defined in -[packages/medusa/src/services/payment.ts:210](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L210) +[medusa/src/services/payment.ts:202](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L202) ___ @@ -284,7 +302,7 @@ the payment. #### Defined in -[packages/medusa/src/services/payment.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L61) +[medusa/src/services/payment.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L58) ___ @@ -308,7 +326,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -335,7 +353,7 @@ the payment updated. #### Defined in -[packages/medusa/src/services/payment.ts:127](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/payment.ts#L127) +[medusa/src/services/payment.ts:121](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/payment.ts#L121) ___ @@ -359,4 +377,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/PriceListService.md b/docs/content/references/services/classes/PriceListService.md index 2e6be7c02b..7341e69205 100644 --- a/docs/content/references/services/classes/PriceListService.md +++ b/docs/content/references/services/classes/PriceListService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/price-list.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L57) +[medusa/src/services/price-list.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L59) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L48) +[medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L50) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L55) +[medusa/src/services/price-list.ts:57](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L57) ___ @@ -96,33 +96,33 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L45) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### moneyAmountRepo\_ -• `Protected` `Readonly` **moneyAmountRepo\_**: typeof `MoneyAmountRepository` +• `Protected` `Readonly` **moneyAmountRepo\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: (`priceListId`: `string`, `prices`: `PriceListPriceCreateInput`[], `overrideExisting`: `boolean`) => `Promise`<`MoneyAmount`[]\> ; `deletePriceListPrices`: (`priceListId`: `string`, `moneyAmountIds`: `string`[]) => `Promise`<`void`\> ; `deleteVariantPricesNotIn`: (`variantIdOrData`: `string` \| { `prices`: `ProductVariantPrice`[] ; `variantId`: `string` }[], `prices?`: `Price`[]) => `Promise`<`void`\> ; `findManyForVariantInPriceList`: (`variant_id`: `string`, `price_list_id`: `string`, `requiresPriceList`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantInRegion`: (`variant_id`: `string`, `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findVariantPricesNotIn`: (`variantId`: `string`, `prices`: `Price`[]) => `Promise`<`MoneyAmount`[]\> ; `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`MoneyAmount`\>[]) => `Promise`<`MoneyAmount`[]\> ; `updatePriceListPrices`: (`priceListId`: `string`, `updates`: `PriceListPriceUpdateInput`[]) => `Promise`<`MoneyAmount`[]\> ; `upsertVariantCurrencyPrice`: (`variantId`: `string`, `price`: `Price`) => `Promise`<`MoneyAmount`\> } #### Defined in -[packages/medusa/src/services/price-list.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L53) +[medusa/src/services/price-list.ts:55](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L55) ___ ### priceListRepo\_ -• `Protected` `Readonly` **priceListRepo\_**: typeof `PriceListRepository` +• `Protected` `Readonly` **priceListRepo\_**: `Repository`<`PriceList`\> & { `listAndCount`: (`query`: `ExtendedFindConfig`<`PriceList`\>, `q?`: `string`) => `Promise`<[`PriceList`[], `number`]\> } #### Defined in -[packages/medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L52) +[medusa/src/services/price-list.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L54) ___ @@ -132,17 +132,17 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L50) +[medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L52) ___ ### productVariantRepo\_ -• `Protected` `Readonly` **productVariantRepo\_**: typeof `ProductVariantRepository` +• `Protected` `Readonly` **productVariantRepo\_**: `Repository`<`ProductVariant`\> #### Defined in -[packages/medusa/src/services/price-list.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L54) +[medusa/src/services/price-list.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L56) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L49) +[medusa/src/services/price-list.ts:51](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L51) ___ @@ -160,13 +160,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L46) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -176,7 +176,25 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L51) +[medusa/src/services/price-list.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L53) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -190,7 +208,7 @@ Add `currency_code` to an MA record if `region_id`is passed. | Name | Type | | :------ | :------ | -| `T` | extends `PriceListPriceCreateInput` \| `PriceListPriceUpdateInput` | +| `T` | extends `PriceListPriceUpdateInput` \| `PriceListPriceCreateInput` | #### Parameters @@ -206,7 +224,7 @@ updated `prices` list #### Defined in -[packages/medusa/src/services/price-list.ts:519](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L519) +[medusa/src/services/price-list.ts:563](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L563) ___ @@ -232,7 +250,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:218](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L218) +[medusa/src/services/price-list.ts:220](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L220) ___ @@ -271,7 +289,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -295,7 +313,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:258](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L258) +[medusa/src/services/price-list.ts:260](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L260) ___ @@ -319,7 +337,7 @@ created Price List #### Defined in -[packages/medusa/src/services/price-list.ts:119](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L119) +[medusa/src/services/price-list.ts:121](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L121) ___ @@ -344,7 +362,7 @@ empty promise #### Defined in -[packages/medusa/src/services/price-list.ts:272](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L272) +[medusa/src/services/price-list.ts:274](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L274) ___ @@ -369,7 +387,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:243](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L243) +[medusa/src/services/price-list.ts:245](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L245) ___ @@ -390,7 +408,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:446](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L446) +[medusa/src/services/price-list.ts:490](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L490) ___ @@ -411,7 +429,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:483](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L483) +[medusa/src/services/price-list.ts:527](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L527) ___ @@ -436,7 +454,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/price-list.ts:292](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L292) +[medusa/src/services/price-list.ts:294](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L294) ___ @@ -451,7 +469,7 @@ Lists Price Lists and adds count | Name | Type | Description | | :------ | :------ | :------ | | `selector` | `FilterablePriceListProps` | the query object for find | -| `config` | `FindConfig`<`FilterablePriceListProps`\> | the config to be used for find | +| `config` | `FindConfig`<`PriceList`\> | the config to be used for find | #### Returns @@ -461,7 +479,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L316) +[medusa/src/services/price-list.ts:324](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L324) ___ @@ -474,7 +492,7 @@ ___ | Name | Type | Default value | | :------ | :------ | :------ | | `priceListId` | `string` | `undefined` | -| `selector` | `Selector`<`Product`\> \| `FilterableProductProps` | `{}` | +| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | `{}` | | `config` | `FindConfig`<`Product`\> | `undefined` | | `requiresPriceList` | `boolean` | `false` | @@ -484,7 +502,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:364](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L364) +[medusa/src/services/price-list.ts:408](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L408) ___ @@ -507,7 +525,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:412](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L412) +[medusa/src/services/price-list.ts:456](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L456) ___ @@ -532,7 +550,7 @@ the collection. #### Defined in -[packages/medusa/src/services/price-list.ts:88](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L88) +[medusa/src/services/price-list.ts:88](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L88) ___ @@ -556,7 +574,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -581,7 +599,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:167](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L167) +[medusa/src/services/price-list.ts:169](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L169) ___ @@ -602,7 +620,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:345](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/price-list.ts#L345) +[medusa/src/services/price-list.ts:387](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/price-list.ts#L387) ___ @@ -626,4 +644,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/PricingService.md b/docs/content/references/services/classes/PricingService.md index eaa7eea4b7..1ea15b1d99 100644 --- a/docs/content/references/services/classes/PricingService.md +++ b/docs/content/references/services/classes/PricingService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/pricing.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L44) +[medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L42) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L42) +[medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L40) ___ @@ -86,13 +86,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L36) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L40) +[medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L38) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L41) +[medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L39) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L38) +[medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L36) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L39) +[medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L37) ___ @@ -140,13 +140,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -185,13 +203,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### calculateTaxes -▸ **calculateTaxes**(`variantPricing`, `productRates`): `Promise`<`TaxedPricing`\> +▸ **calculateTaxes**(`variantPricing`, `productRates`): `TaxedPricing` Gets the prices for a product variant @@ -204,13 +222,13 @@ Gets the prices for a product variant #### Returns -`Promise`<`TaxedPricing`\> +`TaxedPricing` The tax related variant prices. #### Defined in -[packages/medusa/src/services/pricing.ts:105](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L105) +[medusa/src/services/pricing.ts:101](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L101) ___ @@ -218,7 +236,7 @@ ___ ▸ **collectPricingContext**(`context`): `Promise`<`PricingContext`\> -Collects additional information neccessary for completing the price +Collects additional information necessary for completing the price selection. #### Parameters @@ -235,7 +253,7 @@ The pricing context #### Defined in -[packages/medusa/src/services/pricing.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L69) +[medusa/src/services/pricing.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L65) ___ @@ -261,7 +279,7 @@ A map of variant ids to their corresponding prices #### Defined in -[packages/medusa/src/services/pricing.ts:389](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L389) +[medusa/src/services/pricing.ts:388](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L388) ___ @@ -286,7 +304,7 @@ A map of variant ids to their corresponding prices #### Defined in -[packages/medusa/src/services/pricing.ts:407](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L407) +[medusa/src/services/pricing.ts:406](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L406) ___ @@ -308,7 +326,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:351](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L351) +[medusa/src/services/pricing.ts:349](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L349) ___ @@ -333,7 +351,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:214](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L214) +[medusa/src/services/pricing.ts:212](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L212) ___ @@ -362,7 +380,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:253](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L253) +[medusa/src/services/pricing.ts:251](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L251) ___ @@ -384,7 +402,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:167](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L167) +[medusa/src/services/pricing.ts:163](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L163) ___ @@ -416,7 +434,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:294](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L294) +[medusa/src/services/pricing.ts:292](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L292) ___ @@ -441,7 +459,7 @@ The shipping option prices #### Defined in -[packages/medusa/src/services/pricing.ts:493](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L493) +[medusa/src/services/pricing.ts:486](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L486) ___ @@ -466,7 +484,7 @@ A list of products with variants decorated with prices #### Defined in -[packages/medusa/src/services/pricing.ts:450](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L450) +[medusa/src/services/pricing.ts:450](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L450) ___ @@ -491,13 +509,13 @@ A list of shipping options with prices #### Defined in -[packages/medusa/src/services/pricing.ts:555](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L555) +[medusa/src/services/pricing.ts:548](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L548) ___ ### setVariantPrices -▸ **setVariantPrices**(`variants`, `context`): `Promise`<`PricedVariant`[]\> +▸ **setVariantPrices**(`variants`, `context?`): `Promise`<`PricedVariant`[]\> Set additional prices on a list of product variants. @@ -516,7 +534,7 @@ A list of products with variants decorated with prices #### Defined in -[packages/medusa/src/services/pricing.ts:425](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/pricing.ts#L425) +[medusa/src/services/pricing.ts:424](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/pricing.ts#L424) ___ @@ -540,7 +558,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -564,4 +582,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ProductCategoryService.md b/docs/content/references/services/classes/ProductCategoryService.md index 89d0aaaf9f..1629961404 100644 --- a/docs/content/references/services/classes/ProductCategoryService.md +++ b/docs/content/references/services/classes/ProductCategoryService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-category.ts:35](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L35) +[medusa/src/services/product-category.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L40) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-category.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L25) +[medusa/src/services/product-category.ts:32](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L32) ___ @@ -86,23 +86,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-category.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L27) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productCategoryRepo\_ -• `Protected` `Readonly` **productCategoryRepo\_**: typeof `ProductCategoryRepository` +• `Protected` `Readonly` **productCategoryRepo\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } #### Defined in -[packages/medusa/src/services/product-category.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L24) +[medusa/src/services/product-category.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L31) ___ @@ -110,13 +110,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-category.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L26) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -134,7 +134,25 @@ ___ #### Defined in -[packages/medusa/src/services/product-category.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L29) +[medusa/src/services/product-category.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L34) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -159,7 +177,7 @@ the product category on which the products have been added #### Defined in -[packages/medusa/src/services/product-category.ts:227](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L227) +[medusa/src/services/product-category.ts:266](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L266) ___ @@ -198,7 +216,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -210,9 +228,9 @@ Creates a product category #### Parameters -| Name | Type | -| :------ | :------ | -| `productCategoryInput` | `CreateProductCategoryInput` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `productCategoryInput` | `CreateProductCategoryInput` | parameters to create a product category | #### Returns @@ -222,7 +240,7 @@ created product category #### Defined in -[packages/medusa/src/services/product-category.ts:132](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L132) +[medusa/src/services/product-category.ts:139](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L139) ___ @@ -246,7 +264,29 @@ a promise #### Defined in -[packages/medusa/src/services/product-category.ts:191](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L191) +[medusa/src/services/product-category.ts:220](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L220) + +___ + +### fetchReorderConditions + +▸ `Protected` **fetchReorderConditions**(`productCategory`, `input`, `shouldDeleteElement?`): `ReorderConditions` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `productCategory` | `ProductCategory` | `undefined` | +| `input` | `UpdateProductCategoryInput` | `undefined` | +| `shouldDeleteElement` | `boolean` | `false` | + +#### Returns + +`ReorderConditions` + +#### Defined in + +[medusa/src/services/product-category.ts:301](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L301) ___ @@ -259,11 +299,11 @@ product category that match the query. #### Parameters -| Name | Type | -| :------ | :------ | -| `selector` | `QuerySelector`<`ProductCategory`\> | -| `config` | `FindConfig`<`ProductCategory`\> | -| `treeSelector` | `QuerySelector`<`ProductCategory`\> | +| Name | Type | Description | +| :------ | :------ | :------ | +| `selector` | `TreeQuerySelector`<`ProductCategory`\> | Filter options for product category. | +| `config` | `FindConfig`<`ProductCategory`\> | Configuration for query. | +| `treeSelector` | `QuerySelector`<`ProductCategory`\> | Filter options for product category tree relations | #### Returns @@ -275,7 +315,28 @@ an array containing the product category as #### Defined in -[packages/medusa/src/services/product-category.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L55) +[medusa/src/services/product-category.ts:61](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L61) + +___ + +### performReordering + +▸ `Protected` **performReordering**(`repository`, `conditions`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } | +| `conditions` | `ReorderConditions` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[medusa/src/services/product-category.ts:329](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L329) ___ @@ -300,13 +361,13 @@ the product category on which the products have been removed #### Defined in -[packages/medusa/src/services/product-category.ts:245](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L245) +[medusa/src/services/product-category.ts:285](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L285) ___ ### retrieve -▸ **retrieve**(`productCategoryId`, `config?`, `selector?`): `Promise`<`ProductCategory`\> +▸ **retrieve**(`productCategoryId`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> Retrieves a product category by id. @@ -317,6 +378,7 @@ Retrieves a product category by id. | `productCategoryId` | `string` | the id of the product category to retrieve. | | `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. | | `selector` | `Selector`<`ProductCategory`\> | - | +| `treeSelector` | `QuerySelector`<`ProductCategory`\> | - | #### Returns @@ -326,7 +388,28 @@ the product category. #### Defined in -[packages/medusa/src/services/product-category.ts:92](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L92) +[medusa/src/services/product-category.ts:100](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L100) + +___ + +### shiftSiblings + +▸ `Protected` **shiftSiblings**(`repository`, `conditions`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } | +| `conditions` | `ReorderConditions` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[medusa/src/services/product-category.ts:367](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L367) ___ @@ -350,7 +433,32 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) + +___ + +### transformParentIdToEntity + +▸ `Protected` **transformParentIdToEntity**(`productCategoryInput`): `Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\> + +Accepts an input object and transforms product_category_id +into product_category entity. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `productCategoryInput` | `CreateProductCategoryInput` \| `UpdateProductCategoryInput` | params used to create/update | + +#### Returns + +`Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\> + +transformed productCategoryInput + +#### Defined in + +[medusa/src/services/product-category.ts:465](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L465) ___ @@ -375,7 +483,7 @@ updated product category #### Defined in -[packages/medusa/src/services/product-category.ts:156](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-category.ts#L156) +[medusa/src/services/product-category.ts:173](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-category.ts#L173) ___ @@ -399,4 +507,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ProductCollectionService.md b/docs/content/references/services/classes/ProductCollectionService.md index 614a8e3294..dad5d64b39 100644 --- a/docs/content/references/services/classes/ProductCollectionService.md +++ b/docs/content/references/services/classes/ProductCollectionService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-collection.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L34) +[medusa/src/services/product-collection.ts:49](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L49) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L29) +[medusa/src/services/product-collection.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L36) ___ @@ -86,33 +86,33 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L26) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productCollectionRepository\_ -• `Protected` `Readonly` **productCollectionRepository\_**: typeof `ProductCollectionRepository` +• `Protected` `Readonly` **productCollectionRepository\_**: `Repository`<`ProductCollection`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductCollection`\>) => `Promise`<[`ProductCollection`[], `number`]\> } #### Defined in -[packages/medusa/src/services/product-collection.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L31) +[medusa/src/services/product-collection.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L38) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: typeof `ProductRepository` +• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findAndCount`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<[`Product`[], `number`]\> ; `findOne`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>) => `Promise`<``null`` \| `Product`\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `prepareQueryBuilder_`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<`SelectQueryBuilder`<`Product`\>\> ; `upsertShippingProfile`: (`productIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`Product`[]\> } #### Defined in -[packages/medusa/src/services/product-collection.ts:32](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L32) +[medusa/src/services/product-collection.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L39) ___ @@ -120,13 +120,51 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L27) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +___ + +### Events + +▪ `Static` `Readonly` **Events**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `CREATED` | `string` | +| `DELETED` | `string` | +| `PRODUCTS_ADDED` | `string` | +| `PRODUCTS_REMOVED` | `string` | +| `UPDATED` | `string` | + +#### Defined in + +[medusa/src/services/product-collection.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L41) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -147,7 +185,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:181](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L181) +[medusa/src/services/product-collection.ts:216](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L216) ___ @@ -186,7 +224,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -210,7 +248,7 @@ created collection #### Defined in -[packages/medusa/src/services/product-collection.ts:114](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L114) +[medusa/src/services/product-collection.ts:128](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L128) ___ @@ -234,7 +272,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-collection.ts:163](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L163) +[medusa/src/services/product-collection.ts:192](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L192) ___ @@ -261,7 +299,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-collection.ts:219](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L219) +[medusa/src/services/product-collection.ts:274](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L274) ___ @@ -275,7 +313,7 @@ Lists product collections and add count. | Name | Type | Description | | :------ | :------ | :------ | -| `selector` | `Selector`<`ProductCollection`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find | +| `selector` | `ListAndCountSelector` | the query object for find | | `config` | `FindConfig`<`ProductCollection`\> | the config to be used for find | #### Returns @@ -286,7 +324,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-collection.ts:236](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L236) +[medusa/src/services/product-collection.ts:291](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L291) ___ @@ -307,7 +345,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:198](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L198) +[medusa/src/services/product-collection.ts:242](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L242) ___ @@ -332,7 +370,7 @@ the collection. #### Defined in -[packages/medusa/src/services/product-collection.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L54) +[medusa/src/services/product-collection.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L68) ___ @@ -357,7 +395,7 @@ the collection. #### Defined in -[packages/medusa/src/services/product-collection.ts:88](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L88) +[medusa/src/services/product-collection.ts:102](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L102) ___ @@ -381,7 +419,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -406,7 +444,7 @@ update collection #### Defined in -[packages/medusa/src/services/product-collection.ts:133](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-collection.ts#L133) +[medusa/src/services/product-collection.ts:154](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-collection.ts#L154) ___ @@ -430,4 +468,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ProductService.md b/docs/content/references/services/classes/ProductService.md index 617a13f542..afcad8316d 100644 --- a/docs/content/references/services/classes/ProductService.md +++ b/docs/content/references/services/classes/ProductService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product.ts:78](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L78) +[medusa/src/services/product.ts:71](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L71) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:68](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L68) +[medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L61) ___ @@ -86,17 +86,17 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L69) +[medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L62) ___ ### imageRepository\_ -• `Protected` `Readonly` **imageRepository\_**: typeof `ImageRepository` +• `Protected` `Readonly` **imageRepository\_**: `Repository`<`Image`\> & { `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`Image`\>[]) => `Promise`<`Image`[]\> ; `upsertImages`: (`imageUrls`: `string`[]) => `Promise`<`Image`[]\> } #### Defined in -[packages/medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L63) +[medusa/src/services/product.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L56) ___ @@ -104,73 +104,73 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L55) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productCategoryRepository\_ -• `Protected` `Readonly` **productCategoryRepository\_**: typeof `ProductCategoryRepository` +• `Protected` `Readonly` **productCategoryRepository\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } #### Defined in -[packages/medusa/src/services/product.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L65) +[medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L58) ___ ### productOptionRepository\_ -• `Protected` `Readonly` **productOptionRepository\_**: typeof `ProductOptionRepository` +• `Protected` `Readonly` **productOptionRepository\_**: `Repository`<`ProductOption`\> #### Defined in -[packages/medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L58) +[medusa/src/services/product.ts:51](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L51) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: typeof `ProductRepository` +• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findAndCount`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<[`Product`[], `number`]\> ; `findOne`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>) => `Promise`<``null`` \| `Product`\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `prepareQueryBuilder_`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<`SelectQueryBuilder`<`Product`\>\> ; `upsertShippingProfile`: (`productIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`Product`[]\> } #### Defined in -[packages/medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L59) +[medusa/src/services/product.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L52) ___ ### productTagRepository\_ -• `Protected` `Readonly` **productTagRepository\_**: typeof `ProductTagRepository` +• `Protected` `Readonly` **productTagRepository\_**: `Repository`<`ProductTag`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductTag`\>) => `Promise`<[`ProductTag`[], `number`]\> ; `listTagsByUsage`: (`count`: `number`) => `Promise`<`ProductTag`[]\> ; `upsertTags`: (`tags`: `UpsertTagsInput`) => `Promise`<`ProductTag`[]\> } #### Defined in -[packages/medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L62) +[medusa/src/services/product.ts:55](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L55) ___ ### productTypeRepository\_ -• `Protected` `Readonly` **productTypeRepository\_**: typeof `ProductTypeRepository` +• `Protected` `Readonly` **productTypeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductType`\>) => `Promise`<[`ProductType`[], `number`]\> ; `upsertType`: (`type?`: `UpsertTypeInput`) => `Promise`<``null`` \| `ProductType`\> } #### Defined in -[packages/medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L61) +[medusa/src/services/product.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L54) ___ ### productVariantRepository\_ -• `Protected` `Readonly` **productVariantRepository\_**: typeof `ProductVariantRepository` +• `Protected` `Readonly` **productVariantRepository\_**: `Repository`<`ProductVariant`\> #### Defined in -[packages/medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L60) +[medusa/src/services/product.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L53) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L66) +[medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L59) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L67) +[medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L60) ___ @@ -198,13 +198,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -222,7 +222,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L72) +[medusa/src/services/product.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L65) ___ @@ -232,7 +232,25 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:71](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L71) +[medusa/src/services/product.ts:64](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L64) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -259,7 +277,7 @@ the result of the model update operation #### Defined in -[packages/medusa/src/services/product.ts:656](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L656) +[medusa/src/services/product.ts:637](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L637) ___ @@ -298,7 +316,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -322,7 +340,7 @@ the result of the count operation #### Defined in -[packages/medusa/src/services/product.ts:171](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L171) +[medusa/src/services/product.ts:158](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L158) ___ @@ -346,7 +364,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/product.ts:383](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L383) +[medusa/src/services/product.ts:365](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L365) ___ @@ -371,7 +389,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product.ts:622](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L622) +[medusa/src/services/product.ts:598](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L598) ___ @@ -396,7 +414,7 @@ the updated product #### Defined in -[packages/medusa/src/services/product.ts:821](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L821) +[medusa/src/services/product.ts:802](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L802) ___ @@ -418,7 +436,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:306](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L306) +[medusa/src/services/product.ts:290](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L290) ___ @@ -441,7 +459,7 @@ Check if the product is assigned to at least one of the provided sales channels. #### Defined in -[packages/medusa/src/services/product.ts:361](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L361) +[medusa/src/services/product.ts:343](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L343) ___ @@ -466,7 +484,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product.ts:117](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L117) +[medusa/src/services/product.ts:108](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L108) ___ @@ -494,7 +512,7 @@ an array containing the products as #### Defined in -[packages/medusa/src/services/product.ts:141](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L141) +[medusa/src/services/product.ts:132](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L132) ___ @@ -514,7 +532,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:346](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L346) +[medusa/src/services/product.ts:329](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L329) ___ @@ -528,39 +546,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:337](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L337) - -___ - -### prepareListQuery\_ - -▸ `Protected` **prepareListQuery_**(`selector`, `config`): `Object` - -Creates a query object to be used for list queries. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `selector` | `Selector`<`Product`\> \| `FilterableProductProps` | the selector to create the query from | -| `config` | `FindProductConfig` | the config to use for the query | - -#### Returns - -`Object` - -an object containing the query, relations and free-text - search param. - -| Name | Type | -| :------ | :------ | -| `q` | `string` | -| `query` | `FindWithoutRelationsOptions` | -| `relations` | keyof `Product`[] | - -#### Defined in - -[packages/medusa/src/services/product.ts:918](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L918) +[medusa/src/services/product.ts:321](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L321) ___ @@ -581,7 +567,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:699](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L699) +[medusa/src/services/product.ts:680](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L680) ___ @@ -607,7 +593,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:186](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L186) +[medusa/src/services/product.ts:174](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L174) ___ @@ -633,7 +619,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:230](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L230) +[medusa/src/services/product.ts:218](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L218) ___ @@ -659,13 +645,13 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:209](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L209) +[medusa/src/services/product.ts:197](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L197) ___ ### retrieveOptionByTitle -▸ **retrieveOptionByTitle**(`title`, `productId`): `Promise`<`undefined` \| `ProductOption`\> +▸ **retrieveOptionByTitle**(`title`, `productId`): `Promise`<``null`` \| `ProductOption`\> Retrieve product's option by title. @@ -678,13 +664,13 @@ Retrieve product's option by title. #### Returns -`Promise`<`undefined` \| `ProductOption`\> +`Promise`<``null`` \| `ProductOption`\> product option #### Defined in -[packages/medusa/src/services/product.ts:802](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L802) +[medusa/src/services/product.ts:783](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L783) ___ @@ -709,7 +695,7 @@ an array of variants #### Defined in -[packages/medusa/src/services/product.ts:288](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L288) +[medusa/src/services/product.ts:272](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L272) ___ @@ -735,7 +721,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:252](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L252) +[medusa/src/services/product.ts:240](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L240) ___ @@ -759,7 +745,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -786,7 +772,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product.ts:492](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L492) +[medusa/src/services/product.ts:470](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L470) ___ @@ -813,7 +799,7 @@ the updated product #### Defined in -[packages/medusa/src/services/product.ts:745](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L745) +[medusa/src/services/product.ts:726](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L726) ___ @@ -836,7 +822,7 @@ updated shipping options #### Defined in -[packages/medusa/src/services/product.ts:892](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product.ts#L892) +[medusa/src/services/product.ts:873](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product.ts#L873) ___ @@ -860,4 +846,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ProductTypeService.md b/docs/content/references/services/classes/ProductTypeService.md index cf1c8a6771..a8c670a9d5 100644 --- a/docs/content/references/services/classes/ProductTypeService.md +++ b/docs/content/references/services/classes/ProductTypeService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-type.ts:15](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L15) +[medusa/src/services/product-type.ts:12](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-type.ts#L12) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -74,13 +74,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -88,23 +88,41 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-type.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### typeRepository\_ -• `Protected` `Readonly` **typeRepository\_**: typeof `ProductTypeRepository` +• `Protected` `Readonly` **typeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductType`\>) => `Promise`<[`ProductType`[], `number`]\> ; `upsertType`: (`type?`: `UpsertTypeInput`) => `Promise`<``null`` \| `ProductType`\> } #### Defined in -[packages/medusa/src/services/product-type.ts:13](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L13) +[medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-type.ts#L10) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -143,7 +161,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -168,7 +186,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-type.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L55) +[medusa/src/services/product-type.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-type.ts#L52) ___ @@ -193,7 +211,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-type.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L72) +[medusa/src/services/product-type.ts:69](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-type.ts#L69) ___ @@ -219,7 +237,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product-type.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-type.ts#L30) +[medusa/src/services/product-type.ts:27](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-type.ts#L27) ___ @@ -243,7 +261,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -267,4 +285,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ProductVariantInventoryService.md b/docs/content/references/services/classes/ProductVariantInventoryService.md index 47df9b895c..3066c4ca2b 100644 --- a/docs/content/references/services/classes/ProductVariantInventoryService.md +++ b/docs/content/references/services/classes/ProductVariantInventoryService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L43) +[medusa/src/services/product-variant-inventory.ts:36](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L36) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +utils/dist/common/transaction-base-service.d.ts:5 ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +utils/dist/common/transaction-base-service.d.ts:4 ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +utils/dist/common/transaction-base-service.d.ts:6 ___ ### cacheService\_ -• `Protected` `Readonly` **cacheService\_**: [`CacheService`](CacheService.md) +• `Protected` `Readonly` **cacheService\_**: `ICacheService` #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L41) +[medusa/src/services/product-variant-inventory.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L34) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L40) +[medusa/src/services/product-variant-inventory.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L33) ___ @@ -94,13 +94,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:33](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L33) +utils/dist/common/transaction-base-service.d.ts:7 ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L38) +[medusa/src/services/product-variant-inventory.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L31) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L37) +[medusa/src/services/product-variant-inventory.ts:30](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L30) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:36](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L36) +[medusa/src/services/product-variant-inventory.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L29) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L39) +[medusa/src/services/product-variant-inventory.ts:32](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L32) ___ @@ -148,13 +148,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L34) +utils/dist/common/transaction-base-service.d.ts:8 + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:9 ## Methods @@ -178,7 +196,7 @@ Adjusts inventory of a variant on a location #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:573](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L573) +[medusa/src/services/product-variant-inventory.ts:598](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L598) ___ @@ -203,7 +221,7 @@ Adjusts the quantity of reservations for a line item by a given amount. #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:419](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L419) +[medusa/src/services/product-variant-inventory.ts:408](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L408) ___ @@ -242,7 +260,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +utils/dist/common/transaction-base-service.d.ts:24 ___ @@ -268,7 +286,7 @@ the variant inventory item #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:255](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L255) +[medusa/src/services/product-variant-inventory.ts:237](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L237) ___ @@ -295,7 +313,7 @@ boolean indicating if inventory is available #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L69) +[medusa/src/services/product-variant-inventory.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L60) ___ @@ -319,7 +337,7 @@ delete a reservation of variant quantity #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:538](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L538) +[medusa/src/services/product-variant-inventory.ts:566](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L566) ___ @@ -342,7 +360,35 @@ Remove a variant from an inventory item #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:317](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L317) +[medusa/src/services/product-variant-inventory.ts:299](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L299) + +___ + +### getVariantQuantityFromVariantInventoryItems + +▸ **getVariantQuantityFromVariantInventoryItems**(`variantInventoryItems`, `channelId`): `Promise`<`number`\> + +Get the quantity of a variant from a list of variantInventoryItems +The inventory quantity of the variant should be equal to the inventory +item with the smallest stock, adjusted for quantity required to fulfill +the given variant. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `variantInventoryItems` | `ProductVariantInventoryItem`[] | List of inventoryItems for a given variant, These must all be for the same variant | +| `channelId` | `string` | Sales channel id to fetch availability for | + +#### Returns + +`Promise`<`number`\> + +The available quantity of the variant from the inventoryItems + +#### Defined in + +[medusa/src/services/product-variant-inventory.ts:716](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L716) ___ @@ -366,13 +412,13 @@ list of inventory items #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:173](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L173) +[medusa/src/services/product-variant-inventory.ts:159](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L159) ___ ### listByVariant -▸ `Private` **listByVariant**(`variantId`): `Promise`<`ProductVariantInventoryItem`[]\> +▸ **listByVariant**(`variantId`): `Promise`<`ProductVariantInventoryItem`[]\> List inventory items for a specific variant @@ -390,7 +436,7 @@ variant inventory items for the variant id #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:192](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L192) +[medusa/src/services/product-variant-inventory.ts:176](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L176) ___ @@ -414,7 +460,7 @@ lidt of inventory items for the variant #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:233](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L233) +[medusa/src/services/product-variant-inventory.ts:215](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L215) ___ @@ -438,7 +484,7 @@ a list of product variants that are associated with the item id #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:215](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L215) +[medusa/src/services/product-variant-inventory.ts:197](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L197) ___ @@ -462,7 +508,7 @@ Reserves a quantity of a variant #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:349](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L349) +[medusa/src/services/product-variant-inventory.ts:329](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L329) ___ @@ -487,7 +533,7 @@ A promise that resolves with the product variant inventory item. #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:144](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L144) +[medusa/src/services/product-variant-inventory.ts:132](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L132) ___ @@ -500,7 +546,7 @@ ___ | Name | Type | | :------ | :------ | | `products` | (`Product` \| `PricedProduct`)[] | -| `salesChannelId` | `undefined` \| `string` | +| `salesChannelId` | `undefined` \| `string` \| `string`[] | #### Returns @@ -508,7 +554,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:665](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L665) +[medusa/src/services/product-variant-inventory.ts:686](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L686) ___ @@ -521,7 +567,7 @@ ___ | Name | Type | | :------ | :------ | | `variants` | `ProductVariant`[] \| `PricedVariant`[] | -| `salesChannelId` | `undefined` \| `string` | +| `salesChannelId` | `undefined` \| `string` \| `string`[] | #### Returns @@ -529,7 +575,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:617](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L617) +[medusa/src/services/product-variant-inventory.ts:639](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L639) ___ @@ -553,7 +599,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +utils/dist/common/transaction-base-service.d.ts:12 ___ @@ -578,7 +624,7 @@ nothing if successful, throws error if not #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:492](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant-inventory.ts#L492) +[medusa/src/services/product-variant-inventory.ts:509](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant-inventory.ts#L509) ___ @@ -602,4 +648,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +utils/dist/common/transaction-base-service.d.ts:11 diff --git a/docs/content/references/services/classes/ProductVariantService.md b/docs/content/references/services/classes/ProductVariantService.md index dbcb70e1b4..ace6b672f5 100644 --- a/docs/content/references/services/classes/ProductVariantService.md +++ b/docs/content/references/services/classes/ProductVariantService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-variant.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L72) +[medusa/src/services/product-variant.ts:75](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L75) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,17 +66,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cartRepository\_ -• `Protected` `Readonly` **cartRepository\_**: typeof `CartRepository` +• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> #### Defined in -[packages/medusa/src/services/product-variant.ts:70](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L70) +[medusa/src/services/product-variant.ts:73](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L73) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L64) +[medusa/src/services/product-variant.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L67) ___ @@ -94,23 +94,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-variant.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L59) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### moneyAmountRepository\_ -• `Protected` `Readonly` **moneyAmountRepository\_**: typeof `MoneyAmountRepository` +• `Protected` `Readonly` **moneyAmountRepository\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: (`priceListId`: `string`, `prices`: `PriceListPriceCreateInput`[], `overrideExisting`: `boolean`) => `Promise`<`MoneyAmount`[]\> ; `deletePriceListPrices`: (`priceListId`: `string`, `moneyAmountIds`: `string`[]) => `Promise`<`void`\> ; `deleteVariantPricesNotIn`: (`variantIdOrData`: `string` \| { `prices`: `ProductVariantPrice`[] ; `variantId`: `string` }[], `prices?`: `Price`[]) => `Promise`<`void`\> ; `findManyForVariantInPriceList`: (`variant_id`: `string`, `price_list_id`: `string`, `requiresPriceList`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantInRegion`: (`variant_id`: `string`, `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findVariantPricesNotIn`: (`variantId`: `string`, `prices`: `Price`[]) => `Promise`<`MoneyAmount`[]\> ; `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`MoneyAmount`\>[]) => `Promise`<`MoneyAmount`[]\> ; `updatePriceListPrices`: (`priceListId`: `string`, `updates`: `PriceListPriceUpdateInput`[]) => `Promise`<`MoneyAmount`[]\> ; `upsertVariantCurrencyPrice`: (`variantId`: `string`, `price`: `Price`) => `Promise`<`MoneyAmount`\> } #### Defined in -[packages/medusa/src/services/product-variant.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L67) +[medusa/src/services/product-variant.ts:70](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L70) ___ @@ -120,37 +120,37 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:66](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L66) +[medusa/src/services/product-variant.ts:69](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L69) ___ ### productOptionValueRepository\_ -• `Protected` `Readonly` **productOptionValueRepository\_**: typeof `ProductOptionValueRepository` +• `Protected` `Readonly` **productOptionValueRepository\_**: `Repository`<`ProductOptionValue`\> #### Defined in -[packages/medusa/src/services/product-variant.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L69) +[medusa/src/services/product-variant.ts:72](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L72) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: typeof `ProductRepository` +• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findAndCount`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<[`Product`[], `number`]\> ; `findOne`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>) => `Promise`<``null`` \| `Product`\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `prepareQueryBuilder_`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<`SelectQueryBuilder`<`Product`\>\> ; `upsertShippingProfile`: (`productIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`Product`[]\> } #### Defined in -[packages/medusa/src/services/product-variant.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L63) +[medusa/src/services/product-variant.ts:66](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L66) ___ ### productVariantRepository\_ -• `Protected` `Readonly` **productVariantRepository\_**: typeof `ProductVariantRepository` +• `Protected` `Readonly` **productVariantRepository\_**: `Repository`<`ProductVariant`\> #### Defined in -[packages/medusa/src/services/product-variant.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L62) +[medusa/src/services/product-variant.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L65) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L65) +[medusa/src/services/product-variant.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L68) ___ @@ -168,13 +168,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-variant.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L60) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -192,7 +192,25 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L53) +[medusa/src/services/product-variant.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L59) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -222,47 +240,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/product-variant.ts:823](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L823) - -___ - -### addOrUpdateCurrencyPrices - -▸ **addOrUpdateCurrencyPrices**(`data`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | { `price`: `WithRequiredProperty`<`ProductVariantPrice`, ``"currency_code"``\> ; `variantId`: `string` }[] | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[packages/medusa/src/services/product-variant.ts:613](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L613) - -___ - -### addOrUpdateRegionPrices - -▸ **addOrUpdateRegionPrices**(`data`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `UpdateVariantRegionPriceData`[] | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[packages/medusa/src/services/product-variant.ts:542](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L542) +[medusa/src/services/product-variant.ts:840](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L840) ___ @@ -301,7 +279,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -327,7 +305,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/product-variant.ts:167](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L167) +[medusa/src/services/product-variant.ts:168](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L168) ___ @@ -352,7 +330,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:976](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L976) +[medusa/src/services/product-variant.ts:1010](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L1010) ___ @@ -378,7 +356,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:850](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L850) +[medusa/src/services/product-variant.ts:867](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L867) ___ @@ -393,7 +371,7 @@ variants that match the query. | Name | Type | Description | | :------ | :------ | :------ | -| `variantRepo` | `ProductVariantRepository` | the variant repository | +| `variantRepo` | `Repository`<`ProductVariant`\> | the variant repository | | `query` | `FindWithRelationsOptions` | object that defines the scope for what should be returned | | `q?` | `string` | free text query | @@ -406,7 +384,7 @@ an array containing the products as the first element and the total #### Defined in -[packages/medusa/src/services/product-variant.ts:1078](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L1078) +[medusa/src/services/product-variant.ts:1073](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L1073) ___ @@ -433,7 +411,7 @@ the price specific to the region #### Defined in -[packages/medusa/src/services/product-variant.ts:697](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L697) +[medusa/src/services/product-variant.ts:714](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L714) ___ @@ -456,7 +434,7 @@ Check if the variant is assigned to at least one of the provided sales channels. #### Defined in -[packages/medusa/src/services/product-variant.ts:1016](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L1016) +[medusa/src/services/product-variant.ts:1048](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L1048) ___ @@ -479,7 +457,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-variant.ts:918](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L918) +[medusa/src/services/product-variant.ts:956](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L956) ___ @@ -502,39 +480,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-variant.ts:877](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L877) - -___ - -### prepareListQuery\_ - -▸ **prepareListQuery_**(`selector`, `config`): `Object` - -Creates a query object to be used for list queries. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `selector` | `FilterableProductVariantProps` | the selector to create the query from | -| `config` | `FindConfig`<`ProductVariant`\> | the config to use for the query | - -#### Returns - -`Object` - -an object containing the query, relations and free-text - search param. - -| Name | Type | -| :------ | :------ | -| `q?` | `string` | -| `query` | `FindWithRelationsOptions` | -| `relations` | `string`[] | - -#### Defined in - -[packages/medusa/src/services/product-variant.ts:1039](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L1039) +[medusa/src/services/product-variant.ts:895](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L895) ___ @@ -559,7 +505,7 @@ the product document. #### Defined in -[packages/medusa/src/services/product-variant.ts:103](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L103) +[medusa/src/services/product-variant.ts:104](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L104) ___ @@ -584,7 +530,7 @@ the product document. #### Defined in -[packages/medusa/src/services/product-variant.ts:131](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L131) +[medusa/src/services/product-variant.ts:132](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L132) ___ @@ -612,7 +558,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/product-variant.ts:764](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L764) +[medusa/src/services/product-variant.ts:781](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L781) ___ @@ -640,7 +586,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/product-variant.ts:727](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L727) +[medusa/src/services/product-variant.ts:744](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L744) ___ @@ -664,7 +610,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -688,7 +634,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product-variant.ts:264](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L264) +[medusa/src/services/product-variant.ts:269](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L269) ▸ **update**(`variantOrVariantId`, `update`): `Promise`<`ProductVariant`\> @@ -711,7 +657,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product-variant.ts:279](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L279) +[medusa/src/services/product-variant.ts:284](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L284) ▸ **update**(`variantOrVariantId`, `update`): `Promise`<`ProductVariant`\> @@ -728,7 +674,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product-variant.ts:284](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L284) +[medusa/src/services/product-variant.ts:289](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L289) ___ @@ -748,7 +694,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:340](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L340) +[medusa/src/services/product-variant.ts:343](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L343) ___ @@ -775,7 +721,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/product-variant.ts:785](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L785) +[medusa/src/services/product-variant.ts:802](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L802) ___ @@ -800,7 +746,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:440](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L440) +[medusa/src/services/product-variant.ts:441](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L441) ▸ **updateVariantPrices**(`variantId`, `prices`): `Promise`<`void`\> @@ -822,7 +768,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:449](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L449) +[medusa/src/services/product-variant.ts:450](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L450) ___ @@ -842,7 +788,47 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:469](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/product-variant.ts#L469) +[medusa/src/services/product-variant.ts:470](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L470) + +___ + +### upsertCurrencyPrices + +▸ **upsertCurrencyPrices**(`data`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | { `price`: `WithRequiredProperty`<`ProductVariantPrice`, ``"currency_code"``\> ; `variantId`: `string` }[] | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[medusa/src/services/product-variant.ts:622](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L622) + +___ + +### upsertRegionPrices + +▸ **upsertRegionPrices**(`data`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `UpdateVariantRegionPriceData`[] | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[medusa/src/services/product-variant.ts:543](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/product-variant.ts#L543) ___ @@ -866,4 +852,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/RegionService.md b/docs/content/references/services/classes/RegionService.md index 99b0b41d48..91d4ff6104 100644 --- a/docs/content/references/services/classes/RegionService.md +++ b/docs/content/references/services/classes/RegionService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/region.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L67) +[medusa/src/services/region.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L65) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,27 +68,27 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### countryRepository\_ -• `Protected` `Readonly` **countryRepository\_**: typeof `CountryRepository` +• `Protected` `Readonly` **countryRepository\_**: `Repository`<`Country`\> #### Defined in -[packages/medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L59) +[medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L57) ___ ### currencyRepository\_ -• `Protected` `Readonly` **currencyRepository\_**: typeof `CurrencyRepository` +• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> #### Defined in -[packages/medusa/src/services/region.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L60) +[medusa/src/services/region.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L58) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L54) +[medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L52) ___ @@ -108,17 +108,17 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L52) +[medusa/src/services/region.ts:50](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L50) ___ ### fulfillmentProviderRepository\_ -• `Protected` `Readonly` **fulfillmentProviderRepository\_**: typeof `FulfillmentProviderRepository` +• `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\> #### Defined in -[packages/medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L64) +[medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L62) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L57) +[medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L55) ___ @@ -136,23 +136,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/region.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentProviderRepository\_ -• `Protected` `Readonly` **paymentProviderRepository\_**: typeof `PaymentProviderRepository` +• `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\> #### Defined in -[packages/medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L62) +[medusa/src/services/region.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L60) ___ @@ -162,17 +162,17 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L56) +[medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L54) ___ ### regionRepository\_ -• `Protected` `Readonly` **regionRepository\_**: typeof `RegionRepository` +• `Protected` `Readonly` **regionRepository\_**: `Repository`<`Region`\> #### Defined in -[packages/medusa/src/services/region.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L58) +[medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L56) ___ @@ -182,17 +182,17 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L55) +[medusa/src/services/region.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L53) ___ ### taxProviderRepository\_ -• `Protected` `Readonly` **taxProviderRepository\_**: typeof `TaxProviderRepository` +• `Protected` `Readonly` **taxProviderRepository\_**: `Repository`<`TaxProvider`\> #### Defined in -[packages/medusa/src/services/region.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L65) +[medusa/src/services/region.ts:63](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L63) ___ @@ -200,13 +200,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L51) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -224,7 +224,25 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L44) +[medusa/src/services/region.ts:44](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L44) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -249,7 +267,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:580](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L580) +[medusa/src/services/region.ts:559](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L559) ___ @@ -275,7 +293,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:710](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L710) +[medusa/src/services/region.ts:687](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L687) ___ @@ -301,7 +319,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:659](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L659) +[medusa/src/services/region.ts:638](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L638) ___ @@ -340,7 +358,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -364,7 +382,7 @@ the newly created region #### Defined in -[packages/medusa/src/services/region.ts:117](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L117) +[medusa/src/services/region.ts:101](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L101) ___ @@ -388,7 +406,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/region.ts:549](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L549) +[medusa/src/services/region.ts:528](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L528) ___ @@ -413,7 +431,7 @@ result of the find operation #### Defined in -[packages/medusa/src/services/region.ts:529](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L529) +[medusa/src/services/region.ts:506](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L506) ___ @@ -438,7 +456,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:618](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L618) +[medusa/src/services/region.ts:597](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L597) ___ @@ -463,7 +481,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:798](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L798) +[medusa/src/services/region.ts:773](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L773) ___ @@ -488,7 +506,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:759](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L759) +[medusa/src/services/region.ts:734](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L734) ___ @@ -513,7 +531,7 @@ the region #### Defined in -[packages/medusa/src/services/region.ts:494](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L494) +[medusa/src/services/region.ts:471](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L471) ___ @@ -538,7 +556,7 @@ a Region with country code #### Defined in -[packages/medusa/src/services/region.ts:437](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L437) +[medusa/src/services/region.ts:417](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L417) ___ @@ -562,7 +580,7 @@ region with the matching name #### Defined in -[packages/medusa/src/services/region.ts:474](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L474) +[medusa/src/services/region.ts:451](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L451) ___ @@ -586,7 +604,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -611,7 +629,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/region.ts:190](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L190) +[medusa/src/services/region.ts:172](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L172) ___ @@ -637,7 +655,7 @@ the validated Country #### Defined in -[packages/medusa/src/services/region.ts:388](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L388) +[medusa/src/services/region.ts:368](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L368) ___ @@ -665,13 +683,13 @@ void #### Defined in -[packages/medusa/src/services/region.ts:363](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L363) +[medusa/src/services/region.ts:343](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L343) ___ ### validateFields -▸ `Protected` **validateFields**<`T`\>(`regionData`, `id?`): `Promise`<{ `automatic_taxes?`: `boolean` ; `countries?`: (`undefined` \| { id?: number \| undefined; iso\_2?: string \| undefined; iso\_3?: string \| undefined; num\_code?: number \| undefined; name?: string \| undefined; display\_name?: string \| undefined; region\_id?: string \| ... 1 more ... \| undefined; region?: { ...; } \| undefined; })[] ; `created_at?`: { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } ; `currency?`: { code?: string \| undefined; symbol?: string \| undefined; symbol\_native?: string \| undefined; name?: string \| undefined; includes\_tax?: boolean \| undefined; } ; `currency_code?`: `string` ; `deleted_at?`: ``null`` \| { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } ; `fulfillment_providers?`: (`undefined` \| { id?: string \| undefined; is\_installed?: boolean \| undefined; })[] ; `gift_cards_taxable?`: `boolean` ; `id?`: `string` ; `includes_tax?`: `boolean` ; `metadata?`: { [x: string]: unknown; } ; `name?`: `string` ; `payment_providers?`: (`undefined` \| { id?: string \| undefined; is\_installed?: boolean \| undefined; })[] ; `tax_code?`: `string` ; `tax_provider?`: { id?: string \| undefined; is\_installed?: boolean \| undefined; } ; `tax_provider_id?`: ``null`` \| `string` ; `tax_rate?`: `number` ; `tax_rates?`: ``null`` \| (`undefined` \| { rate?: number \| null \| undefined; code?: string \| null \| undefined; name?: string \| undefined; region\_id?: string \| undefined; region?: { name?: string \| undefined; currency\_code?: string \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 9 more ...; updated\_at?: { ...; } \| undefin...)[] ; `updated_at?`: { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } }\> +▸ `Protected` **validateFields**<`T`\>(`regionData`, `id?`): `Promise`<`DeepPartial`<`Region`\>\> Validates fields for creation and updates. If the region already exists the id can be passed to check that country updates are allowed. @@ -691,13 +709,13 @@ the id can be passed to check that country updates are allowed. #### Returns -`Promise`<{ `automatic_taxes?`: `boolean` ; `countries?`: (`undefined` \| { id?: number \| undefined; iso\_2?: string \| undefined; iso\_3?: string \| undefined; num\_code?: number \| undefined; name?: string \| undefined; display\_name?: string \| undefined; region\_id?: string \| ... 1 more ... \| undefined; region?: { ...; } \| undefined; })[] ; `created_at?`: { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } ; `currency?`: { code?: string \| undefined; symbol?: string \| undefined; symbol\_native?: string \| undefined; name?: string \| undefined; includes\_tax?: boolean \| undefined; } ; `currency_code?`: `string` ; `deleted_at?`: ``null`` \| { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } ; `fulfillment_providers?`: (`undefined` \| { id?: string \| undefined; is\_installed?: boolean \| undefined; })[] ; `gift_cards_taxable?`: `boolean` ; `id?`: `string` ; `includes_tax?`: `boolean` ; `metadata?`: { [x: string]: unknown; } ; `name?`: `string` ; `payment_providers?`: (`undefined` \| { id?: string \| undefined; is\_installed?: boolean \| undefined; })[] ; `tax_code?`: `string` ; `tax_provider?`: { id?: string \| undefined; is\_installed?: boolean \| undefined; } ; `tax_provider_id?`: ``null`` \| `string` ; `tax_rate?`: `number` ; `tax_rates?`: ``null`` \| (`undefined` \| { rate?: number \| null \| undefined; code?: string \| null \| undefined; name?: string \| undefined; region\_id?: string \| undefined; region?: { name?: string \| undefined; currency\_code?: string \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 9 more ...; updated\_at?: { ...; } \| undefin...)[] ; `updated_at?`: { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } }\> +`Promise`<`DeepPartial`<`Region`\>\> the validated region data #### Defined in -[packages/medusa/src/services/region.ts:261](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L261) +[medusa/src/services/region.ts:241](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L241) ___ @@ -725,7 +743,7 @@ void #### Defined in -[packages/medusa/src/services/region.ts:347](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/region.ts#L347) +[medusa/src/services/region.ts:327](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/region.ts#L327) ___ @@ -749,4 +767,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ReturnReasonService.md b/docs/content/references/services/classes/ReturnReasonService.md index 5f360831c2..099f863ce5 100644 --- a/docs/content/references/services/classes/ReturnReasonService.md +++ b/docs/content/references/services/classes/ReturnReasonService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/return-reason.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L21) +[medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L18) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -74,23 +74,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L18) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### retReasonRepo\_ -• `Protected` `Readonly` **retReasonRepo\_**: typeof `ReturnReasonRepository` +• `Protected` `Readonly` **retReasonRepo\_**: `Repository`<`ReturnReason`\> #### Defined in -[packages/medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L16) +[medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L16) ___ @@ -98,13 +98,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/return-reason.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L19) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -143,7 +161,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -163,7 +181,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L29) +[medusa/src/services/return-reason.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L25) ___ @@ -183,7 +201,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:117](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L117) +[medusa/src/services/return-reason.ts:113](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L113) ___ @@ -206,7 +224,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/return-reason.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L72) +[medusa/src/services/return-reason.ts:68](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L68) ___ @@ -231,7 +249,7 @@ the order document #### Defined in -[packages/medusa/src/services/return-reason.ts:91](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L91) +[medusa/src/services/return-reason.ts:87](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L87) ___ @@ -255,7 +273,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -276,7 +294,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return-reason.ts#L50) +[medusa/src/services/return-reason.ts:46](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return-reason.ts#L46) ___ @@ -300,4 +318,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ReturnService.md b/docs/content/references/services/classes/ReturnService.md index 873bb42314..e1db98ce1b 100644 --- a/docs/content/references/services/classes/ReturnService.md +++ b/docs/content/references/services/classes/ReturnService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/return.ts:67](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L67) +[medusa/src/services/return.ts:64](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L64) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L61) +[medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L58) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L58) +[medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L55) ___ @@ -94,13 +94,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/return.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L52) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L63) +[medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L60) ___ @@ -120,17 +120,17 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L65) +[medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L62) ___ ### returnItemRepository\_ -• `Protected` `Readonly` **returnItemRepository\_**: typeof `ReturnItemRepository` +• `Protected` `Readonly` **returnItemRepository\_**: `Repository`<`ReturnItem`\> #### Defined in -[packages/medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L57) +[medusa/src/services/return.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L54) ___ @@ -140,17 +140,17 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L62) +[medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L59) ___ ### returnRepository\_ -• `Protected` `Readonly` **returnRepository\_**: typeof `ReturnRepository` +• `Protected` `Readonly` **returnRepository\_**: `Repository`<`Return`\> #### Defined in -[packages/medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L56) +[medusa/src/services/return.ts:53](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L53) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L60) +[medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L57) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L59) +[medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L56) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L55) +[medusa/src/services/return.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L52) ___ @@ -188,13 +188,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/return.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L53) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -233,7 +251,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -257,7 +275,7 @@ the updated Return #### Defined in -[packages/medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L164) +[medusa/src/services/return.ts:161](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L161) ___ @@ -283,7 +301,7 @@ the created return #### Defined in -[packages/medusa/src/services/return.ts:349](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L349) +[medusa/src/services/return.ts:346](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L346) ___ @@ -303,7 +321,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:495](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L495) +[medusa/src/services/return.ts:490](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L490) ___ @@ -329,7 +347,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/return.ts:106](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L106) +[medusa/src/services/return.ts:101](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L101) ___ @@ -352,7 +370,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/return.ts:146](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L146) +[medusa/src/services/return.ts:141](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L141) ___ @@ -387,7 +405,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/return.ts:566](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L566) +[medusa/src/services/return.ts:561](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L561) ___ @@ -412,7 +430,7 @@ the return #### Defined in -[packages/medusa/src/services/return.ts:262](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L262) +[medusa/src/services/return.ts:259](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L259) ___ @@ -433,7 +451,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:290](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L290) +[medusa/src/services/return.ts:287](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L287) ___ @@ -457,7 +475,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -478,13 +496,13 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:315](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L315) +[medusa/src/services/return.ts:312](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L312) ___ ### validateReturnLineItem -▸ `Protected` **validateReturnLineItem**(`item?`, `quantity?`, `additional?`): `Object` +▸ `Protected` **validateReturnLineItem**(`item?`, `quantity?`, `additional?`): `DeepPartial`<`LineItem`\> Checks that a given quantity of a line item can be returned. Fails if the item is undefined or if the returnable quantity of the item is lower, than @@ -502,58 +520,14 @@ the quantity that is requested to be returned. #### Returns -`Object` +`DeepPartial`<`LineItem`\> a line item where the quantity is set to the requested return quantity. -| Name | Type | -| :------ | :------ | -| `adjustments?` | (`undefined` \| { id?: string \| undefined; item\_id?: string \| undefined; item?: { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; ... 37 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 38 more ...; updated\_at?: { ...; }...)[] | -| `allow_discounts?` | `boolean` | -| `cart?` | { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; billing\_address?: { customer\_id?: string \| null \| undefined; customer?: { ...; } \| ... 1 more ... \| undefined; ... 15 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 36 more ...; updated\_at?: ... | -| `cart_id?` | `string` | -| `claim_order?` | { payment\_status?: ClaimPaymentStatus \| undefined; fulfillment\_status?: ClaimFulfillmentStatus \| undefined; claim\_items?: ({ images?: ({ ...; } \| undefined)[] \| undefined; ... 14 more ...; updated\_at?: { ...; } \| undefined; } \| undefined)[] \| undefined; ... 17 more ...; id?: string \| undefined; } | -| `claim_order_id?` | `string` | -| `created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `description?` | ``null`` \| `string` | -| `discount_total?` | ``null`` \| `number` | -| `fulfilled_quantity?` | ``null`` \| `number` | -| `gift_card_total?` | ``null`` \| `number` | -| `has_shipping?` | ``null`` \| `boolean` | -| `id?` | `string` | -| `includes_tax?` | `boolean` | -| `is_giftcard?` | `boolean` | -| `is_return?` | `boolean` | -| `metadata?` | { [x: string]: unknown; } | -| `order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } | -| `order_edit?` | ``null`` \| { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; ... 50 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } | -| `order_edit_id?` | ``null`` \| `string` | -| `order_id?` | ``null`` \| `string` | -| `original_item_id?` | ``null`` \| `string` | -| `original_tax_total?` | ``null`` \| `number` | -| `original_total?` | ``null`` \| `number` | -| `quantity?` | `number` | -| `refundable?` | ``null`` \| `number` | -| `returned_quantity?` | ``null`` \| `number` | -| `shipped_quantity?` | ``null`` \| `number` | -| `should_merge?` | `boolean` | -| `subtotal?` | ``null`` \| `number` | -| `swap?` | { fulfillment\_status?: SwapFulfillmentStatus \| undefined; payment\_status?: SwapPaymentStatus \| undefined; order\_id?: string \| undefined; ... 20 more ...; updated\_at?: { ...; } \| undefined; } | -| `swap_id?` | `string` | -| `tax_lines?` | (`undefined` \| { item\_id?: string \| undefined; item?: { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; ... 37 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 38 more ...; updated\_at?: { ...; } \| undefined; } \| undefin...)[] | -| `tax_total?` | ``null`` \| `number` | -| `thumbnail?` | ``null`` \| `string` | -| `title?` | `string` | -| `total?` | ``null`` \| `number` | -| `unit_price?` | `number` | -| `updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `variant?` | { title?: string \| undefined; product\_id?: string \| undefined; product?: { title?: string \| undefined; subtitle?: string \| null \| undefined; description?: string \| null \| undefined; ... 30 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 23 more ...; updated\_at?: { ...; } \| undefined; } | -| `variant_id?` | ``null`` \| `string` | - #### Defined in -[packages/medusa/src/services/return.ts:220](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L220) +[medusa/src/services/return.ts:217](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L217) ___ @@ -581,7 +555,7 @@ when statuses are not sufficient for returns. #### Defined in -[packages/medusa/src/services/return.ts:190](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/return.ts#L190) +[medusa/src/services/return.ts:187](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/return.ts#L187) ___ @@ -605,4 +579,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/SalesChannelInventoryService.md b/docs/content/references/services/classes/SalesChannelInventoryService.md index 1bb93cec37..bfec681bfe 100644 --- a/docs/content/references/services/classes/SalesChannelInventoryService.md +++ b/docs/content/references/services/classes/SalesChannelInventoryService.md @@ -1,5 +1,11 @@ # Class: SalesChannelInventoryService +## Hierarchy + +- `TransactionBaseService` + + ↳ **`SalesChannelInventoryService`** + ## Constructors ### constructor @@ -12,19 +18,65 @@ | :------ | :------ | | `__namedParameters` | `InjectedDependencies` | +#### Overrides + +TransactionBaseService.constructor + #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:21](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-inventory.ts#L21) +[medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-inventory.ts#L18) ## Properties -### eventBusService\_ +### \_\_configModule\_\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) +• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + +#### Inherited from + +TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-inventory.ts#L18) +utils/dist/common/transaction-base-service.d.ts:5 + +___ + +### \_\_container\_\_ + +• `Protected` `Readonly` **\_\_container\_\_**: `any` + +#### Inherited from + +TransactionBaseService.\_\_container\_\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:4 + +___ + +### \_\_moduleDeclaration\_\_ + +• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + +#### Inherited from + +TransactionBaseService.\_\_moduleDeclaration\_\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:6 + +___ + +### eventBusService\_ + +• `Protected` `Readonly` **eventBusService\_**: `IEventBusService` + +#### Defined in + +[medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-inventory.ts#L15) ___ @@ -34,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-inventory.ts#L19) +[medusa/src/services/sales-channel-inventory.ts:16](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-inventory.ts#L16) ___ @@ -42,9 +94,13 @@ ___ • `Protected` **manager\_**: `EntityManager` +#### Inherited from + +TransactionBaseService.manager\_ + #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-inventory.ts#L15) +utils/dist/common/transaction-base-service.d.ts:7 ___ @@ -54,10 +110,81 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:17](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-inventory.ts#L17) +[medusa/src/services/sales-channel-inventory.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-inventory.ts#L14) + +___ + +### transactionManager\_ + +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + +#### Inherited from + +TransactionBaseService.transactionManager\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:8 + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:9 ## Methods +### atomicPhase\_ + +▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> + +Wraps some work within a transactional block. If the service already has +a transaction manager attached this will be reused, otherwise a new +transaction manager is created. + +#### Type parameters + +| Name | +| :------ | +| `TResult` | +| `TError` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | +| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | +| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | + +#### Returns + +`Promise`<`TResult`\> + +the result of the transactional work + +#### Inherited from + +TransactionBaseService.atomicPhase\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:24 + +___ + ### retrieveAvailableItemQuantity ▸ **retrieveAvailableItemQuantity**(`salesChannelId`, `inventoryItemId`): `Promise`<`number`\> @@ -79,4 +206,52 @@ available quantity of item across all sales channel locations #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-inventory.ts#L39) +[medusa/src/services/sales-channel-inventory.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-inventory.ts#L37) + +___ + +### shouldRetryTransaction\_ + +▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | + +#### Returns + +`boolean` + +#### Inherited from + +TransactionBaseService.shouldRetryTransaction\_ + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:12 + +___ + +### withTransaction + +▸ **withTransaction**(`transactionManager?`): [`SalesChannelInventoryService`](SalesChannelInventoryService.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `transactionManager?` | `EntityManager` | + +#### Returns + +[`SalesChannelInventoryService`](SalesChannelInventoryService.md) + +#### Inherited from + +TransactionBaseService.withTransaction + +#### Defined in + +utils/dist/common/transaction-base-service.d.ts:11 diff --git a/docs/content/references/services/classes/SalesChannelLocationService.md b/docs/content/references/services/classes/SalesChannelLocationService.md index 8babfe3352..106d5ce3af 100644 --- a/docs/content/references/services/classes/SalesChannelLocationService.md +++ b/docs/content/references/services/classes/SalesChannelLocationService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L26) +[medusa/src/services/sales-channel-location.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L25) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,17 +68,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ -### eventBusService +### eventBusService\_ -• `Protected` `Readonly` **eventBusService**: [`EventBusService`](EventBusService.md) +• `Protected` `Readonly` **eventBusService\_**: `IEventBusService` #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:23](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L23) +[medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L22) ___ @@ -86,13 +86,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L19) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -102,17 +102,17 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L22) +[medusa/src/services/sales-channel-location.ts:21](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L21) ___ -### stockLocationService +### stockLocationService\_ -• `Protected` `Readonly` **stockLocationService**: `IStockLocationService` +• `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService` #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L24) +[medusa/src/services/sales-channel-location.ts:23](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L23) ___ @@ -120,13 +120,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -151,7 +169,7 @@ A promise that resolves when the association has been created. #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:77](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L77) +[medusa/src/services/sales-channel-location.ts:73](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L73) ___ @@ -190,13 +208,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ -### listLocations +### listLocationIds -▸ **listLocations**(`salesChannelId`): `Promise`<`string`[]\> +▸ **listLocationIds**(`salesChannelId`): `Promise`<`string`[]\> Lists the stock locations associated with a sales channel. @@ -204,7 +222,7 @@ Lists the stock locations associated with a sales channel. | Name | Type | Description | | :------ | :------ | :------ | -| `salesChannelId` | `string` | The ID of the sales channel. | +| `salesChannelId` | `string` \| `string`[] | The ID of the sales channel. | #### Returns @@ -214,7 +232,31 @@ A promise that resolves with an array of location IDs. #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:104](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L104) +[medusa/src/services/sales-channel-location.ts:102](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L102) + +___ + +### listSalesChannelIds + +▸ **listSalesChannelIds**(`locationId`): `Promise`<`string`[]\> + +Lists the sales channels associated with a stock location. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `locationId` | `string` | + +#### Returns + +`Promise`<`string`[]\> + +A promise that resolves with an array of sales channel IDs. + +#### Defined in + +[medusa/src/services/sales-channel-location.ts:131](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L131) ___ @@ -239,7 +281,7 @@ A promise that resolves when the association has been removed. #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel-location.ts#L47) +[medusa/src/services/sales-channel-location.ts:44](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel-location.ts#L44) ___ @@ -263,7 +305,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -287,4 +329,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/SalesChannelService.md b/docs/content/references/services/classes/SalesChannelService.md index dfc1cab73b..779f159ee4 100644 --- a/docs/content/references/services/classes/SalesChannelService.md +++ b/docs/content/references/services/classes/SalesChannelService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/sales-channel.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L37) +[medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L34) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L34) +[medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L31) ___ @@ -84,23 +84,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L30) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### salesChannelRepository\_ -• `Protected` `Readonly` **salesChannelRepository\_**: typeof `SalesChannelRepository` +• `Protected` `Readonly` **salesChannelRepository\_**: `Repository`<`SalesChannel`\> & { `addProducts`: (`salesChannelId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `ExtendedFindConfig`<`SalesChannel`\>) => `Promise`<[`SalesChannel`[], `number`]\> ; `removeProducts`: (`salesChannelId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } #### Defined in -[packages/medusa/src/services/sales-channel.ts:33](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L33) +[medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L30) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:35](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L35) +[medusa/src/services/sales-channel.ts:32](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L32) ___ @@ -118,13 +118,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -142,7 +142,25 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L24) +[medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L24) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -167,7 +185,7 @@ the sales channel on which the products have been added #### Defined in -[packages/medusa/src/services/sales-channel.ts:344](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L344) +[medusa/src/services/sales-channel.ts:332](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L332) ___ @@ -206,7 +224,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -233,7 +251,7 @@ the created channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:180](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L180) +[medusa/src/services/sales-channel.ts:168](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L168) ___ @@ -251,7 +269,7 @@ the sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:270](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L270) +[medusa/src/services/sales-channel.ts:258](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L258) ___ @@ -275,21 +293,7 @@ To use this feature please enable the corresponding feature flag in your medusa #### Defined in -[packages/medusa/src/services/sales-channel.ts:231](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L231) - -___ - -### getManager - -▸ `Private` **getManager**(): `EntityManager` - -#### Returns - -`EntityManager` - -#### Defined in - -[packages/medusa/src/services/sales-channel.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L52) +[medusa/src/services/sales-channel.ts:219](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L219) ___ @@ -317,7 +321,7 @@ an array containing the sales channels as #### Defined in -[packages/medusa/src/services/sales-channel.ts:145](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L145) +[medusa/src/services/sales-channel.ts:134](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L134) ___ @@ -342,7 +346,7 @@ the sales channel on which the products have been removed #### Defined in -[packages/medusa/src/services/sales-channel.ts:323](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L323) +[medusa/src/services/sales-channel.ts:311](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L311) ___ @@ -367,7 +371,7 @@ a sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:103](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L103) +[medusa/src/services/sales-channel.ts:92](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L92) ___ @@ -392,7 +396,7 @@ a sales channel with matching name #### Defined in -[packages/medusa/src/services/sales-channel.ts:124](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L124) +[medusa/src/services/sales-channel.ts:113](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L113) ___ @@ -410,7 +414,7 @@ the sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:300](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L300) +[medusa/src/services/sales-channel.ts:288](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L288) ___ @@ -435,7 +439,7 @@ a single SC matching the query or throws #### Defined in -[packages/medusa/src/services/sales-channel.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L63) +[medusa/src/services/sales-channel.ts:54](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L54) ___ @@ -459,7 +463,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -480,7 +484,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:197](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/sales-channel.ts#L197) +[medusa/src/services/sales-channel.ts:185](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/sales-channel.ts#L185) ___ @@ -504,4 +508,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/SearchService.md b/docs/content/references/services/classes/SearchService.md index 33ba998b86..d456324032 100644 --- a/docs/content/references/services/classes/SearchService.md +++ b/docs/content/references/services/classes/SearchService.md @@ -25,52 +25,10 @@ AbstractSearchService.constructor #### Defined in -[packages/medusa/src/services/search.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L18) +[medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L16) ## Properties -### \_\_configModule\_\_ - -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> - -#### Inherited from - -AbstractSearchService.\_\_configModule\_\_ - -#### Defined in - -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) - -___ - -### \_\_container\_\_ - -• `Protected` `Readonly` **\_\_container\_\_**: `any` - -#### Inherited from - -AbstractSearchService.\_\_container\_\_ - -#### Defined in - -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) - -___ - -### \_\_moduleDeclaration\_\_ - -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> - -#### Inherited from - -AbstractSearchService.\_\_moduleDeclaration\_\_ - -#### Defined in - -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) - -___ - ### isDefault • **isDefault**: `boolean` = `true` @@ -81,7 +39,7 @@ AbstractSearchService.isDefault #### Defined in -[packages/medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L11) +[medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L11) ___ @@ -91,21 +49,7 @@ ___ #### Defined in -[packages/medusa/src/services/search.ts:15](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L15) - -___ - -### manager\_ - -• `Protected` **manager\_**: `EntityManager` - -#### Overrides - -AbstractSearchService.manager\_ - -#### Defined in - -[packages/medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L13) +[medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L13) ___ @@ -119,21 +63,7 @@ AbstractSearchService.options\_ #### Defined in -[packages/medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L16) - -___ - -### transactionManager\_ - -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` - -#### Overrides - -AbstractSearchService.transactionManager\_ - -#### Defined in - -[packages/medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L14) +[medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L14) ## Accessors @@ -151,7 +81,7 @@ AbstractSearchService.options #### Defined in -[packages/medusa/src/interfaces/search-service.ts:82](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/search-service.ts#L82) +utils/dist/search/abstract-service.d.ts:5 ## Methods @@ -177,46 +107,7 @@ AbstractSearchService.addDocuments #### Defined in -[packages/medusa/src/services/search.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L43) - -___ - -### atomicPhase\_ - -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> - -Wraps some work within a transactional block. If the service already has -a transaction manager attached this will be reused, otherwise a new -transaction manager is created. - -#### Type parameters - -| Name | -| :------ | -| `TResult` | -| `TError` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | -| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | -| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | - -#### Returns - -`Promise`<`TResult`\> - -the result of the transactional work - -#### Inherited from - -AbstractSearchService.atomicPhase\_ - -#### Defined in - -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/services/search.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L40) ___ @@ -241,7 +132,7 @@ AbstractSearchService.createIndex #### Defined in -[packages/medusa/src/services/search.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L31) +[medusa/src/services/search.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L28) ___ @@ -265,7 +156,7 @@ AbstractSearchService.deleteAllDocuments #### Defined in -[packages/medusa/src/services/search.ts:72](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L72) +[medusa/src/services/search.ts:69](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L69) ___ @@ -290,7 +181,7 @@ AbstractSearchService.deleteDocument #### Defined in -[packages/medusa/src/services/search.ts:63](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L63) +[medusa/src/services/search.ts:60](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L60) ___ @@ -314,7 +205,7 @@ AbstractSearchService.getIndex #### Defined in -[packages/medusa/src/services/search.ts:37](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L37) +[medusa/src/services/search.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L34) ___ @@ -340,7 +231,7 @@ AbstractSearchService.replaceDocuments #### Defined in -[packages/medusa/src/services/search.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L53) +[medusa/src/services/search.ts:50](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L50) ___ @@ -366,31 +257,7 @@ AbstractSearchService.search #### Defined in -[packages/medusa/src/services/search.ts:78](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L78) - -___ - -### shouldRetryTransaction\_ - -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | - -#### Returns - -`boolean` - -#### Inherited from - -AbstractSearchService.shouldRetryTransaction\_ - -#### Defined in - -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/services/search.ts:75](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L75) ___ @@ -415,28 +282,4 @@ AbstractSearchService.updateSettings #### Defined in -[packages/medusa/src/services/search.ts:89](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/search.ts#L89) - -___ - -### withTransaction - -▸ **withTransaction**(`transactionManager?`): [`SearchService`](SearchService.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `transactionManager?` | `EntityManager` | - -#### Returns - -[`SearchService`](SearchService.md) - -#### Inherited from - -AbstractSearchService.withTransaction - -#### Defined in - -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/services/search.ts:86](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/search.ts#L86) diff --git a/docs/content/references/services/classes/ShippingOptionService.md b/docs/content/references/services/classes/ShippingOptionService.md index d5851e16a0..92d978e976 100644 --- a/docs/content/references/services/classes/ShippingOptionService.md +++ b/docs/content/references/services/classes/ShippingOptionService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/shipping-option.ts:55](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L55) +[medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L52) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L50) +[medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L50) ___ @@ -86,33 +86,33 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L52) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### methodRepository\_ -• `Protected` `Readonly` **methodRepository\_**: typeof `ShippingMethodRepository` +• `Protected` `Readonly` **methodRepository\_**: `Repository`<`ShippingMethod`\> #### Defined in -[packages/medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L49) +[medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L49) ___ ### optionRepository\_ -• `Protected` `Readonly` **optionRepository\_**: typeof `ShippingOptionRepository` +• `Protected` `Readonly` **optionRepository\_**: `Repository`<`ShippingOption`\> & { `upsertShippingProfile`: (`shippingOptionIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`ShippingOption`[]\> } #### Defined in -[packages/medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L48) +[medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L48) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L44) +[medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L44) ___ @@ -132,17 +132,17 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L45) +[medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L45) ___ ### requirementRepository\_ -• `Protected` `Readonly` **requirementRepository\_**: typeof `ShippingOptionRequirementRepository` +• `Protected` `Readonly` **requirementRepository\_**: `Repository`<`ShippingOptionRequirement`\> #### Defined in -[packages/medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L47) +[medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L47) ___ @@ -150,13 +150,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/shipping-option.ts:53](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L53) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -182,7 +200,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-option.ts:713](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L713) +[medusa/src/services/shipping-option.ts:693](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L693) ___ @@ -221,7 +239,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -247,7 +265,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:451](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L451) +[medusa/src/services/shipping-option.ts:431](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L431) ___ @@ -273,7 +291,7 @@ the resulting shipping method. #### Defined in -[packages/medusa/src/services/shipping-option.ts:278](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L278) +[medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L258) ___ @@ -297,7 +315,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/shipping-option.ts:691](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L691) +[medusa/src/services/shipping-option.ts:671](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L671) ___ @@ -321,7 +339,7 @@ removed shipping methods #### Defined in -[packages/medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L258) +[medusa/src/services/shipping-option.ts:238](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L238) ___ @@ -339,7 +357,7 @@ price type "calculated". | :------ | :------ | :------ | | `option` | `ShippingOption` | the shipping option to retrieve the price for. | | `data` | `Record`<`string`, `unknown`\> | the shipping data to retrieve the price. | -| `cart` | `undefined` \| `Cart` \| `Order` | the context in which the price should be retrieved. | +| `cart` | `undefined` \| `Order` \| `Cart` | the context in which the price should be retrieved. | #### Returns @@ -349,7 +367,7 @@ the price of the shipping option. #### Defined in -[packages/medusa/src/services/shipping-option.ts:791](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L791) +[medusa/src/services/shipping-option.ts:771](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L771) ___ @@ -372,7 +390,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:148](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L148) +[medusa/src/services/shipping-option.ts:145](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L145) ___ @@ -395,7 +413,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:164](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L164) +[medusa/src/services/shipping-option.ts:160](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L160) ___ @@ -419,7 +437,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-option.ts:742](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L742) +[medusa/src/services/shipping-option.ts:722](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L722) ___ @@ -435,9 +453,7 @@ Throws in case of DB Error and if profile was not found. | Name | Type | Description | | :------ | :------ | :------ | | `optionId` | `any` | the id of the profile to get. | -| `options` | `Object` | the options to get a profile | -| `options.relations?` | `string`[] | - | -| `options.select?` | keyof `ShippingOption`[] | - | +| `options` | `FindConfig`<`ShippingOption`\> | the options to get a profile | #### Returns @@ -447,7 +463,7 @@ the profile document. #### Defined in -[packages/medusa/src/services/shipping-option.ts:182](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L182) +[medusa/src/services/shipping-option.ts:177](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L177) ___ @@ -471,7 +487,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -498,7 +514,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/shipping-option.ts:579](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L579) +[medusa/src/services/shipping-option.ts:559](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L559) ___ @@ -524,7 +540,7 @@ the resulting shipping method #### Defined in -[packages/medusa/src/services/shipping-option.ts:229](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L229) +[medusa/src/services/shipping-option.ts:211](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L211) ___ @@ -547,7 +563,7 @@ updated shipping options #### Defined in -[packages/medusa/src/services/shipping-option.ts:767](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L767) +[medusa/src/services/shipping-option.ts:747](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L747) ___ @@ -568,7 +584,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:408](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L408) +[medusa/src/services/shipping-option.ts:388](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L388) ___ @@ -595,7 +611,7 @@ the validated shipping option #### Defined in -[packages/medusa/src/services/shipping-option.ts:366](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L366) +[medusa/src/services/shipping-option.ts:346](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L346) ___ @@ -620,7 +636,7 @@ the validated price #### Defined in -[packages/medusa/src/services/shipping-option.ts:539](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L539) +[medusa/src/services/shipping-option.ts:519](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L519) ___ @@ -645,7 +661,7 @@ a validated shipping requirement #### Defined in -[packages/medusa/src/services/shipping-option.ts:82](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-option.ts#L82) +[medusa/src/services/shipping-option.ts:77](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-option.ts#L77) ___ @@ -669,4 +685,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/ShippingProfileService.md b/docs/content/references/services/classes/ShippingProfileService.md index debc542770..72ef91e25d 100644 --- a/docs/content/references/services/classes/ShippingProfileService.md +++ b/docs/content/references/services/classes/ShippingProfileService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/shipping-profile.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L48) +[medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L45) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L40) +[medusa/src/services/shipping-profile.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L40) ___ @@ -88,23 +88,23 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L45) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: typeof `ProductRepository` +• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findAndCount`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<[`Product`[], `number`]\> ; `findOne`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>) => `Promise`<``null`` \| `Product`\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `prepareQueryBuilder_`: (`options`: `ExtendedFindConfig`<`Product` & `ProductFilterOptions`\>, `q?`: `string`) => `Promise`<`SelectQueryBuilder`<`Product`\>\> ; `upsertShippingProfile`: (`productIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`Product`[]\> } #### Defined in -[packages/medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L43) +[medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L43) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L38) +[medusa/src/services/shipping-profile.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L38) ___ @@ -124,17 +124,17 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:39](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L39) +[medusa/src/services/shipping-profile.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L39) ___ ### shippingProfileRepository\_ -• `Protected` `Readonly` **shippingProfileRepository\_**: typeof `ShippingProfileRepository` +• `Protected` `Readonly` **shippingProfileRepository\_**: `Repository`<`ShippingProfile`\> #### Defined in -[packages/medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L42) +[medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L42) ___ @@ -142,13 +142,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L46) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -173,7 +191,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-profile.ts:356](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L356) +[medusa/src/services/shipping-profile.ts:355](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L355) ___ @@ -199,7 +217,7 @@ the result of the model update operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:386](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L386) +[medusa/src/services/shipping-profile.ts:385](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L385) ___ @@ -238,7 +256,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -262,7 +280,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:250](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L250) +[medusa/src/services/shipping-profile.ts:249](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L249) ___ @@ -280,7 +298,7 @@ the shipping profile #### Defined in -[packages/medusa/src/services/shipping-profile.ts:180](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L180) +[medusa/src/services/shipping-profile.ts:179](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L179) ___ @@ -299,7 +317,7 @@ the shipping profile #### Defined in -[packages/medusa/src/services/shipping-profile.ts:224](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L224) +[medusa/src/services/shipping-profile.ts:223](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L223) ___ @@ -323,7 +341,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:331](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L331) +[medusa/src/services/shipping-profile.ts:330](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L330) ___ @@ -348,7 +366,7 @@ a list of the available shipping options #### Defined in -[packages/medusa/src/services/shipping-profile.ts:416](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L416) +[medusa/src/services/shipping-profile.ts:415](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L415) ___ @@ -369,7 +387,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:83](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L83) +[medusa/src/services/shipping-profile.ts:82](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L82) ___ @@ -393,7 +411,7 @@ a list of product ids #### Defined in -[packages/medusa/src/services/shipping-profile.ts:482](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L482) +[medusa/src/services/shipping-profile.ts:481](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L481) ___ @@ -416,7 +434,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:71](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L71) +[medusa/src/services/shipping-profile.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L67) ___ @@ -442,39 +460,39 @@ the profile document. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:135](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L135) +[medusa/src/services/shipping-profile.ts:134](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L134) ___ ### retrieveDefault -▸ **retrieveDefault**(): `Promise`<`undefined` \| `ShippingProfile`\> +▸ **retrieveDefault**(): `Promise`<``null`` \| `ShippingProfile`\> #### Returns -`Promise`<`undefined` \| `ShippingProfile`\> +`Promise`<``null`` \| `ShippingProfile`\> #### Defined in -[packages/medusa/src/services/shipping-profile.ts:164](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L164) +[medusa/src/services/shipping-profile.ts:163](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L163) ___ ### retrieveGiftCardDefault -▸ **retrieveGiftCardDefault**(): `Promise`<`undefined` \| `ShippingProfile`\> +▸ **retrieveGiftCardDefault**(): `Promise`<``null`` \| `ShippingProfile`\> Retrieves the default gift card profile #### Returns -`Promise`<`undefined` \| `ShippingProfile`\> +`Promise`<``null`` \| `ShippingProfile`\> the shipping profile for gift cards #### Defined in -[packages/medusa/src/services/shipping-profile.ts:207](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L207) +[medusa/src/services/shipping-profile.ts:206](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L206) ___ @@ -498,7 +516,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -525,7 +543,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:285](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/shipping-profile.ts#L285) +[medusa/src/services/shipping-profile.ts:284](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/shipping-profile.ts#L284) ___ @@ -549,4 +567,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/StagedJobService.md b/docs/content/references/services/classes/StagedJobService.md new file mode 100644 index 0000000000..5824bd989e --- /dev/null +++ b/docs/content/references/services/classes/StagedJobService.md @@ -0,0 +1,274 @@ +# Class: StagedJobService + +Provides layer to manipulate users. + +## Hierarchy + +- `TransactionBaseService` + + ↳ **`StagedJobService`** + +## Constructors + +### constructor + +• **new StagedJobService**(`__namedParameters`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `StagedJobServiceProps` | + +#### Overrides + +TransactionBaseService.constructor + +#### Defined in + +[medusa/src/services/staged-job.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/staged-job.ts#L22) + +## Properties + +### \_\_configModule\_\_ + +• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + +#### Inherited from + +TransactionBaseService.\_\_configModule\_\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) + +___ + +### \_\_container\_\_ + +• `Protected` `Readonly` **\_\_container\_\_**: `any` + +#### Inherited from + +TransactionBaseService.\_\_container\_\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) + +___ + +### \_\_moduleDeclaration\_\_ + +• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + +#### Inherited from + +TransactionBaseService.\_\_moduleDeclaration\_\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) + +___ + +### manager\_ + +• `Protected` **manager\_**: `EntityManager` + +#### Inherited from + +TransactionBaseService.manager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) + +___ + +### stagedJobRepository\_ + +• `Protected` **stagedJobRepository\_**: `Repository`<`StagedJob`\> & { `insertBulk`: (`jobToCreates`: `_QueryDeepPartialEntity`<`StagedJob`\>[]) => `Promise`<`StagedJob`[]\> } + +#### Defined in + +[medusa/src/services/staged-job.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/staged-job.ts#L20) + +___ + +### transactionManager\_ + +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + +#### Inherited from + +TransactionBaseService.transactionManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) + +## Methods + +### atomicPhase\_ + +▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> + +Wraps some work within a transactional block. If the service already has +a transaction manager attached this will be reused, otherwise a new +transaction manager is created. + +#### Type parameters + +| Name | +| :------ | +| `TResult` | +| `TError` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | +| `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | +| `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | + +#### Returns + +`Promise`<`TResult`\> + +the result of the transactional work + +#### Inherited from + +TransactionBaseService.atomicPhase\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) + +___ + +### create + +▸ **create**(`data`): `Promise`<`StagedJob`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `EmitData`<`unknown`\> \| `EmitData`<`unknown`\>[] | + +#### Returns + +`Promise`<`StagedJob`[]\> + +#### Defined in + +[medusa/src/services/staged-job.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/staged-job.ts#L45) + +___ + +### delete + +▸ **delete**(`stagedJobIds`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stagedJobIds` | `string` \| `string`[] | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[medusa/src/services/staged-job.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/staged-job.ts#L37) + +___ + +### list + +▸ **list**(`config`): `Promise`<`StagedJob`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `config` | `FindConfig`<`StagedJob`\> | + +#### Returns + +`Promise`<`StagedJob`[]\> + +#### Defined in + +[medusa/src/services/staged-job.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/staged-job.ts#L29) + +___ + +### shouldRetryTransaction\_ + +▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | + +#### Returns + +`boolean` + +#### Inherited from + +TransactionBaseService.shouldRetryTransaction\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) + +___ + +### withTransaction + +▸ **withTransaction**(`transactionManager?`): [`StagedJobService`](StagedJobService.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `transactionManager?` | `EntityManager` | + +#### Returns + +[`StagedJobService`](StagedJobService.md) + +#### Inherited from + +TransactionBaseService.withTransaction + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/StoreService.md b/docs/content/references/services/classes/StoreService.md index 11cce1367b..6eae7ade9f 100644 --- a/docs/content/references/services/classes/StoreService.md +++ b/docs/content/references/services/classes/StoreService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/store.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L31) +[medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L28) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,17 +68,17 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### currencyRepository\_ -• `Protected` `Readonly` **currencyRepository\_**: typeof `CurrencyRepository` +• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> #### Defined in -[packages/medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L28) +[medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L25) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L29) +[medusa/src/services/store.ts:26](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L26) ___ @@ -96,37 +96,55 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L24) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### storeRepository\_ -• `Protected` `Readonly` **storeRepository\_**: typeof `StoreRepository` +• `Protected` `Readonly` **storeRepository\_**: `Repository`<`Store`\> #### Defined in -[packages/medusa/src/services/store.ts:27](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L27) +[medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L24) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L25) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -150,7 +168,7 @@ result after update #### Defined in -[packages/medusa/src/services/store.ts:204](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L204) +[medusa/src/services/store.ts:208](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L208) ___ @@ -189,7 +207,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -207,7 +225,7 @@ The store. #### Defined in -[packages/medusa/src/services/store.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L49) +[medusa/src/services/store.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L45) ___ @@ -227,7 +245,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:98](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L98) +[medusa/src/services/store.ts:100](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L100) ___ @@ -251,7 +269,7 @@ result after update #### Defined in -[packages/medusa/src/services/store.ts:248](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L248) +[medusa/src/services/store.ts:252](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L252) ___ @@ -275,7 +293,7 @@ the store #### Defined in -[packages/medusa/src/services/store.ts:85](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L85) +[medusa/src/services/store.ts:83](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L83) ___ @@ -299,7 +317,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -323,7 +341,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/store.ts:114](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/store.ts#L114) +[medusa/src/services/store.ts:116](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/store.ts#L116) ___ @@ -347,4 +365,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/StrategyResolverService.md b/docs/content/references/services/classes/StrategyResolverService.md index a67ec40dac..4f065d80d6 100644 --- a/docs/content/references/services/classes/StrategyResolverService.md +++ b/docs/content/references/services/classes/StrategyResolverService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/strategy-resolver.ts#L14) +[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/strategy-resolver.ts#L11) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/strategy-resolver.ts#L14) +[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/strategy-resolver.ts#L11) ___ @@ -84,13 +84,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/strategy-resolver.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -98,13 +98,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:12](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/strategy-resolver.ts#L12) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -143,7 +161,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -163,7 +181,7 @@ ___ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:19](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/strategy-resolver.ts#L19) +[medusa/src/services/strategy-resolver.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/strategy-resolver.ts#L15) ___ @@ -187,7 +205,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -211,4 +229,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/SwapService.md b/docs/content/references/services/classes/SwapService.md index a1dcd398ae..967947c745 100644 --- a/docs/content/references/services/classes/SwapService.md +++ b/docs/content/references/services/classes/SwapService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/swap.ts:96](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L96) +[medusa/src/services/swap.ts:92](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L92) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L82) +[medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L78) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:92](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L92) +[medusa/src/services/swap.ts:88](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L88) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L83) +[medusa/src/services/swap.ts:79](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L79) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:88](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L88) +[medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L84) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L91) +[medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L87) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L87) +[medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L83) ___ @@ -136,13 +136,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/swap.ts:77](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L77) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L84) +[medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L80) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:90](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L90) +[medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L86) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:94](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L94) +[medusa/src/services/swap.ts:90](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L90) ___ @@ -182,7 +182,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L85) +[medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L81) ___ @@ -192,17 +192,17 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L89) +[medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L85) ___ ### swapRepository\_ -• `Protected` `Readonly` **swapRepository\_**: typeof `SwapRepository` +• `Protected` `Readonly` **swapRepository\_**: `Repository`<`Swap`\> #### Defined in -[packages/medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L80) +[medusa/src/services/swap.ts:76](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L76) ___ @@ -212,7 +212,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L86) +[medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L82) ___ @@ -220,13 +220,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L78) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -250,7 +250,25 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L65) +[medusa/src/services/swap.ts:64](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L64) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -270,7 +288,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:1226](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L1226) +[medusa/src/services/swap.ts:1219](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L1219) ___ @@ -309,7 +327,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -335,7 +353,7 @@ the canceled swap. #### Defined in -[packages/medusa/src/services/swap.ts:842](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L842) +[medusa/src/services/swap.ts:837](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L837) ___ @@ -359,7 +377,7 @@ updated swap #### Defined in -[packages/medusa/src/services/swap.ts:1043](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L1043) +[medusa/src/services/swap.ts:1038](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L1038) ___ @@ -383,6 +401,7 @@ and an optional return shipping method. | `custom` | `Object` | contains relevant custom information. This object may include no_notification which will disable sending notification when creating swap. If set, it overrules the attribute inherited from the order | | `custom.allow_backorder?` | `boolean` | - | | `custom.idempotency_key?` | `string` | - | +| `custom.location_id?` | `string` | - | | `custom.no_notification?` | `boolean` | - | #### Returns @@ -393,7 +412,7 @@ the newly created swap #### Defined in -[packages/medusa/src/services/swap.ts:317](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L317) +[medusa/src/services/swap.ts:302](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L302) ___ @@ -421,7 +440,7 @@ the swap with its cart_id prop set to the id of the new cart. #### Defined in -[packages/medusa/src/services/swap.ts:571](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L571) +[medusa/src/services/swap.ts:558](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L558) ___ @@ -447,7 +466,7 @@ the updated swap with new status and fulfillments. #### Defined in -[packages/medusa/src/services/swap.ts:904](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L904) +[medusa/src/services/swap.ts:899](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L899) ___ @@ -474,7 +493,7 @@ the updated swap with new fulfillments and status. #### Defined in -[packages/medusa/src/services/swap.ts:1074](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L1074) +[medusa/src/services/swap.ts:1069](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L1069) ___ @@ -499,7 +518,7 @@ resolves to the updated result. #### Defined in -[packages/medusa/src/services/swap.ts:1152](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L1152) +[medusa/src/services/swap.ts:1147](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L1147) ___ @@ -524,7 +543,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/swap.ts:287](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L287) +[medusa/src/services/swap.ts:274](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L274) ___ @@ -548,7 +567,7 @@ processed swap #### Defined in -[packages/medusa/src/services/swap.ts:415](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L415) +[medusa/src/services/swap.ts:402](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L402) ___ @@ -572,7 +591,7 @@ swap related to the cart #### Defined in -[packages/medusa/src/services/swap.ts:709](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L709) +[medusa/src/services/swap.ts:704](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L704) ___ @@ -597,7 +616,7 @@ the resulting order #### Defined in -[packages/medusa/src/services/swap.ts:1192](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L1192) +[medusa/src/services/swap.ts:1185](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L1185) ___ @@ -622,7 +641,7 @@ the swap #### Defined in -[packages/medusa/src/services/swap.ts:211](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L211) +[medusa/src/services/swap.ts:204](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L204) ___ @@ -647,7 +666,7 @@ the swap #### Defined in -[packages/medusa/src/services/swap.ts:260](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L260) +[medusa/src/services/swap.ts:247](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L247) ___ @@ -671,7 +690,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -695,7 +714,7 @@ transformed find swap config #### Defined in -[packages/medusa/src/services/swap.ts:138](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L138) +[medusa/src/services/swap.ts:131](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L131) ___ @@ -720,7 +739,7 @@ updated swap record #### Defined in -[packages/medusa/src/services/swap.ts:538](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/swap.ts#L538) +[medusa/src/services/swap.ts:525](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/swap.ts#L525) ___ @@ -744,4 +763,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/SystemPaymentProviderService.md b/docs/content/references/services/classes/SystemPaymentProviderService.md index deaaa0fbed..9f51ad56bc 100644 --- a/docs/content/references/services/classes/SystemPaymentProviderService.md +++ b/docs/content/references/services/classes/SystemPaymentProviderService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L10) +[medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L6) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -74,13 +74,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:5](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -88,13 +88,13 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ @@ -104,7 +104,25 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:8](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L8) +[medusa/src/services/system-payment-provider.ts:4](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L4) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -143,7 +161,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -163,7 +181,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L26) +[medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L22) ___ @@ -183,7 +201,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L50) +[medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L46) ___ @@ -203,7 +221,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L42) +[medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L38) ___ @@ -223,7 +241,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L14) +[medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L10) ___ @@ -243,7 +261,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L38) +[medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L34) ___ @@ -263,7 +281,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L22) +[medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L18) ___ @@ -283,7 +301,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L18) +[medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L14) ___ @@ -303,7 +321,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L46) +[medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L42) ___ @@ -327,7 +345,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -347,7 +365,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L34) +[medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L30) ___ @@ -367,7 +385,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/system-payment-provider.ts#L30) +[medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/system-payment-provider.ts#L26) ___ @@ -391,4 +409,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/TaxProviderService.md b/docs/content/references/services/classes/TaxProviderService.md index f7a9f2a72a..d0273adb12 100644 --- a/docs/content/references/services/classes/TaxProviderService.md +++ b/docs/content/references/services/classes/TaxProviderService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/tax-provider.ts:51](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L51) +[medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L45) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L44) +[medusa/src/services/tax-provider.ts:38](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L38) ___ @@ -88,17 +88,17 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L43) +[medusa/src/services/tax-provider.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L37) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) +• `Protected` `Readonly` **eventBus\_**: `IEventBusService` #### Defined in -[packages/medusa/src/services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L49) +[medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L43) ___ @@ -106,43 +106,43 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L40) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### smTaxLineRepo\_ -• `Protected` `Readonly` **smTaxLineRepo\_**: typeof `ShippingMethodTaxLineRepository` +• `Protected` `Readonly` **smTaxLineRepo\_**: `Repository`<`ShippingMethodTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `ShippingMethodTaxLine`[]) => `Promise`<`ShippingMethodTaxLine`[]\> } #### Defined in -[packages/medusa/src/services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L47) +[medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L41) ___ ### taxLineRepo\_ -• `Protected` `Readonly` **taxLineRepo\_**: typeof `LineItemTaxLineRepository` +• `Protected` `Readonly` **taxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `LineItemTaxLine`[]) => `Promise`<`LineItemTaxLine`[]\> } #### Defined in -[packages/medusa/src/services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L46) +[medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L40) ___ ### taxProviderRepo\_ -• `Protected` `Readonly` **taxProviderRepo\_**: typeof `TaxProviderRepository` +• `Protected` `Readonly` **taxProviderRepo\_**: `Repository`<`TaxProvider`\> #### Defined in -[packages/medusa/src/services/tax-provider.ts:48](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L48) +[medusa/src/services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L42) ___ @@ -152,21 +152,39 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L45) +[medusa/src/services/tax-provider.ts:39](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L39) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L41) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -205,7 +223,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -225,7 +243,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L97) +[medusa/src/services/tax-provider.ts:89](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L89) ___ @@ -245,7 +263,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:107](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L107) +[medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L97) ___ @@ -271,7 +289,7 @@ the newly created tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:183](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L183) +[medusa/src/services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L171) ___ @@ -296,7 +314,7 @@ the newly created tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:129](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L129) +[medusa/src/services/tax-provider.ts:117](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L117) ___ @@ -321,7 +339,7 @@ the cache key to use for the id set #### Defined in -[packages/medusa/src/services/tax-provider.ts:484](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L484) +[medusa/src/services/tax-provider.ts:476](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L476) ___ @@ -347,7 +365,7 @@ the tax rates configured for the shipping option. #### Defined in -[packages/medusa/src/services/tax-provider.ts:436](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L436) +[medusa/src/services/tax-provider.ts:428](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L428) ___ @@ -373,7 +391,7 @@ the tax rates configured for the shipping option. #### Defined in -[packages/medusa/src/services/tax-provider.ts:389](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L389) +[medusa/src/services/tax-provider.ts:381](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L381) ___ @@ -400,7 +418,7 @@ the computed tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:204](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L204) +[medusa/src/services/tax-provider.ts:192](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L192) ___ @@ -429,7 +447,7 @@ the computed tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:256](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L256) +[medusa/src/services/tax-provider.ts:246](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L246) ___ @@ -452,7 +470,7 @@ Return a map of tax lines for line items and shipping methods #### Defined in -[packages/medusa/src/services/tax-provider.ts:352](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L352) +[medusa/src/services/tax-provider.ts:344](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L344) ___ @@ -466,7 +484,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:65](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L65) +[medusa/src/services/tax-provider.ts:57](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L57) ___ @@ -486,7 +504,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:488](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L488) +[medusa/src/services/tax-provider.ts:480](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L480) ___ @@ -510,7 +528,7 @@ the region specific tax provider #### Defined in -[packages/medusa/src/services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-provider.ts#L75) +[medusa/src/services/tax-provider.ts:67](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-provider.ts#L67) ___ @@ -534,7 +552,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -558,4 +576,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/TaxRateService.md b/docs/content/references/services/classes/TaxRateService.md index 97b7c14786..695b94a379 100644 --- a/docs/content/references/services/classes/TaxRateService.md +++ b/docs/content/references/services/classes/TaxRateService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/tax-rate.ts:33](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L33) +[medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L29) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -74,13 +74,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L25) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:28](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L28) +[medusa/src/services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L24) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L29) +[medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L25) ___ @@ -110,17 +110,17 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:30](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L30) +[medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L26) ___ ### taxRateRepository\_ -• `Protected` `Readonly` **taxRateRepository\_**: typeof `TaxRateRepository` +• `Protected` `Readonly` **taxRateRepository\_**: `Repository`<`TaxRate`\> & { `addToProduct`: (`id`: `string`, `productIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ProductTaxRate`[]\> ; `addToProductType`: (`id`: `string`, `productTypeIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ProductTypeTaxRate`[]\> ; `addToShippingOption`: (`id`: `string`, `optionIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ShippingTaxRate`[]\> ; `applyResolutionsToQueryBuilder`: (`qb`: `SelectQueryBuilder`<`TaxRate`\>, `resolverFields`: `string`[]) => `SelectQueryBuilder`<`TaxRate`\> ; `findAndCountWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<[`TaxRate`[], `number`]\> ; `findOneWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<``null`` \| `TaxRate`\> ; `findWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<`TaxRate`[]\> ; `getFindQueryBuilder`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `SelectQueryBuilder`<`TaxRate`\> ; `listByProduct`: (`productId`: `string`, `config`: `TaxRateListByConfig`) => `Promise`<`TaxRate`[]\> ; `listByShippingOption`: (`optionId`: `string`) => `Promise`<`TaxRate`[]\> ; `removeFromProduct`: (`id`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> ; `removeFromProductType`: (`id`: `string`, `productTypeIds`: `string`[]) => `Promise`<`DeleteResult`\> ; `removeFromShippingOption`: (`id`: `string`, `optionIds`: `string`[]) => `Promise`<`DeleteResult`\> } #### Defined in -[packages/medusa/src/services/tax-rate.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L31) +[medusa/src/services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L27) ___ @@ -128,13 +128,31 @@ ___ • `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L26) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -156,7 +174,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L190) +[medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L190) ___ @@ -178,7 +196,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L226) +[medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L226) ___ @@ -200,7 +218,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L266) +[medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L266) ___ @@ -239,7 +257,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -259,7 +277,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:97](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L97) +[medusa/src/services/tax-rate.ts:93](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L93) ___ @@ -279,7 +297,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:128](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L128) +[medusa/src/services/tax-rate.ts:124](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L124) ___ @@ -300,7 +318,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:49](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L49) +[medusa/src/services/tax-rate.ts:44](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L44) ___ @@ -321,7 +339,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:60](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L60) +[medusa/src/services/tax-rate.ts:55](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L55) ___ @@ -342,7 +360,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L314) +[medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L314) ___ @@ -362,7 +380,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:324](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L324) +[medusa/src/services/tax-rate.ts:325](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L325) ___ @@ -383,7 +401,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L136) +[medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L136) ___ @@ -404,7 +422,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L154) +[medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L154) ___ @@ -425,7 +443,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L172) +[medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L172) ___ @@ -446,7 +464,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:71](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L71) +[medusa/src/services/tax-rate.ts:66](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L66) ___ @@ -470,7 +488,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -491,7 +509,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:113](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/tax-rate.ts#L113) +[medusa/src/services/tax-rate.ts:109](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/tax-rate.ts#L109) ___ @@ -515,4 +533,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/TokenService.md b/docs/content/references/services/classes/TokenService.md index 631bc7fa3c..af46f86003 100644 --- a/docs/content/references/services/classes/TokenService.md +++ b/docs/content/references/services/classes/TokenService.md @@ -14,7 +14,7 @@ #### Defined in -[packages/medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/token.ts#L16) +[medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/token.ts#L16) ## Properties @@ -24,7 +24,7 @@ #### Defined in -[packages/medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/token.ts#L14) +[medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/token.ts#L14) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[packages/medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/token.ts#L12) +[medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/token.ts#L12) ## Methods @@ -55,7 +55,7 @@ ___ #### Defined in -[packages/medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/token.ts#L34) +[medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/token.ts#L34) ___ @@ -76,4 +76,4 @@ ___ #### Defined in -[packages/medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/token.ts#L20) +[medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/token.ts#L20) diff --git a/docs/content/references/services/classes/TotalsService.md b/docs/content/references/services/classes/TotalsService.md index 4d338b0ed3..b39d50ef71 100644 --- a/docs/content/references/services/classes/TotalsService.md +++ b/docs/content/references/services/classes/TotalsService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/totals.ts:113](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L113) +[medusa/src/services/totals.ts:112](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L112) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:111](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L111) +[medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L110) ___ @@ -88,13 +88,13 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/totals.ts:105](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L105) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L109) +[medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L108) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L110) +[medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L109) ___ @@ -124,21 +124,39 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L108) +[medusa/src/services/totals.ts:107](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L107) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/totals.ts:106](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L106) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -177,7 +195,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -205,7 +223,7 @@ triples of lineitem, variant and applied discount #### Defined in -[packages/medusa/src/services/totals.ts:629](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L629) +[medusa/src/services/totals.ts:626](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L626) ___ @@ -224,7 +242,7 @@ alongside the variant on which the discount was applied. | Name | Type | Description | | :------ | :------ | :------ | | `discount` | `Discount` | the discount to which we do the calculation | -| `cart` | `Cart` \| `Order` | the cart to calculate discounts for | +| `cart` | `Order` \| `Cart` | the cart to calculate discounts for | #### Returns @@ -234,7 +252,7 @@ array of triples of lineitem, variant and applied discount #### Defined in -[packages/medusa/src/services/totals.ts:671](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L671) +[medusa/src/services/totals.ts:668](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L668) ___ @@ -265,7 +283,7 @@ the allocation map for the line items in the cart or order. #### Defined in -[packages/medusa/src/services/totals.ts:438](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L438) +[medusa/src/services/totals.ts:435](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L435) ___ @@ -290,7 +308,7 @@ the tax calculation context #### Defined in -[packages/medusa/src/services/totals.ts:1025](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L1025) +[medusa/src/services/totals.ts:1027](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L1027) ___ @@ -305,7 +323,7 @@ discount types. If discounts aren't present or invalid returns 0. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to calculate discounts for | +| `cartOrOrder` | `Order` \| `Cart` | the cart or order to calculate discounts for | #### Returns @@ -315,7 +333,7 @@ the total discounts amount #### Defined in -[packages/medusa/src/services/totals.ts:1005](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L1005) +[medusa/src/services/totals.ts:1005](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L1005) ___ @@ -329,7 +347,7 @@ Gets the gift card amount on a cart or order. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to get gift card amount for | +| `cartOrOrder` | `Order` \| `Cart` | the cart or order to get gift card amount for | | `opts` | `Object` | - | | `opts.gift_cardable?` | `number` | - | @@ -341,7 +359,7 @@ the gift card amount applied to the cart or order #### Defined in -[packages/medusa/src/services/totals.ts:974](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L974) +[medusa/src/services/totals.ts:974](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L974) ___ @@ -356,7 +374,7 @@ cards are taxable this amount should exclude taxes. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to get gift card amount for | +| `cartOrOrder` | `Order` \| `Cart` | the cart or order to get gift card amount for | #### Returns @@ -366,7 +384,7 @@ the gift card amount applied to the cart or order #### Defined in -[packages/medusa/src/services/totals.ts:957](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L957) +[medusa/src/services/totals.ts:957](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L957) ___ @@ -395,7 +413,7 @@ the allocations that the discount has on the items in the cart or #### Defined in -[packages/medusa/src/services/totals.ts:722](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L722) +[medusa/src/services/totals.ts:719](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L719) ___ @@ -407,7 +425,7 @@ ___ | Name | Type | | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | +| `cartOrOrder` | `Order` \| `Cart` | #### Returns @@ -415,7 +433,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:699](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L699) +[medusa/src/services/totals.ts:696](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L696) ___ @@ -436,7 +454,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:684](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L684) +[medusa/src/services/totals.ts:681](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L681) ___ @@ -461,7 +479,7 @@ the line item refund amount. #### Defined in -[packages/medusa/src/services/totals.ts:507](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L507) +[medusa/src/services/totals.ts:504](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L504) ___ @@ -477,7 +495,7 @@ taxes into account. This can be controlled through the options. | Name | Type | Description | | :------ | :------ | :------ | | `lineItem` | `LineItem` | the line item to calculate a total for | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to use as context for the calculation | +| `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the calculation | | `options` | `GetLineItemTotalOptions` | the options to use for the calculation | #### Returns @@ -488,7 +506,7 @@ the line item total #### Defined in -[packages/medusa/src/services/totals.ts:930](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L930) +[medusa/src/services/totals.ts:930](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L930) ___ @@ -505,7 +523,7 @@ applied to a line item and the amount of tax applied to a line item. | Name | Type | Description | | :------ | :------ | :------ | | `lineItem` | `LineItem` | the line item to calculate totals for | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to use as context for the calculation | +| `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the calculation | | `options` | `LineItemTotalsOptions` | the options to evaluate the line item totals for | #### Returns @@ -516,7 +534,7 @@ the breakdown of the line item totals #### Defined in -[packages/medusa/src/services/totals.ts:778](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L778) +[medusa/src/services/totals.ts:775](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L775) ___ @@ -540,7 +558,7 @@ the total paid amount #### Defined in -[packages/medusa/src/services/totals.ts:160](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L160) +[medusa/src/services/totals.ts:157](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L157) ___ @@ -567,7 +585,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:586](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L586) +[medusa/src/services/totals.ts:583](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L583) ___ @@ -591,7 +609,7 @@ the total refunded amount for an order. #### Defined in -[packages/medusa/src/services/totals.ts:492](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L492) +[medusa/src/services/totals.ts:489](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L489) ___ @@ -607,7 +625,7 @@ already provided. | Name | Type | Description | | :------ | :------ | :------ | | `shippingMethod` | `ShippingMethod` | the shipping method to get totals breakdown for. | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to use as context for the breakdown | +| `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the breakdown | | `opts` | `GetShippingMethodTotalsOptions` | options for what should be included | #### Returns @@ -618,7 +636,7 @@ An object that breaks down the totals for the shipping method #### Defined in -[packages/medusa/src/services/totals.ts:194](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L194) +[medusa/src/services/totals.ts:191](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L191) ___ @@ -632,7 +650,7 @@ Calculates shipping total | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | cart or order to calculate subtotal for | +| `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate subtotal for | #### Returns @@ -642,7 +660,7 @@ shipping total #### Defined in -[packages/medusa/src/services/totals.ts:322](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L322) +[medusa/src/services/totals.ts:319](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L319) ___ @@ -656,7 +674,7 @@ Calculates subtotal of a given cart or order. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | cart or order to calculate subtotal for | +| `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate subtotal for | | `opts` | `SubtotalOptions` | options | #### Returns @@ -667,7 +685,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:286](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L286) +[medusa/src/services/totals.ts:283](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L283) ___ @@ -692,7 +710,7 @@ the swap total #### Defined in -[packages/medusa/src/services/totals.ts:175](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L175) +[medusa/src/services/totals.ts:172](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L172) ___ @@ -707,7 +725,7 @@ Currently based on the Danish tax system | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | `undefined` | cart or order to calculate tax total for | +| `cartOrOrder` | `Order` \| `Cart` | `undefined` | cart or order to calculate tax total for | | `forceTaxes` | `boolean` | `false` | whether taxes should be calculated regardless of region settings | #### Returns @@ -718,7 +736,7 @@ tax total #### Defined in -[packages/medusa/src/services/totals.ts:349](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L349) +[medusa/src/services/totals.ts:346](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L346) ___ @@ -732,7 +750,7 @@ Calculates total of a given cart or order. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | object to calculate total for | +| `cartOrOrder` | `Order` \| `Cart` | object to calculate total for | | `options` | `GetTotalsOptions` | options to calculate by | #### Returns @@ -743,7 +761,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:137](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L137) +[medusa/src/services/totals.ts:134](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L134) ___ @@ -767,7 +785,7 @@ the rounded value #### Defined in -[packages/medusa/src/services/totals.ts:1055](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/totals.ts#L1055) +[medusa/src/services/totals.ts:1057](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/totals.ts#L1057) ___ @@ -791,7 +809,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -815,4 +833,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/classes/UserService.md b/docs/content/references/services/classes/UserService.md index f66b00345f..66a130dc83 100644 --- a/docs/content/references/services/classes/UserService.md +++ b/docs/content/references/services/classes/UserService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/user.ts:47](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L47) +[medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L45) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L42) +[medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L40) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:44](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L44) +[medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L42) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L45) +[medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L43) ___ @@ -106,37 +106,37 @@ ___ • `Protected` **manager\_**: `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L40) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `EntityManager` +• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` -#### Overrides +#### Inherited from TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L41) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### userRepository\_ -• `Protected` `Readonly` **userRepository\_**: typeof `UserRepository` +• `Protected` `Readonly` **userRepository\_**: `Repository`<`User`\> #### Defined in -[packages/medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L43) +[medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L41) ___ @@ -155,7 +155,25 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L33) +[medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L33) + +## Accessors + +### activeManager\_ + +• `Protected` `get` **activeManager_**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Inherited from + +TransactionBaseService.activeManager\_ + +#### Defined in + +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods @@ -194,7 +212,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ @@ -220,7 +238,7 @@ the result of create #### Defined in -[packages/medusa/src/services/user.ts:179](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L179) +[medusa/src/services/user.ts:171](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L171) ___ @@ -244,7 +262,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/user.ts:259](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L259) +[medusa/src/services/user.ts:251](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L251) ___ @@ -272,7 +290,7 @@ the generated JSON web token #### Defined in -[packages/medusa/src/services/user.ts:323](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L323) +[medusa/src/services/user.ts:315](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L315) ___ @@ -296,7 +314,7 @@ hashed password #### Defined in -[packages/medusa/src/services/user.ts:167](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L167) +[medusa/src/services/user.ts:159](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L159) ___ @@ -319,7 +337,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/user.ts:69](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L69) +[medusa/src/services/user.ts:65](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L65) ___ @@ -345,7 +363,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:82](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L82) +[medusa/src/services/user.ts:77](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L77) ___ @@ -371,7 +389,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:113](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L113) +[medusa/src/services/user.ts:107](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L107) ___ @@ -397,7 +415,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:142](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L142) +[medusa/src/services/user.ts:135](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L135) ___ @@ -424,7 +442,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/user.ts:294](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L294) +[medusa/src/services/user.ts:286](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L286) ___ @@ -448,7 +466,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ @@ -473,7 +491,7 @@ the result of create #### Defined in -[packages/medusa/src/services/user.ts:213](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/services/user.ts#L213) +[medusa/src/services/user.ts:205](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/services/user.ts#L205) ___ @@ -497,4 +515,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/a4575c391/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/66c59d54f/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/docs/content/references/services/index.md b/docs/content/references/services/index.md index d29c12a237..c8e21f0d85 100644 --- a/docs/content/references/services/index.md +++ b/docs/content/references/services/index.md @@ -5,7 +5,6 @@ - [AnalyticsConfigService](classes/AnalyticsConfigService.md) - [AuthService](classes/AuthService.md) - [BatchJobService](classes/BatchJobService.md) -- [CacheService](classes/CacheService.md) - [CartService](classes/CartService.md) - [ClaimItemService](classes/ClaimItemService.md) - [ClaimService](classes/ClaimService.md) @@ -51,6 +50,7 @@ - [SearchService](classes/SearchService.md) - [ShippingOptionService](classes/ShippingOptionService.md) - [ShippingProfileService](classes/ShippingProfileService.md) +- [StagedJobService](classes/StagedJobService.md) - [StoreService](classes/StoreService.md) - [StrategyResolverService](classes/StrategyResolverService.md) - [SwapService](classes/SwapService.md) diff --git a/integration-tests/api/package.json b/integration-tests/api/package.json index e7845eb3af..205d306ea7 100644 --- a/integration-tests/api/package.json +++ b/integration-tests/api/package.json @@ -9,11 +9,11 @@ "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { - "@medusajs/cache-inmemory": "1.8.0-rc.3", - "@medusajs/event-bus-local": "1.8.0-rc.4", - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/cache-inmemory": "1.8.0", + "@medusajs/event-bus-local": "1.8.0", + "@medusajs/medusa": "1.8.0", "faker": "^5.5.3", - "medusa-interfaces": "1.3.7-rc.0", + "medusa-interfaces": "1.3.7", "typeorm": "^0.3.11" }, "devDependencies": { diff --git a/integration-tests/plugins/package.json b/integration-tests/plugins/package.json index 9872484a31..9309573c24 100644 --- a/integration-tests/plugins/package.json +++ b/integration-tests/plugins/package.json @@ -9,13 +9,13 @@ "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { - "@medusajs/cache-inmemory": "1.8.0-rc.3", - "@medusajs/event-bus-local": "1.8.0-rc.4", - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/cache-inmemory": "1.8.0", + "@medusajs/event-bus-local": "1.8.0", + "@medusajs/medusa": "1.8.0", "faker": "^5.5.3", - "medusa-fulfillment-webshipper": "1.3.8-rc.1", - "medusa-interfaces": "1.3.7-rc.0", - "medusa-plugin-sendgrid": "1.3.8-rc.0", + "medusa-fulfillment-webshipper": "1.3.8", + "medusa-interfaces": "1.3.7", + "medusa-plugin-sendgrid": "1.3.8", "typeorm": "^0.3.11" }, "devDependencies": { diff --git a/integration-tests/repositories/package.json b/integration-tests/repositories/package.json index 6db8f577c4..9139681c30 100644 --- a/integration-tests/repositories/package.json +++ b/integration-tests/repositories/package.json @@ -8,8 +8,8 @@ "test:integration": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit" }, "dependencies": { - "@medusajs/medusa": "1.8.0-rc.6", - "medusa-interfaces": "1.3.7-rc.0", + "@medusajs/medusa": "1.8.0", + "medusa-interfaces": "1.3.7", "typeorm": "^0.3.11" }, "devDependencies": { diff --git a/packages/admin-ui/CHANGELOG.md b/packages/admin-ui/CHANGELOG.md index 0b61601147..61a23ae301 100644 --- a/packages/admin-ui/CHANGELOG.md +++ b/packages/admin-ui/CHANGELOG.md @@ -1,5 +1,133 @@ # @medusajs/admin-ui +## 1.8.0 + +### Patch Changes + +- [#3403](https://github.com/medusajs/medusa/pull/3403) [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46) Thanks [@StephixOne](https://github.com/StephixOne)! - add location support in fulfillment modal + +- [#3461](https://github.com/medusajs/medusa/pull/3461) [`478903b55`](https://github.com/medusajs/medusa/commit/478903b55a6f7c276fa2285ee35bf8a2b51a72fb) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin-ui): Admin UI fixes / enhancements + + - Inventory and order UI fixes and tweaks + - focus-border clipping + - Fix use of `expand` parameter on order page + - Fix location address editing form state + - ensure that the allocation indicator is correctly displayed + - Fix inventory table pagination on location filter change + - Try and ensure allocation table checkmarks align better + - Add gap in table actions + - remove allocate button if no more allcoations can be made + - update edit-allocation sidebar + - create/update/delete inventory items according to inventory items on the variant + - Fix minor bugs related to the edit-allocation modal + - move tailwind to direct dependency + - display error messages for batch jobs + - draft order shipping details + - Implements redesigned public facing pages of admin UI. + - Add location names to fulfilment rows and timeline events + - Encode location id in URL on location table + +- [#3666](https://github.com/medusajs/medusa/pull/3666) [`ca3b32d53`](https://github.com/medusajs/medusa/commit/ca3b32d53c6854716bcbfb641ed381fa0f019a58) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin-ui): Make copy and UI on manage locations modal better when no locations + +- [#3676](https://github.com/medusajs/medusa/pull/3676) [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(admin-ui, medusa-react, medusa): Minor fixes to GC domain in admin UI. Also fixes GC update payload type in medusa-react and medusa. + +- [#3512](https://github.com/medusajs/medusa/pull/3512) [`a8423b8ac`](https://github.com/medusajs/medusa/commit/a8423b8acc8723dd3f5475d23bd9cb8be9c630c0) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(medusa, admin-ui): Fix edit order variant stock + +- [#3644](https://github.com/medusajs/medusa/pull/3644) [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(admin-ui): Adds metadata forms to all applicable domains in the UI. + fix(medusa): Fixes an issue where metadata was not being set for order addresses using `setMetadata`. + +- [#3670](https://github.com/medusajs/medusa/pull/3670) [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Fix(admin-ui,medusa): Ensure stock locations are created with a name + +- [#3657](https://github.com/medusajs/medusa/pull/3657) [`7e1d8ef59`](https://github.com/medusajs/medusa/commit/7e1d8ef599fe4588d439b449373debf1221e625d) Thanks [@StephixOne](https://github.com/StephixOne)! - feat(admin-ui): Add new feature badge for categories and inventory + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3607](https://github.com/medusajs/medusa/pull/3607) [`d1a6aa5a9`](https://github.com/medusajs/medusa/commit/d1a6aa5a90c147a34448e5398a1f205649598c09) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(admin-ui): fix bug with create fulfillment and a couple of other minor tweaks + +- [#3706](https://github.com/medusajs/medusa/pull/3706) [`dae8da109`](https://github.com/medusajs/medusa/commit/dae8da1099bbe5fd3c59adc7fd2c28b41c0f71bc) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(admin): Duplicate product without prices + +- [#3660](https://github.com/medusajs/medusa/pull/3660) [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(admin-ui, medusa): resolve bugs for orders with variants without inventory items + +- [#3438](https://github.com/medusajs/medusa/pull/3438) [`f027bc26f`](https://github.com/medusajs/medusa/commit/f027bc26fca94931df61c1cc0c7450de08020975) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin): Show correct reserved/available values when editing stock on variant + +- [#3418](https://github.com/medusajs/medusa/pull/3418) [`8a7421db5`](https://github.com/medusajs/medusa/commit/8a7421db5bd235dd3cf88bf73d2438af8769f7ba) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(admin,admin-ui): Updates the default behaviour of the plugin, and makes building for external deployment easier + +- [#3532](https://github.com/medusajs/medusa/pull/3532) [`bfef22b33`](https://github.com/medusajs/medusa/commit/bfef22b33e0aa4aa542d3f22fb32ee261f5a19ea) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(admin-ui): Revamps gift card manage page + +- [#3608](https://github.com/medusajs/medusa/pull/3608) [`345005573`](https://github.com/medusajs/medusa/commit/345005573a337d63394b63d33d6740a4171d1479) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin-ui): Update order edit variants table to fit longer content + +- [#3585](https://github.com/medusajs/medusa/pull/3585) [`0d0090338`](https://github.com/medusajs/medusa/commit/0d00903385df980e355c54cee9bcd4e8ede21635) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(admin-ui): minor fixes for inventory items + +- [#3592](https://github.com/medusajs/medusa/pull/3592) [`455c56c4b`](https://github.com/medusajs/medusa/commit/455c56c4b3846c583f39ba56352d645128b0c967) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin-ui): Hide inventory quantity field in variant stock form if SL module enabled + +- [#3395](https://github.com/medusajs/medusa/pull/3395) [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(admin-ui, medusa): Minor ui fixes relating to stock locations + +- [#3645](https://github.com/medusajs/medusa/pull/3645) [`e6b5859af`](https://github.com/medusajs/medusa/commit/e6b5859af213185408e1087073c1cba10f7b33c2) Thanks [@StephixOne](https://github.com/StephixOne)! - feat(admin-ui): Make number input increment/decrement buttons not tabbable-to + +- [#3522](https://github.com/medusajs/medusa/pull/3522) [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52) Thanks [@pKorsholm](https://github.com/pKorsholm)! - feat(medusa,admin): location_ids in swap and claim creation + +- [#3334](https://github.com/medusajs/medusa/pull/3334) [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(medusa,admin,admin-ui): Add new plugin to serve the admin dashboard from the server. Adds a new plugin injection step `setup`, code placed in the `setup` folder of a plugin will be run before any code from a plugin is injected into the Medusa server. + +- [#3416](https://github.com/medusajs/medusa/pull/3416) [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295) Thanks [@riqwan](https://github.com/riqwan)! - feat(medusa, admin-ui, medusa-react): Improvements to product categories + + - Adds name as required in category create form + - Adds name and handle as required in category edit form + - Updates message on create/update forms + - Adds category indicators for is_internal and is_active fields in the tree list + - Fixes bug where tree is not reset when update fails + - allow appending all category descendants with a param in list endpoint + - fix rank order changing on category update + - invalidate products query on category delete + - adds category ui for tree/list, edit, create, delete + - add product category queries and mutations + - category list API can return all descendant + - added breadcrumbs for categories on create/edit modal + - add empty state for product categories + - increase tree depth + scope categories on store + allow categories relation in products API + - categories can be ranked based on position + - seed command can create product categories + - hide categories in products behind feature flag + - fixes bug for mpath incorrectly updated for nested categories + +- [#3434](https://github.com/medusajs/medusa/pull/3434) [`f43f03bad`](https://github.com/medusajs/medusa/commit/f43f03badbfd1d3598f3c6bc6c81e6fa2e9c2a09) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin): Fix fulfilment creation + +- [#3655](https://github.com/medusajs/medusa/pull/3655) [`45fd0fb63`](https://github.com/medusajs/medusa/commit/45fd0fb639f05db6115be6823d42b85672c0891d) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(admin-ui): Always show categories in product page + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- [#3577](https://github.com/medusajs/medusa/pull/3577) [`95c9fbfdd`](https://github.com/medusajs/medusa/commit/95c9fbfdd5f290df0f22115f27b82f0812f8bd67) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin-ui): Fix effect check in inventory table and overflow UI + +- [#3448](https://github.com/medusajs/medusa/pull/3448) [`d4af87311`](https://github.com/medusajs/medusa/commit/d4af873113e4e3bb75ff1f5646870eb77b7a2b40) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin): Show all locations in allocation creation modal + +- [#3541](https://github.com/medusajs/medusa/pull/3541) [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa, admin-ui): refine create-fulfillment flow + +- [#3403](https://github.com/medusajs/medusa/pull/3403) [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46) Thanks [@StephixOne](https://github.com/StephixOne)! - Add order allocation to admin ui + +- [#3451](https://github.com/medusajs/medusa/pull/3451) [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9) Thanks [@pKorsholm](https://github.com/pKorsholm)! - feat(medusa,admin-ui): support location_id in + +- [#3401](https://github.com/medusajs/medusa/pull/3401) [`47d344076`](https://github.com/medusajs/medusa/commit/47d3440766efa26aba6638a05edec520a4e62828) Thanks [@riqwan](https://github.com/riqwan)! - feat(admin-ui, medusa-react): allow products to be categorized in product create/edit page + +- [#3625](https://github.com/medusajs/medusa/pull/3625) [`7428ffa30`](https://github.com/medusajs/medusa/commit/7428ffa300a1e5781ef18b86edf97b711df0b585) Thanks [@StephixOne](https://github.com/StephixOne)! - Fix team table filter dropdown transparency + +- Updated dependencies [[`d06ab9299`](https://github.com/medusajs/medusa/commit/d06ab929946c9e3842dcf4299b2c7e4c85fcc116), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`2d2727f75`](https://github.com/medusajs/medusa/commit/2d2727f753dd9386160d7e677b927c4915e1fce7), [`47d344076`](https://github.com/medusajs/medusa/commit/47d3440766efa26aba6638a05edec520a4e62828)]: + - medusa-react@5.0.0 + +## 0.0.1-rc.8 + +### Patch Changes + +- Updated dependencies []: + - medusa-react@5.0.0-rc.8 + +## 0.0.1-rc.7 + +### Patch Changes + +- [#3706](https://github.com/medusajs/medusa/pull/3706) [`dae8da109`](https://github.com/medusajs/medusa/commit/dae8da1099bbe5fd3c59adc7fd2c28b41c0f71bc) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(admin): Duplicate product without prices + +- Updated dependencies []: + - medusa-react@5.0.0-rc.7 + ## 0.0.1-rc.6 ### Patch Changes diff --git a/packages/admin-ui/package.json b/packages/admin-ui/package.json index 1b410d81fb..5fa13df1b8 100644 --- a/packages/admin-ui/package.json +++ b/packages/admin-ui/package.json @@ -2,7 +2,7 @@ "name": "@medusajs/admin-ui", "author": "Kasper Kristensen ", "license": "MIT", - "version": "0.0.1-rc.6", + "version": "1.8.0", "repository": { "type": "git", "url": "https://github.com/medusajs/medusa.git", @@ -49,7 +49,7 @@ "copy-to-clipboard": "^3.3.1", "emoji-picker-react": "^4.4.3", "framer-motion": "^9.1.6", - "medusa-react": "5.0.0-rc.6", + "medusa-react": "5.0.0", "moment": "^2.29.4", "pluralize": "^8.0.0", "postcss": "^8.4.21", @@ -79,8 +79,8 @@ "vite": "^4.1.4" }, "devDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/medusa": "1.8.0", + "@medusajs/types": "1.8.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", diff --git a/packages/admin-ui/ui/src/components/templates/product-table/use-copy-product.ts b/packages/admin-ui/ui/src/components/templates/product-table/use-copy-product.ts index 0fb1967c20..f1dd32cfbb 100644 --- a/packages/admin-ui/ui/src/components/templates/product-table/use-copy-product.ts +++ b/packages/admin-ui/ui/src/components/templates/product-table/use-copy-product.ts @@ -97,6 +97,8 @@ const useCopyProduct = () => { return acc }, {} as NonNullable[0]) + variantBase.prices = [] + if (prices && prices.length) { variantBase.prices = prices.map((price) => ({ amount: price.amount, diff --git a/packages/admin/CHANGELOG.md b/packages/admin/CHANGELOG.md index 607d094c73..7ed4b6c80a 100644 --- a/packages/admin/CHANGELOG.md +++ b/packages/admin/CHANGELOG.md @@ -1,5 +1,61 @@ # @medusajs/admin +## 2.0.0 + +### Patch Changes + +- [#3461](https://github.com/medusajs/medusa/pull/3461) [`478903b55`](https://github.com/medusajs/medusa/commit/478903b55a6f7c276fa2285ee35bf8a2b51a72fb) Thanks [@StephixOne](https://github.com/StephixOne)! - fix(admin-ui): Admin UI fixes / enhancements + + - Inventory and order UI fixes and tweaks + - focus-border clipping + - Fix use of `expand` parameter on order page + - Fix location address editing form state + - ensure that the allocation indicator is correctly displayed + - Fix inventory table pagination on location filter change + - Try and ensure allocation table checkmarks align better + - Add gap in table actions + - remove allocate button if no more allcoations can be made + - update edit-allocation sidebar + - create/update/delete inventory items according to inventory items on the variant + - Fix minor bugs related to the edit-allocation modal + - move tailwind to direct dependency + - display error messages for batch jobs + - draft order shipping details + - Implements redesigned public facing pages of admin UI. + - Add location names to fulfilment rows and timeline events + - Encode location id in URL on location table + +- [#3410](https://github.com/medusajs/medusa/pull/3410) [`8ed67d2d7`](https://github.com/medusajs/medusa/commit/8ed67d2d7d36da2d0cb3541e42bba1770aefc60a) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(admin,oas-github-cli): Change public config to private to avoid publishing attempts + include `setup/` in npm release for `admin-ui` + +- [#3706](https://github.com/medusajs/medusa/pull/3706) [`dae8da109`](https://github.com/medusajs/medusa/commit/dae8da1099bbe5fd3c59adc7fd2c28b41c0f71bc) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(admin): Duplicate product without prices + +- [#3418](https://github.com/medusajs/medusa/pull/3418) [`8a7421db5`](https://github.com/medusajs/medusa/commit/8a7421db5bd235dd3cf88bf73d2438af8769f7ba) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(admin,admin-ui): Updates the default behaviour of the plugin, and makes building for external deployment easier + +- [#3334](https://github.com/medusajs/medusa/pull/3334) [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(medusa,admin,admin-ui): Add new plugin to serve the admin dashboard from the server. Adds a new plugin injection step `setup`, code placed in the `setup` folder of a plugin will be run before any code from a plugin is injected into the Medusa server. + +- Updated dependencies [[`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`478903b55`](https://github.com/medusajs/medusa/commit/478903b55a6f7c276fa2285ee35bf8a2b51a72fb), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`ca3b32d53`](https://github.com/medusajs/medusa/commit/ca3b32d53c6854716bcbfb641ed381fa0f019a58), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`a8423b8ac`](https://github.com/medusajs/medusa/commit/a8423b8acc8723dd3f5475d23bd9cb8be9c630c0), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7e1d8ef59`](https://github.com/medusajs/medusa/commit/7e1d8ef599fe4588d439b449373debf1221e625d), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`d1a6aa5a9`](https://github.com/medusajs/medusa/commit/d1a6aa5a90c147a34448e5398a1f205649598c09), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`dae8da109`](https://github.com/medusajs/medusa/commit/dae8da1099bbe5fd3c59adc7fd2c28b41c0f71bc), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`f027bc26f`](https://github.com/medusajs/medusa/commit/f027bc26fca94931df61c1cc0c7450de08020975), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`8a7421db5`](https://github.com/medusajs/medusa/commit/8a7421db5bd235dd3cf88bf73d2438af8769f7ba), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`bfef22b33`](https://github.com/medusajs/medusa/commit/bfef22b33e0aa4aa542d3f22fb32ee261f5a19ea), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`345005573`](https://github.com/medusajs/medusa/commit/345005573a337d63394b63d33d6740a4171d1479), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`0d0090338`](https://github.com/medusajs/medusa/commit/0d00903385df980e355c54cee9bcd4e8ede21635), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`455c56c4b`](https://github.com/medusajs/medusa/commit/455c56c4b3846c583f39ba56352d645128b0c967), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`e6b5859af`](https://github.com/medusajs/medusa/commit/e6b5859af213185408e1087073c1cba10f7b33c2), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`f43f03bad`](https://github.com/medusajs/medusa/commit/f43f03badbfd1d3598f3c6bc6c81e6fa2e9c2a09), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`45fd0fb63`](https://github.com/medusajs/medusa/commit/45fd0fb639f05db6115be6823d42b85672c0891d), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`95c9fbfdd`](https://github.com/medusajs/medusa/commit/95c9fbfdd5f290df0f22115f27b82f0812f8bd67), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`d4af87311`](https://github.com/medusajs/medusa/commit/d4af873113e4e3bb75ff1f5646870eb77b7a2b40), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`47d344076`](https://github.com/medusajs/medusa/commit/47d3440766efa26aba6638a05edec520a4e62828), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45), [`7428ffa30`](https://github.com/medusajs/medusa/commit/7428ffa300a1e5781ef18b86edf97b711df0b585)]: + - @medusajs/admin-ui@1.8.0 + - @medusajs/medusa@1.8.0 + - medusa-core-utils@1.2.0 + +## 1.0.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + - @medusajs/admin-ui@0.0.1-rc.8 + +## 1.0.0-rc.7 + +### Patch Changes + +- [#3706](https://github.com/medusajs/medusa/pull/3706) [`dae8da109`](https://github.com/medusajs/medusa/commit/dae8da1099bbe5fd3c59adc7fd2c28b41c0f71bc) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(admin): Duplicate product without prices + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`dae8da109`](https://github.com/medusajs/medusa/commit/dae8da1099bbe5fd3c59adc7fd2c28b41c0f71bc)]: + - @medusajs/medusa@1.8.0-rc.7 + - @medusajs/admin-ui@0.0.1-rc.7 + ## 1.0.0-rc.6 ### Patch Changes diff --git a/packages/admin/package.json b/packages/admin/package.json index 252fca15ea..9babfd110a 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/admin", - "version": "1.0.0-rc.6", + "version": "2.0.0", "bin": { "medusa-admin": "./bin/medusa-admin.js" }, @@ -26,18 +26,18 @@ "directory": "packages/admin" }, "dependencies": { - "@medusajs/admin-ui": "0.0.1-rc.6", + "@medusajs/admin-ui": "1.8.0", "commander": "^10.0.0", "dotenv": "^16.0.3", "express": "^4.17.1", "fs-extra": "^11.1.0", - "medusa-core-utils": "1.2.0-rc.0", + "medusa-core-utils": "1.2.0", "ora": "5.4.0", "picocolors": "^1.0.0", "ts-dedent": "^2.2.0" }, "peerDependencies": { - "@medusajs/medusa": "1.8.0-rc.6" + "@medusajs/medusa": "1.8.0" }, "devDependencies": { "@types/express": "^4.17.13", diff --git a/packages/cache-inmemory/CHANGELOG.md b/packages/cache-inmemory/CHANGELOG.md index 86790a855f..32ce85b2b6 100644 --- a/packages/cache-inmemory/CHANGELOG.md +++ b/packages/cache-inmemory/CHANGELOG.md @@ -1,5 +1,22 @@ # @medusajs/cache-inmemory +## 1.8.0 + +### Minor Changes + +- [#3187](https://github.com/medusajs/medusa/pull/3187) [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7) Thanks [@fPolic](https://github.com/fPolic)! - feat(medusa, cache-redis, cache-inmemory): Added cache modules + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + ## 1.8.0-rc.3 ### Patch Changes diff --git a/packages/cache-inmemory/package.json b/packages/cache-inmemory/package.json index 870678d9dc..10c2280d4e 100644 --- a/packages/cache-inmemory/package.json +++ b/packages/cache-inmemory/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/cache-inmemory", - "version": "1.8.0-rc.3", + "version": "1.8.0", "description": "In-memory Cache Module for Medusa", "main": "dist/index.js", "repository": { @@ -17,7 +17,7 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", "ts-jest": "^25.5.1", @@ -30,6 +30,6 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4" + "@medusajs/modules-sdk": "1.8.0" } } diff --git a/packages/cache-redis/CHANGELOG.md b/packages/cache-redis/CHANGELOG.md index 6cc35bbc97..7a95e4c89a 100644 --- a/packages/cache-redis/CHANGELOG.md +++ b/packages/cache-redis/CHANGELOG.md @@ -1,5 +1,22 @@ # @medusajs/cache-redis +## 1.8.0 + +### Minor Changes + +- [#3187](https://github.com/medusajs/medusa/pull/3187) [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7) Thanks [@fPolic](https://github.com/fPolic)! - feat(medusa, cache-redis, cache-inmemory): Added cache modules + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + ## 1.8.0-rc.3 ### Patch Changes diff --git a/packages/cache-redis/package.json b/packages/cache-redis/package.json index 87e9a3b43e..2bf2a44da2 100644 --- a/packages/cache-redis/package.json +++ b/packages/cache-redis/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/cache-redis", - "version": "1.8.0-rc.3", + "version": "1.8.0", "description": "Redis Cache Module for Medusa", "main": "dist/index.js", "repository": { @@ -17,7 +17,7 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", "ts-jest": "^25.5.1", @@ -30,7 +30,7 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4", + "@medusajs/modules-sdk": "1.8.0", "awilix": "^8.0.0", "ioredis": "^5.3.1" } diff --git a/packages/create-medusa-app/CHANGELOG.md b/packages/create-medusa-app/CHANGELOG.md index eceefb8e00..f7609b63c5 100644 --- a/packages/create-medusa-app/CHANGELOG.md +++ b/packages/create-medusa-app/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 0.0.10 + +### Patch Changes + +- [#3376](https://github.com/medusajs/medusa/pull/3376) [`88392e017`](https://github.com/medusajs/medusa/commit/88392e017653b53069793bd2ee451c2e6b7bcf17) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore(create-medusa-app): Remove admin + Gatsby starter from npx + ## 0.0.10-rc.0 ### Patch Changes diff --git a/packages/create-medusa-app/package.json b/packages/create-medusa-app/package.json index c0fab530f1..4a41aa673f 100644 --- a/packages/create-medusa-app/package.json +++ b/packages/create-medusa-app/package.json @@ -1,6 +1,6 @@ { "name": "create-medusa-app", - "version": "0.0.10-rc.0", + "version": "0.0.10", "main": "dist/index.js", "bin": "cli.js", "license": "MIT", diff --git a/packages/event-bus-local/CHANGELOG.md b/packages/event-bus-local/CHANGELOG.md index 8f1752ed24..18143ec9a9 100644 --- a/packages/event-bus-local/CHANGELOG.md +++ b/packages/event-bus-local/CHANGELOG.md @@ -1,5 +1,23 @@ # @medusajs/event-bus-local +## 1.8.0 + +### Minor Changes + +- [#2599](https://github.com/medusajs/medusa/pull/2599) [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa,event-bus-local,event-bus-redis): Event Bus module (Redis + Local) + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- [#3575](https://github.com/medusajs/medusa/pull/3575) [`4a7bdc917`](https://github.com/medusajs/medusa/commit/4a7bdc917ac17d1f8e0749c033f8816ecb0c10b5) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(event-bus-local): Error handling + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + - @medusajs/utils@1.8.0 + ## 1.8.0-rc.4 ### Patch Changes diff --git a/packages/event-bus-local/package.json b/packages/event-bus-local/package.json index 888025de3a..d5b2401c23 100644 --- a/packages/event-bus-local/package.json +++ b/packages/event-bus-local/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/event-bus-local", - "version": "1.8.0-rc.4", + "version": "1.8.0", "description": "Local Event Bus Module for Medusa", "main": "dist/index.js", "files": [ @@ -17,7 +17,7 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.2", "ts-jest": "^25.5.1", @@ -30,7 +30,7 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4", - "@medusajs/utils": "0.0.2-rc.2" + "@medusajs/modules-sdk": "1.8.0", + "@medusajs/utils": "1.8.0" } } diff --git a/packages/event-bus-redis/CHANGELOG.md b/packages/event-bus-redis/CHANGELOG.md index 7c9762b6d6..512bedf5fe 100644 --- a/packages/event-bus-redis/CHANGELOG.md +++ b/packages/event-bus-redis/CHANGELOG.md @@ -1,5 +1,21 @@ # @medusajs/event-bus-redis +## 1.8.0 + +### Minor Changes + +- [#2599](https://github.com/medusajs/medusa/pull/2599) [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa,event-bus-local,event-bus-redis): Event Bus module (Redis + Local) + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + - @medusajs/utils@1.8.0 + ## 1.8.0-rc.4 ### Patch Changes diff --git a/packages/event-bus-redis/package.json b/packages/event-bus-redis/package.json index 73cd1b792f..39862639d8 100644 --- a/packages/event-bus-redis/package.json +++ b/packages/event-bus-redis/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/event-bus-redis", - "version": "1.8.0-rc.4", + "version": "1.8.0", "description": "Redis Event Bus Module for Medusa", "main": "dist/index.js", "files": [ @@ -17,10 +17,10 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.2", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-test-utils": "^1.1.40", "ts-jest": "^25.5.1", "typescript": "^4.4.4" }, @@ -31,8 +31,8 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4", - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/modules-sdk": "1.8.0", + "@medusajs/utils": "1.8.0", "awilix": "^8.0.0", "bullmq": "^3.5.6", "ioredis": "^5.2.5" diff --git a/packages/generated/client-types/CHANGELOG.md b/packages/generated/client-types/CHANGELOG.md index 8a37be5adb..8687d7a146 100644 --- a/packages/generated/client-types/CHANGELOG.md +++ b/packages/generated/client-types/CHANGELOG.md @@ -1,5 +1,23 @@ # @medusajs/client-types +## 0.2.0 + +### Minor Changes + +- [#3477](https://github.com/medusajs/medusa/pull/3477) [`826d4bedf`](https://github.com/medusajs/medusa/commit/826d4bedfe1b6459163711d5173eb8eadfdea26e) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(codegen,types): SetRelation on expanded types + +### Patch Changes + +- [#3483](https://github.com/medusajs/medusa/pull/3483) [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): declare x-expanded-relations - Admin + +- [#3482](https://github.com/medusajs/medusa/pull/3482) [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): declare x-expanded-relations - Store + +- [#3492](https://github.com/medusajs/medusa/pull/3492) [`e6e529152`](https://github.com/medusajs/medusa/commit/e6e529152792e63a71664fb88567276a820e9908) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(codegen): commit generated client types to codebase + +- [#3452](https://github.com/medusajs/medusa/pull/3452) [`55febef7f`](https://github.com/medusajs/medusa/commit/55febef7f1e74a07e76039d1ffbcb721c08adeb2) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(types): package scaffolding for generated types + +- [#3478](https://github.com/medusajs/medusa/pull/3478) [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas,js,react): use AdminExtendedStoresRes instead of AdminStoresRes + ## 0.2.0-rc.0 ### Minor Changes diff --git a/packages/generated/client-types/package.json b/packages/generated/client-types/package.json index 70fc4c4074..2dc060cc27 100644 --- a/packages/generated/client-types/package.json +++ b/packages/generated/client-types/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/client-types", - "version": "0.2.0-rc.0", + "version": "0.2.0", "description": "Client types for Medusa Commerce Rest API", "main": "dist/index.js", "files": [ @@ -24,7 +24,7 @@ "url": "https://github.com/medusajs/medusa/issues" }, "devDependencies": { - "@medusajs/medusa-oas-cli": "0.2.0-rc.6", + "@medusajs/medusa-oas-cli": "0.2.0", "cross-env": "^7.0.3", "execa": "^5.1.1", "jest": "^27.4.7", diff --git a/packages/inventory/CHANGELOG.md b/packages/inventory/CHANGELOG.md index 5c7eed97ee..39b9d489fd 100644 --- a/packages/inventory/CHANGELOG.md +++ b/packages/inventory/CHANGELOG.md @@ -1,5 +1,57 @@ # @medusajs/inventory +## 1.8.0 + +### Minor Changes + +- [#3329](https://github.com/medusajs/medusa/pull/3329) [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Inventory and Stock location modules supporting isolated connection + +### Patch Changes + +- [#3319](https://github.com/medusajs/medusa/pull/3319) [`08c8aa46c`](https://github.com/medusajs/medusa/commit/08c8aa46c55453cf741a97d06547ae85fee6e985) Thanks [@pKorsholm](https://github.com/pKorsholm)! - List inventory items based on locations + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3352](https://github.com/medusajs/medusa/pull/3352) [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - feat(medusa): Modules initializer + + ### Loading modules in a project + + Example + + ```typescript + import { + InventoryServiceInitializeOptions, + initialize, + } from "@medusajs/inventory" + + const options: InventoryServiceInitializeOptions = { + database: { + type: "postgres", + url: DB_URL, + }, + } + + const inventoryService = await initialize(options) + const newInventoryItem = await inventoryService.createInventoryItem({ + sku: "sku_123", + }) + ``` + +- [#3460](https://github.com/medusajs/medusa/pull/3460) [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Fix(inventory, medusa): ensure no orphaned reservations and invenotry levels on location removal + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + - @medusajs/utils@1.8.0 + ## 1.8.0-rc.4 ### Patch Changes diff --git a/packages/inventory/package.json b/packages/inventory/package.json index c5bc49a71a..f41f65074d 100644 --- a/packages/inventory/package.json +++ b/packages/inventory/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/inventory", - "version": "1.8.0-rc.4", + "version": "1.8.0", "description": "Inventory Module for Medusa", "main": "dist/index.js", "repository": { @@ -17,15 +17,15 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", "ts-jest": "^25.5.1", "typescript": "^4.4.4" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4", - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/modules-sdk": "1.8.0", + "@medusajs/utils": "1.8.0", "awilix": "^8.0.0", "typeorm": "^0.3.11" }, diff --git a/packages/medusa-cli/CHANGELOG.md b/packages/medusa-cli/CHANGELOG.md index 1549221519..fcbae5a415 100644 --- a/packages/medusa-cli/CHANGELOG.md +++ b/packages/medusa-cli/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 1.3.9 + +### Patch Changes + +- [#3688](https://github.com/medusajs/medusa/pull/3688) [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore(medusa-cli): Add missing utils dep + +- [#3603](https://github.com/medusajs/medusa/pull/3603) [`cd54c7dca`](https://github.com/medusajs/medusa/commit/cd54c7dca9f7444dd2bfa91b4e3e3359dc6658cf) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(medusa-cli): Add direct dependency of `semver` + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - medusa-core-utils@1.2.0 + - @medusajs/utils@1.8.0 + ## 1.3.9-rc.2 ### Patch Changes diff --git a/packages/medusa-cli/package.json b/packages/medusa-cli/package.json index 5fea73be24..e410516e2c 100644 --- a/packages/medusa-cli/package.json +++ b/packages/medusa-cli/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa-cli", - "version": "1.3.9-rc.2", + "version": "1.3.9", "description": "Command Line interface for Medusa Commerce", "main": "dist/index.js", "bin": { @@ -36,7 +36,7 @@ "jest": "^25.5.4" }, "dependencies": { - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/utils": "1.8.0", "axios": "^0.21.4", "chalk": "^4.0.0", "configstore": "5.0.1", @@ -49,7 +49,7 @@ "inquirer": "^8.0.0", "is-valid-path": "^0.1.1", "meant": "^1.0.3", - "medusa-core-utils": "^1.2.0-rc.0", + "medusa-core-utils": "^1.2.0", "medusa-telemetry": "0.0.16", "open": "^8.0.6", "ora": "^5.4.1", diff --git a/packages/medusa-core-utils/CHANGELOG.md b/packages/medusa-core-utils/CHANGELOG.md index 871e9348fd..542e1e0d7f 100644 --- a/packages/medusa-core-utils/CHANGELOG.md +++ b/packages/medusa-core-utils/CHANGELOG.md @@ -1,5 +1,45 @@ # Change Log +## 1.2.0 + +### Minor Changes + +- [#3408](https://github.com/medusajs/medusa/pull/3408) [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Http Server Graceful Shutdown + +- [#3329](https://github.com/medusajs/medusa/pull/3329) [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Inventory and Stock location modules supporting isolated connection + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3352](https://github.com/medusajs/medusa/pull/3352) [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - feat(medusa): Modules initializer + + ### Loading modules in a project + + Example + + ```typescript + import { + InventoryServiceInitializeOptions, + initialize, + } from "@medusajs/inventory" + + const options: InventoryServiceInitializeOptions = { + database: { + type: "postgres", + url: DB_URL, + }, + } + + const inventoryService = await initialize(options) + const newInventoryItem = await inventoryService.createInventoryItem({ + sku: "sku_123", + }) + ``` + ## 1.2.0-rc.0 ### Minor Changes diff --git a/packages/medusa-core-utils/package.json b/packages/medusa-core-utils/package.json index 9b741deda3..c7069c9e69 100644 --- a/packages/medusa-core-utils/package.json +++ b/packages/medusa-core-utils/package.json @@ -1,6 +1,6 @@ { "name": "medusa-core-utils", - "version": "1.2.0-rc.0", + "version": "1.2.0", "description": "Core utils for Medusa", "main": "dist/index.js", "repository": { diff --git a/packages/medusa-dev-cli/CHANGELOG.md b/packages/medusa-dev-cli/CHANGELOG.md index 475ba14b89..c4284b7dbe 100644 --- a/packages/medusa-dev-cli/CHANGELOG.md +++ b/packages/medusa-dev-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 0.0.31 + +### Patch Changes + +- [#3293](https://github.com/medusajs/medusa/pull/3293) [`e8e7d7bb5`](https://github.com/medusajs/medusa/commit/e8e7d7bb5355877b3d0b85a079b6b57cfe7391c9) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(medusa-dev): include packages/ subdirectories in discovery + ## 0.0.31-rc.0 ### Patch Changes diff --git a/packages/medusa-dev-cli/package.json b/packages/medusa-dev-cli/package.json index 8a68a8c4c7..3ce690a21a 100644 --- a/packages/medusa-dev-cli/package.json +++ b/packages/medusa-dev-cli/package.json @@ -1,7 +1,7 @@ { "name": "medusa-dev-cli", "description": "CLI helpers for contributors working on Medusa", - "version": "0.0.31-rc.0", + "version": "0.0.31", "author": "Sebastian Rindom ", "bin": { "medusa-dev": "./dist/index.js" diff --git a/packages/medusa-file-minio/CHANGELOG.md b/packages/medusa-file-minio/CHANGELOG.md index ecceb68d99..4efff0c007 100644 --- a/packages/medusa-file-minio/CHANGELOG.md +++ b/packages/medusa-file-minio/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 1.1.6 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.1.6-rc.0 ### Patch Changes diff --git a/packages/medusa-file-minio/package.json b/packages/medusa-file-minio/package.json index 9fad93d5a0..82e70ed13a 100644 --- a/packages/medusa-file-minio/package.json +++ b/packages/medusa-file-minio/package.json @@ -1,6 +1,6 @@ { "name": "medusa-file-minio", - "version": "1.1.6-rc.0", + "version": "1.1.6", "description": "MinIO server file connector for Medusa", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "build": "babel src --out-dir dist/ --ignore '**/__tests__','**/__mocks__'", @@ -32,15 +32,15 @@ "test": "jest --passWithNoTests src" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.16.0", "aws-sdk": "^2.1043.0", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "3bbd1e8507e00bc471de6ae3c30207999a4a4011", "keywords": [ diff --git a/packages/medusa-file-s3/CHANGELOG.md b/packages/medusa-file-s3/CHANGELOG.md index 814110d309..ce402cf7d7 100644 --- a/packages/medusa-file-s3/CHANGELOG.md +++ b/packages/medusa-file-s3/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 1.1.12 + +### Patch Changes + +- [#3260](https://github.com/medusajs/medusa/pull/3260) [`13c200ad2`](https://github.com/medusajs/medusa/commit/13c200ad2f394734a126ea8920840a70e61401f7) Thanks [@pevey](https://github.com/pevey)! - fix(medusa-file-s3): update s3 file service to reuse one s3 client + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.1.12-rc.0 ### Patch Changes diff --git a/packages/medusa-file-s3/package.json b/packages/medusa-file-s3/package.json index c5d01fbd0e..7b35cad9b5 100644 --- a/packages/medusa-file-s3/package.json +++ b/packages/medusa-file-s3/package.json @@ -1,6 +1,6 @@ { "name": "medusa-file-s3", - "version": "1.1.12-rc.0", + "version": "1.1.12", "description": "AWS s3 file connector for Medusa", "main": "index.js", "repository": { @@ -23,8 +23,8 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -33,15 +33,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.15.4", "aws-sdk": "^2.983.0", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808", "keywords": [ diff --git a/packages/medusa-file-spaces/CHANGELOG.md b/packages/medusa-file-spaces/CHANGELOG.md index b9924b894a..f3007bfeca 100644 --- a/packages/medusa-file-spaces/CHANGELOG.md +++ b/packages/medusa-file-spaces/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.3.6 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.3.6-rc.0 ### Patch Changes diff --git a/packages/medusa-file-spaces/package.json b/packages/medusa-file-spaces/package.json index f63b84e957..ec6a422763 100644 --- a/packages/medusa-file-spaces/package.json +++ b/packages/medusa-file-spaces/package.json @@ -1,6 +1,6 @@ { "name": "medusa-file-spaces", - "version": "1.3.6-rc.0", + "version": "1.3.6", "description": "Digital Ocean Spaces file connector for Medusa", "main": "index.js", "repository": { @@ -23,8 +23,8 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -33,15 +33,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "aws-sdk": "^2.710.0", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40", "stripe": "^8.50.0" }, "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808", diff --git a/packages/medusa-fulfillment-manual/CHANGELOG.md b/packages/medusa-fulfillment-manual/CHANGELOG.md index c61e8b4c78..f12cbcd5a7 100644 --- a/packages/medusa-fulfillment-manual/CHANGELOG.md +++ b/packages/medusa-fulfillment-manual/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.1.37 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + ## 1.1.37-rc.0 ### Patch Changes diff --git a/packages/medusa-fulfillment-manual/package.json b/packages/medusa-fulfillment-manual/package.json index 6741788d66..fd384fb20c 100644 --- a/packages/medusa-fulfillment-manual/package.json +++ b/packages/medusa-fulfillment-manual/package.json @@ -1,6 +1,6 @@ { "name": "medusa-fulfillment-manual", - "version": "1.1.37-rc.0", + "version": "1.1.37", "description": "A manual fulfillment provider for Medusa", "main": "index.js", "repository": { @@ -20,7 +20,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "test": "jest --passWithNoTests src", @@ -29,14 +29,14 @@ "prepare": "cross-env NODE_ENV=production yarn run build" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "@babel/plugin-transform-instanceof": "^7.8.3", "@babel/runtime": "^7.7.6", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0" + "medusa-core-utils": "^1.2.0" }, "gitHead": "7770046479c361f375842a8605b15e5d7bc24624", "keywords": [ diff --git a/packages/medusa-fulfillment-webshipper/CHANGELOG.md b/packages/medusa-fulfillment-webshipper/CHANGELOG.md index 0a01d41dc3..cc61731a6f 100644 --- a/packages/medusa-fulfillment-webshipper/CHANGELOG.md +++ b/packages/medusa-fulfillment-webshipper/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 1.3.8 + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + ## 1.3.8-rc.1 ### Patch Changes diff --git a/packages/medusa-fulfillment-webshipper/package.json b/packages/medusa-fulfillment-webshipper/package.json index c92a3faa5b..b2bea691cd 100644 --- a/packages/medusa-fulfillment-webshipper/package.json +++ b/packages/medusa-fulfillment-webshipper/package.json @@ -1,6 +1,6 @@ { "name": "medusa-fulfillment-webshipper", - "version": "1.3.8-rc.1", + "version": "1.3.8", "description": "Webshipper Fulfillment provider for Medusa", "main": "index.js", "repository": { @@ -18,11 +18,11 @@ "@babel/plugin-transform-runtime": "^7.7.6", "@babel/preset-env": "^7.7.5", "@babel/runtime": "^7.9.6", - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/medusa": "1.8.0", "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -31,14 +31,14 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "axios": "^0.20.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0" + "medusa-core-utils": "^1.2.0" }, "gitHead": "7770046479c361f375842a8605b15e5d7bc24624", "keywords": [ diff --git a/packages/medusa-interfaces/CHANGELOG.md b/packages/medusa-interfaces/CHANGELOG.md index 4e38443354..b4f615e2ae 100644 --- a/packages/medusa-interfaces/CHANGELOG.md +++ b/packages/medusa-interfaces/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.3.7 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + ## 1.3.7-rc.0 ### Patch Changes diff --git a/packages/medusa-interfaces/package.json b/packages/medusa-interfaces/package.json index a1e4300c76..abd8fe277a 100644 --- a/packages/medusa-interfaces/package.json +++ b/packages/medusa-interfaces/package.json @@ -1,6 +1,6 @@ { "name": "medusa-interfaces", - "version": "1.3.7-rc.0", + "version": "1.3.7", "description": "Core interfaces for Medusa", "main": "dist/index.js", "repository": { @@ -31,8 +31,8 @@ "@babel/runtime": "^7.9.6", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40", "typescript": "^4.4.4" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e" diff --git a/packages/medusa-js/CHANGELOG.md b/packages/medusa-js/CHANGELOG.md index 55909cfd30..1c0f0f0dce 100644 --- a/packages/medusa-js/CHANGELOG.md +++ b/packages/medusa-js/CHANGELOG.md @@ -1,5 +1,45 @@ # Change Log +## 2.0.0 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3435](https://github.com/medusajs/medusa/pull/3435) [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Add create-inventory-item endpoint + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3436](https://github.com/medusajs/medusa/pull/3436) [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074) Thanks [@riqwan](https://github.com/riqwan)! - feat(medusa, medusa-js, medusa-react): Add store queries to react medusa + +- [#3110](https://github.com/medusajs/medusa/pull/3110) [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85) Thanks [@StephixOne](https://github.com/StephixOne)! - feat(medusa,medusa-js,medusa-react): Add inventory module endpoints + +- [#3478](https://github.com/medusajs/medusa/pull/3478) [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas,js,react): use AdminExtendedStoresRes instead of AdminStoresRes + +- [#3288](https://github.com/medusajs/medusa/pull/3288) [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas): fix paths and fix schema names to match convention + +- [#3474](https://github.com/medusajs/medusa/pull/3474) [`02c77d705`](https://github.com/medusajs/medusa/commit/02c77d7059b7e4cb9f6ebfa8cbec2b84e86118ec) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Fix(medusa): Adjust reservations correctly + +- Updated dependencies [[`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45)]: + - @medusajs/medusa@1.8.0 + +## 2.0.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + +## 2.0.0-rc.7 + +### Patch Changes + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24)]: + - @medusajs/medusa@1.8.0-rc.7 + ## 2.0.0-rc.6 ### Patch Changes diff --git a/packages/medusa-js/package.json b/packages/medusa-js/package.json index f206823be9..889ed8bdc7 100644 --- a/packages/medusa-js/package.json +++ b/packages/medusa-js/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa-js", - "version": "2.0.0-rc.6", + "version": "2.0.0", "description": "Client for Medusa Commerce Rest API", "main": "dist/index.js", "module": "dist/index.mjs", @@ -32,7 +32,7 @@ "uuid": "^9.0.0" }, "peerDependencies": { - "@medusajs/medusa": "1.8.0-rc.6" + "@medusajs/medusa": "1.8.0" }, "repository": { "type": "git", @@ -43,7 +43,7 @@ "url": "https://github.com/medusajs/medusa/issues" }, "devDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/medusa": "1.8.0", "@types/uuid": "^9.0.0", "cross-env": "^7.0.3", "jest": "^27.4.7", diff --git a/packages/medusa-payment-adyen/CHANGELOG.md b/packages/medusa-payment-adyen/CHANGELOG.md index bb91c5ea10..08ec5445b4 100644 --- a/packages/medusa-payment-adyen/CHANGELOG.md +++ b/packages/medusa-payment-adyen/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.1.44 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + ## 1.1.44-rc.0 ### Patch Changes diff --git a/packages/medusa-payment-adyen/package.json b/packages/medusa-payment-adyen/package.json index d37f413e57..4ed3e879db 100644 --- a/packages/medusa-payment-adyen/package.json +++ b/packages/medusa-payment-adyen/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-adyen", - "version": "1.1.44-rc.0", + "version": "1.1.44", "description": "Adyen Payment provider for Medusa Commerce", "main": "index.js", "repository": { @@ -23,8 +23,8 @@ "client-sessions": "^0.8.0", "cross-env": "^7.0.3", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -33,7 +33,7 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@adyen/api-library": "^5.0.1", @@ -42,7 +42,7 @@ "body-parser": "^1.19.0", "cors": "^2.8.5", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0" + "medusa-core-utils": "^1.2.0" }, "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808", "keywords": [ diff --git a/packages/medusa-payment-klarna/CHANGELOG.md b/packages/medusa-payment-klarna/CHANGELOG.md index 7b8755d0ce..3ad6c81729 100644 --- a/packages/medusa-payment-klarna/CHANGELOG.md +++ b/packages/medusa-payment-klarna/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.3.9 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.3.9-rc.0 ### Patch Changes diff --git a/packages/medusa-payment-klarna/package.json b/packages/medusa-payment-klarna/package.json index a402f1f755..94859bd23a 100644 --- a/packages/medusa-payment-klarna/package.json +++ b/packages/medusa-payment-klarna/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-klarna", - "version": "1.3.9-rc.0", + "version": "1.3.9", "description": "Klarna Payment provider for Medusa Commerce", "main": "index.js", "repository": { @@ -24,7 +24,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -33,15 +33,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "axios": "^0.21.4", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", "keywords": [ diff --git a/packages/medusa-payment-manual/CHANGELOG.md b/packages/medusa-payment-manual/CHANGELOG.md index 7e37ab3044..77b3a8e1d7 100644 --- a/packages/medusa-payment-manual/CHANGELOG.md +++ b/packages/medusa-payment-manual/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 1.0.23 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724)]: + - medusa-interfaces@1.3.7 + ## 1.0.23-rc.0 ### Patch Changes diff --git a/packages/medusa-payment-manual/package.json b/packages/medusa-payment-manual/package.json index 93ebb418dd..952b147be5 100644 --- a/packages/medusa-payment-manual/package.json +++ b/packages/medusa-payment-manual/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-manual", - "version": "1.0.23-rc.0", + "version": "1.0.23", "description": "A dummy payment provider to be used for testing or manual payments", "main": "index.js", "repository": { @@ -24,8 +24,8 @@ "@babel/runtime": "^7.9.6", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -34,7 +34,7 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808", "keywords": [ diff --git a/packages/medusa-payment-paypal/CHANGELOG.md b/packages/medusa-payment-paypal/CHANGELOG.md index f8695a2eb1..690b3800bc 100644 --- a/packages/medusa-payment-paypal/CHANGELOG.md +++ b/packages/medusa-payment-paypal/CHANGELOG.md @@ -1,5 +1,35 @@ # Change Log +## 2.0.0 + +### Minor Changes + +- [#3257](https://github.com/medusajs/medusa/pull/3257) [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa-payment-stripe): Implement payment processor API on stripe plugin and fix web hook issues + +### Patch Changes + +- [#3414](https://github.com/medusajs/medusa/pull/3414) [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa-payment-paypal): Migrate to the new payment processor API + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- Updated dependencies [[`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45)]: + - @medusajs/medusa@1.8.0 + - medusa-core-utils@1.2.0 + +## 2.0.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + +## 2.0.0-rc.7 + +### Patch Changes + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24)]: + - @medusajs/medusa@1.8.0-rc.7 + ## 2.0.0-rc.6 ### Patch Changes diff --git a/packages/medusa-payment-paypal/package.json b/packages/medusa-payment-paypal/package.json index cb9d9e0c5b..21dd98ddfc 100644 --- a/packages/medusa-payment-paypal/package.json +++ b/packages/medusa-payment-paypal/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-paypal", - "version": "2.0.0-rc.6", + "version": "2.0.0", "description": "Paypal Payment provider for Medusa Commerce", "main": "dist/index.js", "repository": { @@ -20,21 +20,21 @@ "watch": "tsc --watch" }, "devDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/medusa": "1.8.0", "@types/stripe": "^8.0.417", "cross-env": "^5.2.1", "jest": "^25.5.4", "typescript": "^4.4.4" }, "peerDependencies": { - "@medusajs/medusa": "1.8.0-rc.6" + "@medusajs/medusa": "1.8.0" }, "dependencies": { "@paypal/checkout-server-sdk": "^1.0.3", "axios": "^1.3.4", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0" + "medusa-core-utils": "^1.2.0" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", "keywords": [ diff --git a/packages/medusa-payment-stripe/CHANGELOG.md b/packages/medusa-payment-stripe/CHANGELOG.md index 488842e868..573f01446d 100644 --- a/packages/medusa-payment-stripe/CHANGELOG.md +++ b/packages/medusa-payment-stripe/CHANGELOG.md @@ -1,5 +1,42 @@ # Change Log +## 2.0.0 + +### Minor Changes + +- [#3257](https://github.com/medusajs/medusa/pull/3257) [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa-payment-stripe): Implement payment processor API on stripe plugin and fix web hook issues + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3414](https://github.com/medusajs/medusa/pull/3414) [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa-payment-paypal): Migrate to the new payment processor API + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3371](https://github.com/medusajs/medusa/pull/3371) [`5d809a7a3`](https://github.com/medusajs/medusa/commit/5d809a7a392866e7c05225ba8b24df94e4b7e95e) Thanks [@pKorsholm](https://github.com/pKorsholm)! - add typescript dev dependency + +- Updated dependencies [[`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45)]: + - @medusajs/medusa@1.8.0 + - medusa-core-utils@1.2.0 + +## 2.0.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + +## 2.0.0-rc.7 + +### Patch Changes + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24)]: + - @medusajs/medusa@1.8.0-rc.7 + ## 2.0.0-rc.6 ### Patch Changes diff --git a/packages/medusa-payment-stripe/package.json b/packages/medusa-payment-stripe/package.json index d248fd91f8..0d6013845c 100644 --- a/packages/medusa-payment-stripe/package.json +++ b/packages/medusa-payment-stripe/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-stripe", - "version": "2.0.0-rc.6", + "version": "2.0.0", "description": "Stripe Payment provider for Meduas Commerce", "main": "dist/index.js", "repository": { @@ -20,19 +20,19 @@ "watch": "tsc --watch" }, "devDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/medusa": "1.8.0", "@types/stripe": "^8.0.417", "cross-env": "^5.2.1", "jest": "^25.5.4", "typescript": "^4.9.5" }, "peerDependencies": { - "@medusajs/medusa": "1.8.0-rc.6" + "@medusajs/medusa": "1.8.0" }, "dependencies": { "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", + "medusa-core-utils": "^1.2.0", "stripe": "^11.10.0" }, "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808", diff --git a/packages/medusa-plugin-algolia/CHANGELOG.md b/packages/medusa-plugin-algolia/CHANGELOG.md index 09fa4e6b65..60b1b335e0 100644 --- a/packages/medusa-plugin-algolia/CHANGELOG.md +++ b/packages/medusa-plugin-algolia/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 0.2.10 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3510](https://github.com/medusajs/medusa/pull/3510) [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-algolia): Revamp Algolia search plugin + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + - @medusajs/utils@1.8.0 + ## 0.2.10-rc.3 ### Patch Changes diff --git a/packages/medusa-plugin-algolia/package.json b/packages/medusa-plugin-algolia/package.json index 60941abb37..59274f3d8d 100644 --- a/packages/medusa-plugin-algolia/package.json +++ b/packages/medusa-plugin-algolia/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-algolia", - "version": "0.2.10-rc.3", + "version": "0.2.10", "description": "Algolia search plugin for Medusa", "repository": { "type": "git", @@ -19,12 +19,12 @@ "watch": "tsc --watch" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4", - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/modules-sdk": "1.8.0", + "@medusajs/utils": "1.8.0", "algoliasearch": "^4.15.0" }, "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", diff --git a/packages/medusa-plugin-brightpearl/CHANGELOG.md b/packages/medusa-plugin-brightpearl/CHANGELOG.md index dbea223b62..0a12114c25 100644 --- a/packages/medusa-plugin-brightpearl/CHANGELOG.md +++ b/packages/medusa-plugin-brightpearl/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.3.7 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + ## 1.3.7-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-brightpearl/package.json b/packages/medusa-plugin-brightpearl/package.json index 2924cb4eca..670d42e535 100644 --- a/packages/medusa-plugin-brightpearl/package.json +++ b/packages/medusa-plugin-brightpearl/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-brightpearl", - "version": "1.3.7-rc.0", + "version": "1.3.7", "description": "Brightpearl plugin for Medusa Commerce", "main": "index.js", "repository": { @@ -26,8 +26,8 @@ "client-sessions": "^0.8.0", "cross-env": "^7.0.3", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -36,13 +36,13 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "axios": "^0.19.2", "axios-rate-limit": "^1.2.1", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", + "medusa-core-utils": "^1.2.0", "randomatic": "^3.1.1" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", diff --git a/packages/medusa-plugin-contentful/CHANGELOG.md b/packages/medusa-plugin-contentful/CHANGELOG.md index bb02bd98c2..2802e84d14 100644 --- a/packages/medusa-plugin-contentful/CHANGELOG.md +++ b/packages/medusa-plugin-contentful/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 1.2.8 + +### Patch Changes + +- [#3187](https://github.com/medusajs/medusa/pull/3187) [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7) Thanks [@fPolic](https://github.com/fPolic)! - feat(medusa, cache-redis, cache-inmemory): Added cache modules + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.2.8-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-contentful/package.json b/packages/medusa-plugin-contentful/package.json index 1f553e7e5c..16c23a2536 100644 --- a/packages/medusa-plugin-contentful/package.json +++ b/packages/medusa-plugin-contentful/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-contentful", - "version": "1.2.8-rc.0", + "version": "1.2.8", "description": "Contentful plugin for Medusa Commerce", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,15 +32,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "body-parser": "^1.19.0", "contentful-management": "^5.27.1", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40", "redis": "^3.0.2" }, "gitHead": "3bbd1e8507e00bc471de6ae3c30207999a4a4011", diff --git a/packages/medusa-plugin-discount-generator/CHANGELOG.md b/packages/medusa-plugin-discount-generator/CHANGELOG.md index 41d255f05d..4191df0da0 100644 --- a/packages/medusa-plugin-discount-generator/CHANGELOG.md +++ b/packages/medusa-plugin-discount-generator/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.1.25 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + ## 1.1.25-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-discount-generator/package.json b/packages/medusa-plugin-discount-generator/package.json index 0d0e516f24..6d82085f65 100644 --- a/packages/medusa-plugin-discount-generator/package.json +++ b/packages/medusa-plugin-discount-generator/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-discount-generator", - "version": "1.1.25-rc.0", + "version": "1.1.25", "main": "index.js", "license": "MIT", "author": "Sebastian Rindom", @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,12 +32,12 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", + "medusa-core-utils": "^1.2.0", "randomatic": "^3.1.1" }, "gitHead": "41a5425405aea5045a26def95c0dc00cf4a5a44d" diff --git a/packages/medusa-plugin-economic/CHANGELOG.md b/packages/medusa-plugin-economic/CHANGELOG.md index 8fd17b5cfa..6794b0653b 100644 --- a/packages/medusa-plugin-economic/CHANGELOG.md +++ b/packages/medusa-plugin-economic/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.1.43 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.1.43-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-economic/package.json b/packages/medusa-plugin-economic/package.json index 4b33c0a661..482b6379c1 100644 --- a/packages/medusa-plugin-economic/package.json +++ b/packages/medusa-plugin-economic/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-economic", - "version": "1.1.43-rc.0", + "version": "1.1.43", "description": "E-conomic financial reporting", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,15 +32,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "axios": "^0.19.2", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40", "moment": "^2.27.0" }, "gitHead": "3bbd1e8507e00bc471de6ae3c30207999a4a4011" diff --git a/packages/medusa-plugin-ip-lookup/CHANGELOG.md b/packages/medusa-plugin-ip-lookup/CHANGELOG.md index 1fa368e1f6..e44818ac72 100644 --- a/packages/medusa-plugin-ip-lookup/CHANGELOG.md +++ b/packages/medusa-plugin-ip-lookup/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 1.2.6 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724)]: + - medusa-interfaces@1.3.7 + ## 1.2.6-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-ip-lookup/package.json b/packages/medusa-plugin-ip-lookup/package.json index 2a213e23d0..ebb103f1df 100644 --- a/packages/medusa-plugin-ip-lookup/package.json +++ b/packages/medusa-plugin-ip-lookup/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-ip-lookup", - "version": "1.2.6-rc.0", + "version": "1.2.6", "description": "IP lookup middleware for Medusa core", "main": "dist/index.js", "repository": { @@ -27,10 +27,10 @@ "@babel/runtime": "^7.7.6", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "axios": "^0.20.0" diff --git a/packages/medusa-plugin-mailchimp/CHANGELOG.md b/packages/medusa-plugin-mailchimp/CHANGELOG.md index c5343ed007..92b25649c8 100644 --- a/packages/medusa-plugin-mailchimp/CHANGELOG.md +++ b/packages/medusa-plugin-mailchimp/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.1.47 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.1.47-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-mailchimp/package.json b/packages/medusa-plugin-mailchimp/package.json index 16bf9e61ff..f367024880 100644 --- a/packages/medusa-plugin-mailchimp/package.json +++ b/packages/medusa-plugin-mailchimp/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-mailchimp", - "version": "1.1.47-rc.0", + "version": "1.1.47", "description": "Mailchimp newsletter subscriptions", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,7 +32,7 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", @@ -40,8 +40,8 @@ "cors": "^2.8.5", "express": "^4.17.1", "mailchimp-api-v3": "^1.14.0", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", "keywords": [ diff --git a/packages/medusa-plugin-meilisearch/CHANGELOG.md b/packages/medusa-plugin-meilisearch/CHANGELOG.md index c87297ff0b..0cc7eb4025 100644 --- a/packages/medusa-plugin-meilisearch/CHANGELOG.md +++ b/packages/medusa-plugin-meilisearch/CHANGELOG.md @@ -1,5 +1,85 @@ # Change Log +## 2.0.0 + +### Major Changes + +- [#3377](https://github.com/medusajs/medusa/pull/3377) [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-meilisearch): Update + improve Meilisearch plugin + + **What** + + - Bumps `meilisearch` dep to latest major + - Migrates plugin to TypeScript + - Changes the way indexes are configured in `medusa-config.js`: + + **Before** + + ``` + { + resolve: `medusa-plugin-meilisearch`, + options: { + config: { host: "...", apiKey: "..." }, + settings: { + products: { + searchableAttributes: ["title"], + displayedAttributes: ["title"], + }, + }, + }, + }, + ``` + + **After** + + ``` + { + resolve: `medusa-plugin-meilisearch`, + options: { + config: { host: "...", apiKey: "..." }, + settings: { + products: { + **indexSettings**: { + searchableAttributes: ["title"], + displayedAttributes: ["title"], + }, + }, + }, + }, + }, + ``` + + This is done to allow for additional configuration of indexes, that are not necessarily passed on query-time. + + We introduce two new settings: + + ``` + settings: { + products: { + indexSettings: { + searchableAttributes: ["title"], + displayedAttributes: ["title"],, + }, + primaryKey: "id" + transformer: (document) => ({ id: "yo" }) + }, + }, + ``` + + Meilisearch changed their primary key inference in the major release. Now we must be explicit when multiple properties end with `id`. Read more in their [docs](https://docs.meilisearch.com/learn/core_concepts/primary_key.html#primary-field). + + The transformer allows developers to specify how their documents are stored in Meilisearch. It is configurable for each index. + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3510](https://github.com/medusajs/medusa/pull/3510) [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-algolia): Revamp Algolia search plugin + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/utils@1.8.0 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/medusa-plugin-meilisearch/package.json b/packages/medusa-plugin-meilisearch/package.json index f9ad9c9f84..31e114ad76 100644 --- a/packages/medusa-plugin-meilisearch/package.json +++ b/packages/medusa-plugin-meilisearch/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-meilisearch", - "version": "2.0.0-rc.2", + "version": "2.0.0", "description": "Meilisearch search plugin for Medusa", "repository": { "type": "git", @@ -19,14 +19,14 @@ "watch": "tsc --watch" }, "dependencies": { - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/utils": "1.8.0", "body-parser": "^1.19.0", "lodash": "^4.17.21", "meilisearch": "^0.31.1" }, "devDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/medusa": "1.8.0", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", "typescript": "^4.9.5" diff --git a/packages/medusa-plugin-restock-notification/CHANGELOG.md b/packages/medusa-plugin-restock-notification/CHANGELOG.md index 344f0740b6..496527a212 100644 --- a/packages/medusa-plugin-restock-notification/CHANGELOG.md +++ b/packages/medusa-plugin-restock-notification/CHANGELOG.md @@ -1,5 +1,28 @@ # Change Log +## 3.0.0 + +### Patch Changes + +- Updated dependencies [[`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45)]: + - @medusajs/medusa@1.8.0 + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + +## 3.0.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + +## 3.0.0-rc.7 + +### Patch Changes + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24)]: + - @medusajs/medusa@1.8.0-rc.7 + ## 3.0.0-rc.6 ### Patch Changes diff --git a/packages/medusa-plugin-restock-notification/package.json b/packages/medusa-plugin-restock-notification/package.json index cb1f003328..9d6dd10180 100644 --- a/packages/medusa-plugin-restock-notification/package.json +++ b/packages/medusa-plugin-restock-notification/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-restock-notification", - "version": "3.0.0-rc.6", + "version": "3.0.0", "main": "index.js", "repository": { "type": "git", @@ -17,8 +17,8 @@ "babel-preset-medusa-package": "^1.1.19", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40", "pg": "^8.5.1", "ulid": "^2.3.0" }, @@ -29,14 +29,14 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", - "medusa-interfaces": "1.3.7-rc.0" + "@medusajs/medusa": "1.8.0", + "medusa-interfaces": "1.3.7" }, "dependencies": { "body-parser": "^1.19.0", "cors": "^2.8.5", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0" + "medusa-core-utils": "^1.2.0" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", "keywords": [ diff --git a/packages/medusa-plugin-segment/CHANGELOG.md b/packages/medusa-plugin-segment/CHANGELOG.md index 1447d1356a..13d91955f9 100644 --- a/packages/medusa-plugin-segment/CHANGELOG.md +++ b/packages/medusa-plugin-segment/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.3.5 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.3.5-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-segment/package.json b/packages/medusa-plugin-segment/package.json index fb1499f5a4..732b7dd31a 100644 --- a/packages/medusa-plugin-segment/package.json +++ b/packages/medusa-plugin-segment/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-segment", - "version": "1.3.5-rc.0", + "version": "1.3.5", "description": "Segment Analytics", "main": "index.js", "repository": { @@ -24,7 +24,7 @@ "cross-env": "^5.2.1", "eslint": "^6.8.0", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -33,15 +33,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "analytics-node": "^3.4.0-beta.1", "axios": "^0.19.2", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", "keywords": [ diff --git a/packages/medusa-plugin-sendgrid/CHANGELOG.md b/packages/medusa-plugin-sendgrid/CHANGELOG.md index 691380d4e9..7bff3aea6e 100644 --- a/packages/medusa-plugin-sendgrid/CHANGELOG.md +++ b/packages/medusa-plugin-sendgrid/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 1.3.8 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.3.8-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-sendgrid/package.json b/packages/medusa-plugin-sendgrid/package.json index 053ea45048..acbb8ce211 100644 --- a/packages/medusa-plugin-sendgrid/package.json +++ b/packages/medusa-plugin-sendgrid/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-sendgrid", - "version": "1.3.8-rc.0", + "version": "1.3.8", "description": "SendGrid transactional emails", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,15 +32,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "@sendgrid/mail": "^7.1.1", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "3bbd1e8507e00bc471de6ae3c30207999a4a4011", "keywords": [ diff --git a/packages/medusa-plugin-slack-notification/CHANGELOG.md b/packages/medusa-plugin-slack-notification/CHANGELOG.md index edaffe8ebd..309c09c497 100644 --- a/packages/medusa-plugin-slack-notification/CHANGELOG.md +++ b/packages/medusa-plugin-slack-notification/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.3.9 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.3.9-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-slack-notification/package.json b/packages/medusa-plugin-slack-notification/package.json index 86c23bd02c..227b948098 100644 --- a/packages/medusa-plugin-slack-notification/package.json +++ b/packages/medusa-plugin-slack-notification/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-slack-notification", - "version": "1.3.9-rc.0", + "version": "1.3.9", "description": "Slack notifications", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "client-sessions": "^0.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,15 +32,15 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "axios": "^0.19.2", "body-parser": "^1.19.0", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40", "moment": "^2.27.0" }, "gitHead": "c46300d58fbfd0b2dc2c02745ae143e6247e885b", diff --git a/packages/medusa-plugin-twilio-sms/CHANGELOG.md b/packages/medusa-plugin-twilio-sms/CHANGELOG.md index 52e802f54e..c1fdbd1d08 100644 --- a/packages/medusa-plugin-twilio-sms/CHANGELOG.md +++ b/packages/medusa-plugin-twilio-sms/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.2.8 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.2.8-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-twilio-sms/package.json b/packages/medusa-plugin-twilio-sms/package.json index 99fc47f309..54616fe830 100644 --- a/packages/medusa-plugin-twilio-sms/package.json +++ b/packages/medusa-plugin-twilio-sms/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-twilio-sms", - "version": "1.2.8-rc.0", + "version": "1.2.8", "main": "index.js", "repository": { "type": "git", @@ -21,7 +21,7 @@ "@babel/runtime": "^7.9.6", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -30,13 +30,13 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", "body-parser": "^1.19.0", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40", "twilio": "^3.49.1" }, "gitHead": "c46300d58fbfd0b2dc2c02745ae143e6247e885b", diff --git a/packages/medusa-plugin-wishlist/CHANGELOG.md b/packages/medusa-plugin-wishlist/CHANGELOG.md index 47e178301a..35ee66b510 100644 --- a/packages/medusa-plugin-wishlist/CHANGELOG.md +++ b/packages/medusa-plugin-wishlist/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.1.42 + +### Patch Changes + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.1.42-rc.0 ### Patch Changes diff --git a/packages/medusa-plugin-wishlist/package.json b/packages/medusa-plugin-wishlist/package.json index 0abe582f35..99ec966753 100644 --- a/packages/medusa-plugin-wishlist/package.json +++ b/packages/medusa-plugin-wishlist/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-wishlist", - "version": "1.1.42-rc.0", + "version": "1.1.42", "description": "Provides /customers/:id/wishlist to add items to a customr's wishlist", "main": "index.js", "repository": { @@ -23,7 +23,7 @@ "@babel/runtime": "^7.9.6", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "scripts": { "prepare": "cross-env NODE_ENV=production yarn run build", @@ -32,14 +32,14 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0" + "medusa-interfaces": "1.3.7" }, "dependencies": { "body-parser": "^1.19.0", "cors": "^2.8.5", "express": "^4.17.1", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-test-utils": "^1.1.40" }, "gitHead": "3bbd1e8507e00bc471de6ae3c30207999a4a4011", "keywords": [ diff --git a/packages/medusa-react/CHANGELOG.md b/packages/medusa-react/CHANGELOG.md index afa4b533bf..9a9d515f4e 100644 --- a/packages/medusa-react/CHANGELOG.md +++ b/packages/medusa-react/CHANGELOG.md @@ -1,5 +1,78 @@ # Change Log +## 5.0.0 + +### Minor Changes + +- [#3408](https://github.com/medusajs/medusa/pull/3408) [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Http Server Graceful Shutdown + +### Patch Changes + +- [#3689](https://github.com/medusajs/medusa/pull/3689) [`d06ab9299`](https://github.com/medusajs/medusa/commit/d06ab929946c9e3842dcf4299b2c7e4c85fcc116) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(react): export product-categories store hooks + +- [#3676](https://github.com/medusajs/medusa/pull/3676) [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(admin-ui, medusa-react, medusa): Minor fixes to GC domain in admin UI. Also fixes GC update payload type in medusa-react and medusa. + +- [#3435](https://github.com/medusajs/medusa/pull/3435) [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Add create-inventory-item endpoint + +- [#3686](https://github.com/medusajs/medusa/pull/3686) [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa-react): Query key invalidation + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3436](https://github.com/medusajs/medusa/pull/3436) [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074) Thanks [@riqwan](https://github.com/riqwan)! - feat(medusa, medusa-js, medusa-react): Add store queries to react medusa + +- [#3110](https://github.com/medusajs/medusa/pull/3110) [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85) Thanks [@StephixOne](https://github.com/StephixOne)! - feat(medusa,medusa-js,medusa-react): Add inventory module endpoints + +- [#3419](https://github.com/medusajs/medusa/pull/3419) [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa-react): invalidate all reservations list queries + +- [#3416](https://github.com/medusajs/medusa/pull/3416) [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295) Thanks [@riqwan](https://github.com/riqwan)! - feat(medusa, admin-ui, medusa-react): Improvements to product categories + + - Adds name as required in category create form + - Adds name and handle as required in category edit form + - Updates message on create/update forms + - Adds category indicators for is_internal and is_active fields in the tree list + - Fixes bug where tree is not reset when update fails + - allow appending all category descendants with a param in list endpoint + - fix rank order changing on category update + - invalidate products query on category delete + - adds category ui for tree/list, edit, create, delete + - add product category queries and mutations + - category list API can return all descendant + - added breadcrumbs for categories on create/edit modal + - add empty state for product categories + - increase tree depth + scope categories on store + allow categories relation in products API + - categories can be ranked based on position + - seed command can create product categories + - hide categories in products behind feature flag + - fixes bug for mpath incorrectly updated for nested categories + +- [#3478](https://github.com/medusajs/medusa/pull/3478) [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas,js,react): use AdminExtendedStoresRes instead of AdminStoresRes + +- [#2599](https://github.com/medusajs/medusa/pull/2599) [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa,event-bus-local,event-bus-redis): Event Bus module (Redis + Local) + +- [#3406](https://github.com/medusajs/medusa/pull/3406) [`2d2727f75`](https://github.com/medusajs/medusa/commit/2d2727f753dd9386160d7e677b927c4915e1fce7) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(eslint): remove unused .eslintignore in medusa-react package + +- [#3401](https://github.com/medusajs/medusa/pull/3401) [`47d344076`](https://github.com/medusajs/medusa/commit/47d3440766efa26aba6638a05edec520a4e62828) Thanks [@riqwan](https://github.com/riqwan)! - feat(admin-ui, medusa-react): allow products to be categorized in product create/edit page + +- Updated dependencies [[`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`02c77d705`](https://github.com/medusajs/medusa/commit/02c77d7059b7e4cb9f6ebfa8cbec2b84e86118ec), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45)]: + - @medusajs/medusa@1.8.0 + - @medusajs/medusa-js@2.0.0 + +## 5.0.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + - @medusajs/medusa-js@2.0.0-rc.8 + +## 5.0.0-rc.7 + +### Patch Changes + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24)]: + - @medusajs/medusa@1.8.0-rc.7 + - @medusajs/medusa-js@2.0.0-rc.7 + ## 5.0.0-rc.6 ### Patch Changes diff --git a/packages/medusa-react/package.json b/packages/medusa-react/package.json index 7f96d82c10..07877962e8 100644 --- a/packages/medusa-react/package.json +++ b/packages/medusa-react/package.json @@ -1,5 +1,5 @@ { - "version": "5.0.0-rc.6", + "version": "5.0.0", "license": "MIT", "main": "dist/index.js", "module": "dist/index.mjs", @@ -25,7 +25,7 @@ "test": "echo \"Tests disabled temporarily\"" }, "peerDependencies": { - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/medusa": "1.8.0", "@tanstack/react-query": "^4.22.0", "react": "^16.8 || ^17.0 || ^18.0", "react-dom": "^16.8 || ^17.0 || ^18.0" @@ -34,7 +34,7 @@ "author": "Zakaria S. El Asri", "devDependencies": { "@babel/core": "^7.16.0", - "@medusajs/medusa": "1.8.0-rc.6", + "@medusajs/medusa": "1.8.0", "@storybook/addon-essentials": "^6.3.12", "@storybook/addon-links": "^6.3.12", "@storybook/addons": "^6.3.12", @@ -61,7 +61,7 @@ "tsup": "^6.5.0" }, "dependencies": { - "@medusajs/medusa-js": "^2.0.0-rc.6" + "@medusajs/medusa-js": "2.0.0" }, "msw": { "workerDirectory": "public" diff --git a/packages/medusa-source-shopify/CHANGELOG.md b/packages/medusa-source-shopify/CHANGELOG.md index dedad25cc5..05b49cc4b2 100644 --- a/packages/medusa-source-shopify/CHANGELOG.md +++ b/packages/medusa-source-shopify/CHANGELOG.md @@ -1,5 +1,21 @@ # Change Log +## 1.2.8 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3187](https://github.com/medusajs/medusa/pull/3187) [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7) Thanks [@fPolic](https://github.com/fPolic)! - feat(medusa, cache-redis, cache-inmemory): Added cache modules + +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + ## 1.2.8-rc.0 ### Patch Changes diff --git a/packages/medusa-source-shopify/package.json b/packages/medusa-source-shopify/package.json index f953ad37c7..a88de97bb1 100644 --- a/packages/medusa-source-shopify/package.json +++ b/packages/medusa-source-shopify/package.json @@ -1,6 +1,6 @@ { "name": "medusa-source-shopify", - "version": "1.2.8-rc.0", + "version": "1.2.8", "description": "Source plugin that allows users to import products from a Shopify store", "main": "index.js", "repository": { @@ -17,7 +17,7 @@ "watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'" }, "peerDependencies": { - "medusa-interfaces": "1.3.7-rc.0", + "medusa-interfaces": "1.3.7", "typeorm": "0.x" }, "dependencies": { @@ -28,9 +28,9 @@ "express": "^4.17.1", "ioredis": "^4.27.9", "lodash": "^4.17.21", - "medusa-core-utils": "^1.2.0-rc.0", - "medusa-interfaces": "^1.3.7-rc.0", - "medusa-test-utils": "^1.1.40-rc.0" + "medusa-core-utils": "^1.2.0", + "medusa-interfaces": "^1.3.7", + "medusa-test-utils": "^1.1.40" }, "devDependencies": { "@babel/cli": "^7.15.4", @@ -45,7 +45,7 @@ "client-sessions": "^0.8.0", "cross-env": "^7.0.3", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0" + "medusa-interfaces": "^1.3.7" }, "gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e", "keywords": [ diff --git a/packages/medusa-test-utils/CHANGELOG.md b/packages/medusa-test-utils/CHANGELOG.md index aed89d73ab..938db9e8a2 100644 --- a/packages/medusa-test-utils/CHANGELOG.md +++ b/packages/medusa-test-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 1.1.40 + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: + - medusa-core-utils@1.2.0 + ## 1.1.40-rc.0 ### Patch Changes @@ -9,6 +19,7 @@ - Plugin repository loader to work with Typeorm update - Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73)]: - medusa-core-utils@1.2.0-rc.0 + ## 1.1.40 ### Patch Changes @@ -259,4 +270,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -- updates license ([db519fb](https://github.com/medusajs/medusa/commit/db519fbaa6f8ad02c19cbecba5d4f28ba1ee81aa)) \ No newline at end of file +- updates license ([db519fb](https://github.com/medusajs/medusa/commit/db519fbaa6f8ad02c19cbecba5d4f28ba1ee81aa)) diff --git a/packages/medusa-test-utils/package.json b/packages/medusa-test-utils/package.json index a208381388..9774618bf2 100644 --- a/packages/medusa-test-utils/package.json +++ b/packages/medusa-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "medusa-test-utils", - "version": "1.1.40-rc.0", + "version": "1.1.40", "description": "Test utils for Medusa", "main": "dist/index.js", "repository": { @@ -31,7 +31,7 @@ }, "dependencies": { "@babel/plugin-transform-classes": "^7.9.5", - "medusa-core-utils": "^1.2.0-rc.0", + "medusa-core-utils": "^1.2.0", "randomatic": "^3.1.1" }, "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808" diff --git a/packages/medusa/CHANGELOG.md b/packages/medusa/CHANGELOG.md index c4c2543bd2..e63cc93a25 100644 --- a/packages/medusa/CHANGELOG.md +++ b/packages/medusa/CHANGELOG.md @@ -1,5 +1,297 @@ # Change Log +## 1.8.0 + +### Minor Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3554](https://github.com/medusajs/medusa/pull/3554) [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b) Thanks [@pKorsholm](https://github.com/pKorsholm)! - feat(medusa): remove reservations if cart completion fails after reservation creation + +- [#3257](https://github.com/medusajs/medusa/pull/3257) [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa-payment-stripe): Implement payment processor API on stripe plugin and fix web hook issues + +- [#3552](https://github.com/medusajs/medusa/pull/3552) [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): remove limit of the number of levels to list when joining levels + +- [#3172](https://github.com/medusajs/medusa/pull/3172) [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Add inventory management to create-fulfillment flow + +- [#3586](https://github.com/medusajs/medusa/pull/3586) [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Fix(medusa): include quantities when listing admin products with an inventory module installed + +- [#3544](https://github.com/medusajs/medusa/pull/3544) [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918) Thanks [@pKorsholm](https://github.com/pKorsholm)! - feat(medusa): remove reservations for all old line items when an order edit is accepted + +- [#3408](https://github.com/medusajs/medusa/pull/3408) [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Http Server Graceful Shutdown + +- [#3329](https://github.com/medusajs/medusa/pull/3329) [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Inventory and Stock location modules supporting isolated connection + +- [#2599](https://github.com/medusajs/medusa/pull/2599) [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa,event-bus-local,event-bus-redis): Event Bus module (Redis + Local) + +- [#3187](https://github.com/medusajs/medusa/pull/3187) [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7) Thanks [@fPolic](https://github.com/fPolic)! - feat(medusa, cache-redis, cache-inmemory): Added cache modules + +### Patch Changes + +- [#3350](https://github.com/medusajs/medusa/pull/3350) [`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac) Thanks [@adrien2p](https://github.com/adrien2p)! - Chores(medusa): draft order create improvement perf (first step) + +- [#3345](https://github.com/medusajs/medusa/pull/3345) [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medusa): Plugin repository loader to work with Typeorm update + +- [#3374](https://github.com/medusajs/medusa/pull/3374) [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c) Thanks [@adrien2p](https://github.com/adrien2p)! - chore(medusa): Little improvement in draft order creation + +- [#3362](https://github.com/medusajs/medusa/pull/3362) [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medeusa): Transform query includes options should only be added to allowed props if there is already at least one allowed props + +- [#3676](https://github.com/medusajs/medusa/pull/3676) [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - fix(admin-ui, medusa-react, medusa): Minor fixes to GC domain in admin UI. Also fixes GC update payload type in medusa-react and medusa. + +- [#3462](https://github.com/medusajs/medusa/pull/3462) [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): Include location_id in fulfillment body + +- [#3391](https://github.com/medusajs/medusa/pull/3391) [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(ci,oas) move oas ci script to a package under the oas workspace + +- [#3087](https://github.com/medusajs/medusa/pull/3087) [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad) Thanks [@fPolic](https://github.com/fPolic)! - chore(feature-flag): Remove PublishableAPIKeys feature flag + +- [#3414](https://github.com/medusajs/medusa/pull/3414) [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa-payment-paypal): Migrate to the new payment processor API + +- [#3483](https://github.com/medusajs/medusa/pull/3483) [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): declare x-expanded-relations - Admin + +- [#3644](https://github.com/medusajs/medusa/pull/3644) [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(admin-ui): Adds metadata forms to all applicable domains in the UI. + fix(medusa): Fixes an issue where metadata was not being set for order addresses using `setMetadata`. + +- [#3435](https://github.com/medusajs/medusa/pull/3435) [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Add create-inventory-item endpoint + +- [#3670](https://github.com/medusajs/medusa/pull/3670) [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Fix(admin-ui,medusa): Ensure stock locations are created with a name + +- [#3665](https://github.com/medusajs/medusa/pull/3665) [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): draft order adjustments for mw + +- [#3686](https://github.com/medusajs/medusa/pull/3686) [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa-react): Query key invalidation + +- [#3705](https://github.com/medusajs/medusa/pull/3705) [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medusa): circular loading + +- [#3328](https://github.com/medusajs/medusa/pull/3328) [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Register reservation endpoints + Fix a type issue for get variant inventory + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3495](https://github.com/medusajs/medusa/pull/3495) [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652) Thanks [@davorbacic](https://github.com/davorbacic)! - feat(medusa): Add event emitter to ProductCollectionService + +- [#3352](https://github.com/medusajs/medusa/pull/3352) [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - feat(medusa): Modules initializer + + ### Loading modules in a project + + Example + + ```typescript + import { + InventoryServiceInitializeOptions, + initialize, + } from "@medusajs/inventory" + + const options: InventoryServiceInitializeOptions = { + database: { + type: "postgres", + url: DB_URL, + }, + } + + const inventoryService = await initialize(options) + const newInventoryItem = await inventoryService.createInventoryItem({ + sku: "sku_123", + }) + ``` + +- [#3349](https://github.com/medusajs/medusa/pull/3349) [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa): Add Lifetime support on project/plugin services + +- [#3660](https://github.com/medusajs/medusa/pull/3660) [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(admin-ui, medusa): resolve bugs for orders with variants without inventory items + +- [#3555](https://github.com/medusajs/medusa/pull/3555) [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): if no headerkey is provided when initilizing idempotency key, no attempt is made at fetching the key + +- [#3688](https://github.com/medusajs/medusa/pull/3688) [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore(medusa-cli): Add missing utils dep + +- [#3482](https://github.com/medusajs/medusa/pull/3482) [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): declare x-expanded-relations - Store + +- [#3419](https://github.com/medusajs/medusa/pull/3419) [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): Resolve on scope instead of req + +- [#3324](https://github.com/medusajs/medusa/pull/3324) [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Add filtering of stock locations based on sales channels + +- [#3460](https://github.com/medusajs/medusa/pull/3460) [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Fix(inventory, medusa): ensure no orphaned reservations and invenotry levels on location removal + +- [#3323](https://github.com/medusajs/medusa/pull/3323) [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medusa): Clean response data usage for admin and store fields/expand + +- [#3436](https://github.com/medusajs/medusa/pull/3436) [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074) Thanks [@riqwan](https://github.com/riqwan)! - feat(medusa, medusa-js, medusa-react): Add store queries to react medusa + +- [#3110](https://github.com/medusajs/medusa/pull/3110) [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85) Thanks [@StephixOne](https://github.com/StephixOne)! - feat(medusa,medusa-js,medusa-react): Add inventory module endpoints + +- [#3622](https://github.com/medusajs/medusa/pull/3622) [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore(medusa): EOL causing logging to hang + +- [#3314](https://github.com/medusajs/medusa/pull/3314) [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): include `/admin` and `/store` in paths URLs + +- [#3510](https://github.com/medusajs/medusa/pull/3510) [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-algolia): Revamp Algolia search plugin + +- [#3684](https://github.com/medusajs/medusa/pull/3684) [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): inventory stocked quantity regulation + +- [#3514](https://github.com/medusajs/medusa/pull/3514) [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): Error messages for reset tokens + +- [#3498](https://github.com/medusajs/medusa/pull/3498) [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): use get instead of indexing into map + +- [#3423](https://github.com/medusajs/medusa/pull/3423) [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): add @schema OAS for address request payloads + +- [#3653](https://github.com/medusajs/medusa/pull/3653) [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(medusa): Rounding issues on line item adjustments + +- [#2978](https://github.com/medusajs/medusa/pull/2978) [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa): Load PaymentProcessors + + - Add loading of PaymentProcessors + - Add PaymentProcessor support in the payment-provider + - Add backward compatibility for the PaymentService + +- [#3344](https://github.com/medusajs/medusa/pull/3344) [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca) Thanks [@pKorsholm](https://github.com/pKorsholm)! - Update types to reflect actual return-type + +- [#3312](https://github.com/medusajs/medusa/pull/3312) [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas): add missing x-codegen + fix schema naming and $ref + +- [#3403](https://github.com/medusajs/medusa/pull/3403) [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46) Thanks [@StephixOne](https://github.com/StephixOne)! - feat(medusa): add get-variant endpoint + +- [#3395](https://github.com/medusajs/medusa/pull/3395) [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(admin-ui, medusa): Minor ui fixes relating to stock locations + +- [#3624](https://github.com/medusajs/medusa/pull/3624) [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): Fix hanging inventory item migration script + +- [#3522](https://github.com/medusajs/medusa/pull/3522) [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52) Thanks [@pKorsholm](https://github.com/pKorsholm)! - feat(medusa,admin): location_ids in swap and claim creation + +- [#3282](https://github.com/medusajs/medusa/pull/3282) [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): identify required fields in responses - store + +- [#3334](https://github.com/medusajs/medusa/pull/3334) [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - feat(medusa,admin,admin-ui): Add new plugin to serve the admin dashboard from the server. Adds a new plugin injection step `setup`, code placed in the `setup` folder of a plugin will be run before any code from a plugin is injected into the Medusa server. + +- [#3416](https://github.com/medusajs/medusa/pull/3416) [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295) Thanks [@riqwan](https://github.com/riqwan)! - feat(medusa, admin-ui, medusa-react): Improvements to product categories + + - Adds name as required in category create form + - Adds name and handle as required in category edit form + - Updates message on create/update forms + - Adds category indicators for is_internal and is_active fields in the tree list + - Fixes bug where tree is not reset when update fails + - allow appending all category descendants with a param in list endpoint + - fix rank order changing on category update + - invalidate products query on category delete + - adds category ui for tree/list, edit, create, delete + - add product category queries and mutations + - category list API can return all descendant + - added breadcrumbs for categories on create/edit modal + - add empty state for product categories + - increase tree depth + scope categories on store + allow categories relation in products API + - categories can be ranked based on position + - seed command can create product categories + - hide categories in products behind feature flag + - fixes bug for mpath incorrectly updated for nested categories + +- [#3478](https://github.com/medusajs/medusa/pull/3478) [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas,js,react): use AdminExtendedStoresRes instead of AdminStoresRes + +- [#3377](https://github.com/medusajs/medusa/pull/3377) [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-meilisearch): Update + improve Meilisearch plugin + + **What** + + - Bumps `meilisearch` dep to latest major + - Migrates plugin to TypeScript + - Changes the way indexes are configured in `medusa-config.js`: + + **Before** + + ``` + { + resolve: `medusa-plugin-meilisearch`, + options: { + config: { host: "...", apiKey: "..." }, + settings: { + products: { + searchableAttributes: ["title"], + displayedAttributes: ["title"], + }, + }, + }, + }, + ``` + + **After** + + ``` + { + resolve: `medusa-plugin-meilisearch`, + options: { + config: { host: "...", apiKey: "..." }, + settings: { + products: { + **indexSettings**: { + searchableAttributes: ["title"], + displayedAttributes: ["title"], + }, + }, + }, + }, + }, + ``` + + This is done to allow for additional configuration of indexes, that are not necessarily passed on query-time. + + We introduce two new settings: + + ``` + settings: { + products: { + indexSettings: { + searchableAttributes: ["title"], + displayedAttributes: ["title"],, + }, + primaryKey: "id" + transformer: (document) => ({ id: "yo" }) + }, + }, + ``` + + Meilisearch changed their primary key inference in the major release. Now we must be explicit when multiple properties end with `id`. Read more in their [docs](https://docs.meilisearch.com/learn/core_concepts/primary_key.html#primary-field). + + The transformer allows developers to specify how their documents are stored in Meilisearch. It is configurable for each index. + +- [#3605](https://github.com/medusajs/medusa/pull/3605) [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Improved error message if default module is not installed + +- [#3534](https://github.com/medusajs/medusa/pull/3534) [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29) Thanks [@riqwan](https://github.com/riqwan)! - fix(medusa): fix bug with parent not being saved correctly + +- [#3288](https://github.com/medusajs/medusa/pull/3288) [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas): fix paths and fix schema names to match convention + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- [#3541](https://github.com/medusajs/medusa/pull/3541) [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa, admin-ui): refine create-fulfillment flow + +- [#3451](https://github.com/medusajs/medusa/pull/3451) [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9) Thanks [@pKorsholm](https://github.com/pKorsholm)! - feat(medusa,admin-ui): support location_id in + +- [#3411](https://github.com/medusajs/medusa/pull/3411) [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas-cli): combine admin + store + custom OAS + +- [#3278](https://github.com/medusajs/medusa/pull/3278) [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): identify required fields in responses - admin + feat(medusa): Update transaction base service to expose an activeManager\_ getter + feat(admin-ui): move customs and shipping into manage inventory modal + Feat(medusa): fulfill swaps and claims with locations + fix(medusa): Issue when ordering with multiple columns + fix(medusa): Category seeding result in non null constraint error + fix(medusa): Account for multiple inventory items when getting inventory + feat(oas): pluralize OAS tags + feat(medusa): Improve store list products + feat(admin-ui): add errors and block receiving returns dependent on existing inventory item levels + feat(medusa): invalidate price selection caching within update request + feat(medusa): remove soft delete from categories + adds indexes for categories +- Updated dependencies [[`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`cd54c7dca`](https://github.com/medusajs/medusa/commit/cd54c7dca9f7444dd2bfa91b4e3e3359dc6658cf), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - medusa-core-utils@1.2.0 + - medusa-interfaces@1.3.7 + - medusa-test-utils@1.1.40 + - @medusajs/modules-sdk@1.8.0 + - @medusajs/types@1.8.0 + - @medusajs/utils@1.8.0 + - @medusajs/medusa-cli@1.3.9 + +## 1.8.0-rc.8 + +### Patch Changes + +- [#3713](https://github.com/medusajs/medusa/pull/3713) [`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medusa): Category seeding result in non null constraint error + +## 1.8.0-rc.7 + +### Patch Changes + +- [#3665](https://github.com/medusajs/medusa/pull/3665) [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3) Thanks [@pKorsholm](https://github.com/pKorsholm)! - fix(medusa): draft order adjustments for mw + +- [#3705](https://github.com/medusajs/medusa/pull/3705) [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medusa): circular loading + ## 1.8.0-rc.6 ### Patch Changes diff --git a/packages/medusa/package.json b/packages/medusa/package.json index eec0e3a67f..9267cf5ddb 100644 --- a/packages/medusa/package.json +++ b/packages/medusa/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa", - "version": "1.8.0-rc.6", + "version": "1.8.0", "description": "E-commerce for JAMstack", "main": "dist/index.js", "bin": "./cli.js", @@ -19,13 +19,13 @@ "author": "Sebastian Rindom", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "@types/express": "^4.17.17", "@types/jsonwebtoken": "^8.5.9", "@types/multer": "^1.4.7", "cross-env": "^5.2.1", "jest": "^25.5.4", - "medusa-interfaces": "^1.3.7-rc.0", + "medusa-interfaces": "^1.3.7", "supertest": "^4.0.2", "ts-jest": "^25.5.1", "typescript": "^4.4.4" @@ -38,14 +38,14 @@ "test": "jest" }, "peerDependencies": { - "@medusajs/types": "0.0.2-rc.1", - "medusa-interfaces": "1.3.7-rc.0", + "@medusajs/types": "1.8.0", + "medusa-interfaces": "1.3.7", "typeorm": "^0.3.11" }, "dependencies": { - "@medusajs/medusa-cli": "1.3.9-rc.2", - "@medusajs/modules-sdk": "0.1.0-rc.4", - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/medusa-cli": "1.3.9", + "@medusajs/modules-sdk": "1.8.0", + "@medusajs/utils": "1.8.0", "@types/ioredis": "^4.28.10", "@types/lodash": "^4.14.191", "awilix": "^8.0.0", @@ -70,9 +70,9 @@ "iso8601-duration": "^1.3.0", "jsonwebtoken": "^8.5.1", "lodash": "^4.17.21", - "medusa-core-utils": "^1.2.0-rc.0", + "medusa-core-utils": "^1.2.0", "medusa-telemetry": "^0.0.16", - "medusa-test-utils": "^1.1.40-rc.0", + "medusa-test-utils": "^1.1.40", "morgan": "^1.9.1", "multer": "^1.4.4", "node-schedule": "^2.1.1", diff --git a/packages/medusa/src/commands/seed.ts b/packages/medusa/src/commands/seed.ts index 1d40603e08..c095744cfe 100644 --- a/packages/medusa/src/commands/seed.ts +++ b/packages/medusa/src/commands/seed.ts @@ -13,8 +13,8 @@ import Logger from "../loaders/logger" import featureFlagLoader from "../loaders/feature-flags" import { - ProductService, ProductCategoryService, + ProductService, ProductVariantService, RegionService, ShippingOptionService, @@ -22,7 +22,6 @@ import { StoreService, UserService, } from "../services" -import { ProductCategory } from "../models" import { ConfigModule } from "../types/global" import { CreateProductInput } from "../types/product" import { CreateProductCategoryInput } from "../types/product-category" @@ -234,8 +233,10 @@ const seed = async function ({ directory, migrate, seedFile }: SeedOptions) { } } - for (const c of categories) { - await createProductCategory(c, null) + if (dbType !== "sqlite") { + for (const c of categories) { + await createProductCategory(c, null) + } } }) diff --git a/packages/medusa/src/interfaces/price-selection-strategy.ts b/packages/medusa/src/interfaces/price-selection-strategy.ts index 02dacfedeb..c7b83e8c7c 100644 --- a/packages/medusa/src/interfaces/price-selection-strategy.ts +++ b/packages/medusa/src/interfaces/price-selection-strategy.ts @@ -1,5 +1,5 @@ import { EntityManager } from "typeorm" -import { MoneyAmount } from ".." +import { MoneyAmount } from "../models" import { PriceListType } from "../types/price-list" import { TaxServiceRate } from "../types/tax-service" diff --git a/packages/modules-sdk/CHANGELOG.md b/packages/modules-sdk/CHANGELOG.md index 00b4ae80bb..64852d2913 100644 --- a/packages/modules-sdk/CHANGELOG.md +++ b/packages/modules-sdk/CHANGELOG.md @@ -1,5 +1,29 @@ # @medusajs/modules-sdk +## 1.8.0 + +### Minor Changes + +- [#3329](https://github.com/medusajs/medusa/pull/3329) [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Inventory and Stock location modules supporting isolated connection + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3620](https://github.com/medusajs/medusa/pull/3620) [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Checks if dependency is registered before resolving it + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- [#3605](https://github.com/medusajs/medusa/pull/3605) [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Improved error message if default module is not installed + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Add missing changeset for @medusajs/modules-sdk + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/types@1.8.0 + - @medusajs/utils@1.8.0 + ## 0.1.0-rc.4 ### Patch Changes diff --git a/packages/modules-sdk/package.json b/packages/modules-sdk/package.json index 9d5876e35c..e44f6db006 100644 --- a/packages/modules-sdk/package.json +++ b/packages/modules-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/modules-sdk", - "version": "0.1.0-rc.4", + "version": "1.8.0", "description": "SDK for medusa modules", "main": "dist/index.js", "repository": { @@ -23,8 +23,8 @@ "typescript": "^4.4.4" }, "dependencies": { - "@medusajs/types": "0.0.2-rc.1", - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/types": "1.8.0", + "@medusajs/utils": "1.8.0", "awilix": "^8.0.0", "glob": "7.1.6", "medusa-telemetry": "^0.0.16", diff --git a/packages/oas/medusa-oas-cli/CHANGELOG.md b/packages/oas/medusa-oas-cli/CHANGELOG.md index 1467318753..e023c4f33a 100644 --- a/packages/oas/medusa-oas-cli/CHANGELOG.md +++ b/packages/oas/medusa-oas-cli/CHANGELOG.md @@ -1,5 +1,39 @@ # @medusajs/oas-cli +## 0.2.0 + +### Minor Changes + +- [#3411](https://github.com/medusajs/medusa/pull/3411) [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas-cli): combine admin + store + custom OAS + +### Patch Changes + +- [#3213](https://github.com/medusajs/medusa/pull/3213) [`813706190`](https://github.com/medusajs/medusa/commit/8137061908d20314314b95d049b966a624e7123d) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas): medusa-oas-cli as OAS build tool + +- [#3631](https://github.com/medusajs/medusa/pull/3631) [`377b9ce8c`](https://github.com/medusajs/medusa/commit/377b9ce8c27cb2c4d10d154c005c7553c173c0e8) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas:test): fix beforeAll timeout silent failure + +- [#3272](https://github.com/medusajs/medusa/pull/3272) [`1c40346e9`](https://github.com/medusajs/medusa/commit/1c40346e9e56718de4a6e2d5c2d52abd388343e3) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(codegen): openapi-typescript-codegen fork + +- [#3559](https://github.com/medusajs/medusa/pull/3559) [`53c4a43ca`](https://github.com/medusajs/medusa/commit/53c4a43ca2b2c04920dc6f38e07348e7dfc23195) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(oas:cli): output better error when no command is provided + +- Updated dependencies [[`d6b1ad1cc`](https://github.com/medusajs/medusa/commit/d6b1ad1ccd9a8f91b169f30ff99492cf3adcccac), [`e143a8697`](https://github.com/medusajs/medusa/commit/e143a86976a5cc6a53b7a795e8486df4db1d1c09), [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724), [`84e448968`](https://github.com/medusajs/medusa/commit/84e44896836b2c44017572ac5192ab1cd937048c), [`33c6ccf05`](https://github.com/medusajs/medusa/commit/33c6ccf0591b8ef527f3b10a70b51e29751b4998), [`788ddc0f4`](https://github.com/medusajs/medusa/commit/788ddc0f43696df607f07133af15a04b29d5447d), [`5fd74b38a`](https://github.com/medusajs/medusa/commit/5fd74b38ae1b4f7dced191983b78db83f7b1f71b), [`30a320364`](https://github.com/medusajs/medusa/commit/30a3203640be9993ba2f8447abfdecc0d3e2f9b6), [`240d0ea7b`](https://github.com/medusajs/medusa/commit/240d0ea7b88ff494d0fe28c7c5348e958c14571f), [`6c0462472`](https://github.com/medusajs/medusa/commit/6c046247275c46d934f03d53471bdd555a19a9ad), [`589d1c09b`](https://github.com/medusajs/medusa/commit/589d1c09b085dcaf9667061201ac9deff3047466), [`0695ff642`](https://github.com/medusajs/medusa/commit/0695ff642b5836e7c28d40118aafe7a769023d5a), [`530740889`](https://github.com/medusajs/medusa/commit/53074088941719ac7ca435e76e3e64ba23fac200), [`13f40d721`](https://github.com/medusajs/medusa/commit/13f40d721702fbcdf6c131354ec9a81322d4a662), [`4342ac884`](https://github.com/medusajs/medusa/commit/4342ac884bc3fe473576ef10d291f3547e0ffc62), [`fe9eea4c1`](https://github.com/medusajs/medusa/commit/fe9eea4c18b7e04ba91660716c92b11a49840a3c), [`a5ad6c054`](https://github.com/medusajs/medusa/commit/a5ad6c05428e1bb090bbc5a51345a00821781c06), [`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`7f87c4f2c`](https://github.com/medusajs/medusa/commit/7f87c4f2c8abb876213a595005e67d770be9cbe4), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24), [`0a02b70e5`](https://github.com/medusajs/medusa/commit/0a02b70e59cfbd8888fb58c29ee9aaf96eb8099a), [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`fe4b8feb7`](https://github.com/medusajs/medusa/commit/fe4b8feb7e0af2ffc436ca77a769ecb37e16e652), [`aa690beed`](https://github.com/medusajs/medusa/commit/aa690beed775646cbc86b445fb5dc90dcac087d5), [`5eb61fa0e`](https://github.com/medusajs/medusa/commit/5eb61fa0ef991b8a9fabb16c2c159e51b9541867), [`f033711ad`](https://github.com/medusajs/medusa/commit/f033711ad649466d72dd9f673d75848c97c0861f), [`eed784d7d`](https://github.com/medusajs/medusa/commit/eed784d7d0b58aeddc9f6f5ea56fe80c608b22f5), [`3171b0e51`](https://github.com/medusajs/medusa/commit/3171b0e518aebcaa31bbe5c6e914d65282873cda), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`522e306e2`](https://github.com/medusajs/medusa/commit/522e306e2e9abf4afce63f30714389eba32bef7f), [`80b95a230`](https://github.com/medusajs/medusa/commit/80b95a230056d9ed15f7302f248094f879516faf), [`a1e59313c`](https://github.com/medusajs/medusa/commit/a1e59313c964a944a287b54f6654d1d19ac8a59b), [`10bf05c14`](https://github.com/medusajs/medusa/commit/10bf05c147cb65a263465129790edd44a6d8948b), [`cbbf3ca05`](https://github.com/medusajs/medusa/commit/cbbf3ca054387a900c5777c2eb0218df2c72bae6), [`9ba09ba4d`](https://github.com/medusajs/medusa/commit/9ba09ba4d753f132537f0447097fe9f54922c074), [`12d304307`](https://github.com/medusajs/medusa/commit/12d304307af87ea9287a41869eb33ef09f273d85), [`693015fde`](https://github.com/medusajs/medusa/commit/693015fde3218d67fb9c07eebeaea9950bf3f1f1), [`287c829c9`](https://github.com/medusajs/medusa/commit/287c829c9c5a9797fb8cd118b7a6066ad1935898), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`0cca13779`](https://github.com/medusajs/medusa/commit/0cca13779d0e84683193ad82ab163a10a807e903), [`aed7805c0`](https://github.com/medusajs/medusa/commit/aed7805c0e64b884007148bde90cfce7bee8aad4), [`e359d3f85`](https://github.com/medusajs/medusa/commit/e359d3f85bc12fd3868fc4b563cd994366e899dd), [`0d1b63d77`](https://github.com/medusajs/medusa/commit/0d1b63d773ad91846757a6f0b81b78b0b97b3f2b), [`4042beb10`](https://github.com/medusajs/medusa/commit/4042beb1026b9ad8b381aaa6e1a5214cd92db00f), [`809ab2e0e`](https://github.com/medusajs/medusa/commit/809ab2e0eb2d62054481fa6491d3f7cafbadab4f), [`f43e9f0f2`](https://github.com/medusajs/medusa/commit/f43e9f0f20a8b0637252951b2bdfed4d42fb9f5e), [`842423679`](https://github.com/medusajs/medusa/commit/8424236799c3789f884285cd3c8a491e91aef2ca), [`935870e01`](https://github.com/medusajs/medusa/commit/935870e010af1ec884259b1f1328421e99acc3af), [`826d4bedf`](https://github.com/medusajs/medusa/commit/826d4bedfe1b6459163711d5173eb8eadfdea26e), [`57d7728dd`](https://github.com/medusajs/medusa/commit/57d7728dd9d00df712e1a872899b8397955dfe46), [`15f47baf5`](https://github.com/medusajs/medusa/commit/15f47baf56e6722b7821cfaa2fb468e582dfa2c1), [`1c40346e9`](https://github.com/medusajs/medusa/commit/1c40346e9e56718de4a6e2d5c2d52abd388343e3), [`999aeb116`](https://github.com/medusajs/medusa/commit/999aeb116c4742e5b5e0d80793af23f7727276f0), [`55c5fba0d`](https://github.com/medusajs/medusa/commit/55c5fba0d3dbd015c3ffd74d645a8057892d0f52), [`38503fff5`](https://github.com/medusajs/medusa/commit/38503fff56bbceb092e396ac11432a56967b53e9), [`5e405be02`](https://github.com/medusajs/medusa/commit/5e405be02cc94779222dc3d930e747027496d918), [`40de54b01`](https://github.com/medusajs/medusa/commit/40de54b0101bdfd37f577d18c10ec9f1ab1ce8fe), [`54dcc1871`](https://github.com/medusajs/medusa/commit/54dcc1871c8f28bea962dbb9df6e79b038d56449), [`478d1af8d`](https://github.com/medusajs/medusa/commit/478d1af8d0df0af16baf4f130e19b0be34f5f295), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`6748877c6`](https://github.com/medusajs/medusa/commit/6748877c694c1433f666c6987f20af76b201b495), [`7e17e0ddc`](https://github.com/medusajs/medusa/commit/7e17e0ddc2e6b2891e9ee1420b04a541899d2a9d), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`7f2223b65`](https://github.com/medusajs/medusa/commit/7f2223b6507b0a3c452977bfcdee92af2086fa29), [`7b57695e0`](https://github.com/medusajs/medusa/commit/7b57695e00433e1d54f8cdc912ef7e5f28fc1071), [`7d585f5f8`](https://github.com/medusajs/medusa/commit/7d585f5f84a910c02d274df7a489dc3ff1ea273a), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def), [`ef5ef9f5a`](https://github.com/medusajs/medusa/commit/ef5ef9f5a26febf0b64d9981606c1e59999ca76e), [`feaf8d2e1`](https://github.com/medusajs/medusa/commit/feaf8d2e19715585d154464d003759c3a1f4f322), [`f97b3d7cc`](https://github.com/medusajs/medusa/commit/f97b3d7ccee381d3491337ab5144bb44520382a7), [`55a1f232a`](https://github.com/medusajs/medusa/commit/55a1f232a3746a22adb1fcd1844b2659077a59f9), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38), [`48ad2426a`](https://github.com/medusajs/medusa/commit/48ad2426aa7a604c226132e85ef3da5cce045f45)]: + - @medusajs/medusa@1.8.0 + - @medusajs/openapi-typescript-codegen@0.2.0 + +## 0.2.0-rc.8 + +### Patch Changes + +- Updated dependencies [[`4488ec685`](https://github.com/medusajs/medusa/commit/4488ec68524f95f367cbd352e9e5eb1957d1d0d6)]: + - @medusajs/medusa@1.8.0-rc.8 + +## 0.2.0-rc.7 + +### Patch Changes + +- Updated dependencies [[`748833383`](https://github.com/medusajs/medusa/commit/748833383f4bafd05109dac7afa1286fe851cba3), [`e5a2e9c8d`](https://github.com/medusajs/medusa/commit/e5a2e9c8d237bbe4e3563f5a7a892ca41f01ba24)]: + - @medusajs/medusa@1.8.0-rc.7 + ## 0.2.0-rc.6 ### Patch Changes diff --git a/packages/oas/medusa-oas-cli/package.json b/packages/oas/medusa-oas-cli/package.json index 59edb5dd1f..ab4c6c030a 100644 --- a/packages/oas/medusa-oas-cli/package.json +++ b/packages/oas/medusa-oas-cli/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa-oas-cli", - "version": "0.2.0-rc.6", + "version": "0.2.0", "description": "OAS CLI", "main": "dist/index.js", "bin": { @@ -35,8 +35,8 @@ "test": "jest src" }, "dependencies": { - "@medusajs/medusa": "1.8.0-rc.6", - "@medusajs/openapi-typescript-codegen": "0.2.0-rc.0", + "@medusajs/medusa": "1.8.0", + "@medusajs/openapi-typescript-codegen": "0.2.0", "@readme/openapi-parser": "^2.4.0", "@types/lodash": "^4.14.191", "commander": "^10.0.0", diff --git a/packages/oas/oas-github-ci/CHANGELOG.md b/packages/oas/oas-github-ci/CHANGELOG.md index f28107f9f3..eefa058186 100644 --- a/packages/oas/oas-github-ci/CHANGELOG.md +++ b/packages/oas/oas-github-ci/CHANGELOG.md @@ -1,5 +1,28 @@ # @medusajs/oas-github-ci +## 1.0.1 + +### Patch Changes + +- [#3410](https://github.com/medusajs/medusa/pull/3410) [`8ed67d2d7`](https://github.com/medusajs/medusa/commit/8ed67d2d7d36da2d0cb3541e42bba1770aefc60a) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(admin,oas-github-cli): Change public config to private to avoid publishing attempts + include `setup/` in npm release for `admin-ui` + +- Updated dependencies [[`813706190`](https://github.com/medusajs/medusa/commit/8137061908d20314314b95d049b966a624e7123d), [`377b9ce8c`](https://github.com/medusajs/medusa/commit/377b9ce8c27cb2c4d10d154c005c7553c173c0e8), [`1c40346e9`](https://github.com/medusajs/medusa/commit/1c40346e9e56718de4a6e2d5c2d52abd388343e3), [`53c4a43ca`](https://github.com/medusajs/medusa/commit/53c4a43ca2b2c04920dc6f38e07348e7dfc23195), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38)]: + - @medusajs/medusa-oas-cli@0.2.0 + +## 1.0.1-rc.8 + +### Patch Changes + +- Updated dependencies []: + - @medusajs/medusa-oas-cli@0.2.0-rc.8 + +## 1.0.1-rc.7 + +### Patch Changes + +- Updated dependencies []: + - @medusajs/medusa-oas-cli@0.2.0-rc.7 + ## 1.0.1-rc.6 ### Patch Changes diff --git a/packages/oas/oas-github-ci/package.json b/packages/oas/oas-github-ci/package.json index 3978858bc0..17005e08dd 100644 --- a/packages/oas/oas-github-ci/package.json +++ b/packages/oas/oas-github-ci/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/oas-github-ci", - "version": "1.0.1-rc.6", + "version": "1.0.1", "description": "OAS Github CI", "main": "scripts/build-openapi.js", "files": [ @@ -21,7 +21,7 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@medusajs/medusa-oas-cli": "0.2.0-rc.6", + "@medusajs/medusa-oas-cli": "0.2.0", "@readme/openapi-parser": "^2.4.0", "@redocly/cli": "1.0.0-beta.123", "execa": "^5.1.1", diff --git a/packages/oas/openapi-typescript-codegen/CHANGELOG.md b/packages/oas/openapi-typescript-codegen/CHANGELOG.md index 5ace051269..4d9241c751 100644 --- a/packages/oas/openapi-typescript-codegen/CHANGELOG.md +++ b/packages/oas/openapi-typescript-codegen/CHANGELOG.md @@ -1,5 +1,17 @@ # @medusajs/openapi-typescript-codegen +## 0.2.0 + +### Minor Changes + +- [#3477](https://github.com/medusajs/medusa/pull/3477) [`826d4bedf`](https://github.com/medusajs/medusa/commit/826d4bedfe1b6459163711d5173eb8eadfdea26e) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(codegen,types): SetRelation on expanded types + +- [#3442](https://github.com/medusajs/medusa/pull/3442) [`7b57695e0`](https://github.com/medusajs/medusa/commit/7b57695e00433e1d54f8cdc912ef7e5f28fc1071) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(codegen): x-expanded-relations + +### Patch Changes + +- [#3272](https://github.com/medusajs/medusa/pull/3272) [`1c40346e9`](https://github.com/medusajs/medusa/commit/1c40346e9e56718de4a6e2d5c2d52abd388343e3) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(codegen): openapi-typescript-codegen fork + ## 0.2.0-rc.0 ### Minor Changes diff --git a/packages/oas/openapi-typescript-codegen/package.json b/packages/oas/openapi-typescript-codegen/package.json index 989673dfea..55ba5530c8 100644 --- a/packages/oas/openapi-typescript-codegen/package.json +++ b/packages/oas/openapi-typescript-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/openapi-typescript-codegen", - "version": "0.2.0-rc.0", + "version": "0.2.0", "description": "Library that generates Typescript clients based on the OpenAPI specification.", "main": "dist/index.js", "types": "types/index.d.ts", diff --git a/packages/stock-location/CHANGELOG.md b/packages/stock-location/CHANGELOG.md index d6a3a7e54f..a17d7eb018 100644 --- a/packages/stock-location/CHANGELOG.md +++ b/packages/stock-location/CHANGELOG.md @@ -1,5 +1,28 @@ # @medusajs/stock-location +## 1.8.0 + +### Minor Changes + +- [#3329](https://github.com/medusajs/medusa/pull/3329) [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Inventory and Stock location modules supporting isolated connection + +### Patch Changes + +- [#3041](https://github.com/medusajs/medusa/pull/3041) [`121b42acf`](https://github.com/medusajs/medusa/commit/121b42acfe98c12dd593f9b1f2072ff0f3b61724) Thanks [@riqwan](https://github.com/riqwan)! - chore(medusa): Typeorm fixes / enhancements + + - upgrade typeorm from 0.2.51 to 0.3.11 + - Plugin repository loader to work with Typeorm update + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3649](https://github.com/medusajs/medusa/pull/3649) [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Export initialize method for all modules + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + +- Updated dependencies [[`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4), [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38), [`55e94d0b4`](https://github.com/medusajs/medusa/commit/55e94d0b45776776639d3970d4264b8f5c5385dd), [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb), [`bd12a9508`](https://github.com/medusajs/medusa/commit/bd12a95083b69a70b83ad38578c5a68738c41b2b), [`77d46220c`](https://github.com/medusajs/medusa/commit/77d46220c23bfe19e575cbc445874eb6c22f3c73), [`bca1f80dd`](https://github.com/medusajs/medusa/commit/bca1f80dd501d878455e1ad4f5091cf20ef900ea), [`271844aed`](https://github.com/medusajs/medusa/commit/271844aedbe45c369e188b5d06458dbd6984cd39), [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def)]: + - @medusajs/modules-sdk@1.8.0 + - @medusajs/utils@1.8.0 + ## 1.8.0-rc.3 ### Patch Changes diff --git a/packages/stock-location/package.json b/packages/stock-location/package.json index 7eeaf0b64d..8479cd5a00 100644 --- a/packages/stock-location/package.json +++ b/packages/stock-location/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/stock-location", - "version": "1.8.0-rc.3", + "version": "1.8.0", "description": "Stock Location Module for Medusa", "main": "dist/index.js", "repository": { @@ -17,15 +17,15 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "cross-env": "^5.2.1", "jest": "^25.5.4", "ts-jest": "^25.5.1", "typescript": "^4.4.4" }, "dependencies": { - "@medusajs/modules-sdk": "0.1.0-rc.4", - "@medusajs/utils": "0.0.2-rc.2", + "@medusajs/modules-sdk": "1.8.0", + "@medusajs/utils": "1.8.0", "awilix": "^8.0.0", "typeorm": "^0.3.11" }, diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index faf081bfaa..c0a0e69e6c 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,15 @@ # @medusajs/types +## 1.8.0 + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3510](https://github.com/medusajs/medusa/pull/3510) [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-algolia): Revamp Algolia search plugin + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + ## 0.0.2-rc.1 ### Patch Changes diff --git a/packages/types/package.json b/packages/types/package.json index 24efa82429..ff49166f33 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/types", - "version": "0.0.2-rc.1", + "version": "1.8.0", "description": "Medusa Types definition", "main": "dist/index.js", "repository": { diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index c8f45e3cbf..b3064302e0 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,17 @@ # @medusajs/utils +## 1.8.0 + +### Patch Changes + +- [#3685](https://github.com/medusajs/medusa/pull/3685) [`8ddb3952c`](https://github.com/medusajs/medusa/commit/8ddb3952c045e6c05c8d0f6922f0d4ba30cf3bd4) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Fix RC package versions + +- [#3688](https://github.com/medusajs/medusa/pull/3688) [`a0c919a8d`](https://github.com/medusajs/medusa/commit/a0c919a8d01ca5edf62336de48e9a112e3822f38) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore(medusa-cli): Add missing utils dep + +- [#3510](https://github.com/medusajs/medusa/pull/3510) [`74bc4b16a`](https://github.com/medusajs/medusa/commit/74bc4b16a07f78668003ca930bf2a0d928897ceb) Thanks [@olivermrbl](https://github.com/olivermrbl)! - feat(medusa-plugin-algolia): Revamp Algolia search plugin + +- [#3531](https://github.com/medusajs/medusa/pull/3531) [`4e9d257d3`](https://github.com/medusajs/medusa/commit/4e9d257d3bf76703ef5be8ca054cc9f0f7339def) Thanks [@carlos-r-l-rodrigues](https://github.com/carlos-r-l-rodrigues)! - Remove dependency on @medusajs/medusa from Inventory and Stock-Location Modules + ## 0.0.2-rc.2 ### Patch Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index eaef7168a6..9224b25933 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/utils", - "version": "0.0.2-rc.2", + "version": "1.8.0", "description": "Medusa utilities functions shared by Medusa core and Modules", "main": "dist/index.js", "repository": { @@ -17,7 +17,7 @@ "author": "Medusa", "license": "MIT", "devDependencies": { - "@medusajs/types": "0.0.2-rc.1", + "@medusajs/types": "1.8.0", "@types/express": "^4.17.17", "cross-env": "^5.2.1", "jest": "^25.5.4", diff --git a/www/docs/announcement.json b/www/docs/announcement.json index f5f95e2dc7..7bef67f4b6 100644 --- a/www/docs/announcement.json +++ b/www/docs/announcement.json @@ -1 +1 @@ -{"id":"https://github.com/medusajs/medusa/releases/tag/v1.7.15","content":"v1.7.15 is out","isCloseable":true} +{"id":"https://github.com/medusajs/medusa/releases/tag/v1.8.0","content":"v1.8.0 is out","isCloseable":true} \ No newline at end of file diff --git a/www/docs/static/img/docs-banner.jpg b/www/docs/static/img/docs-banner.jpg index 95df4f4074..3be9ea2ce0 100644 Binary files a/www/docs/static/img/docs-banner.jpg and b/www/docs/static/img/docs-banner.jpg differ diff --git a/yarn.lock b/yarn.lock index ba5e994546..6a1f99e91c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5606,13 +5606,13 @@ __metadata: languageName: node linkType: hard -"@medusajs/admin-ui@0.0.1-rc.6, @medusajs/admin-ui@workspace:packages/admin-ui": +"@medusajs/admin-ui@1.8.0, @medusajs/admin-ui@workspace:packages/admin-ui": version: 0.0.0-use.local resolution: "@medusajs/admin-ui@workspace:packages/admin-ui" dependencies: "@hookform/error-message": ^2.0.1 - "@medusajs/medusa": 1.8.0-rc.6 - "@medusajs/types": 0.0.2-rc.1 + "@medusajs/medusa": 1.8.0 + "@medusajs/types": 1.8.0 "@radix-ui/react-accordion": ^1.0.1 "@radix-ui/react-avatar": ^1.0.1 "@radix-ui/react-collapsible": ^1.0.1 @@ -5642,7 +5642,7 @@ __metadata: copy-to-clipboard: ^3.3.1 emoji-picker-react: ^4.4.3 framer-motion: ^9.1.6 - medusa-react: 5.0.0-rc.6 + medusa-react: 5.0.0 moment: ^2.29.4 pluralize: ^8.0.0 postcss: ^8.4.21 @@ -5679,30 +5679,30 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/admin@workspace:packages/admin" dependencies: - "@medusajs/admin-ui": 0.0.1-rc.6 + "@medusajs/admin-ui": 1.8.0 "@types/express": ^4.17.13 commander: ^10.0.0 dotenv: ^16.0.3 express: ^4.17.1 fs-extra: ^11.1.0 - medusa-core-utils: 1.2.0-rc.0 + medusa-core-utils: 1.2.0 ora: 5.4.0 picocolors: ^1.0.0 ts-dedent: ^2.2.0 typescript: ^4.9.3 peerDependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 bin: medusa-admin: ./bin/medusa-admin.js languageName: unknown linkType: soft -"@medusajs/cache-inmemory@1.8.0-rc.3, @medusajs/cache-inmemory@workspace:packages/cache-inmemory": +"@medusajs/cache-inmemory@1.8.0, @medusajs/cache-inmemory@workspace:packages/cache-inmemory": version: 0.0.0-use.local resolution: "@medusajs/cache-inmemory@workspace:packages/cache-inmemory" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 cross-env: ^5.2.1 jest: ^25.5.4 ts-jest: ^25.5.1 @@ -5714,8 +5714,8 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/cache-redis@workspace:packages/cache-redis" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 awilix: ^8.0.0 cross-env: ^5.2.1 ioredis: ^5.3.1 @@ -5729,7 +5729,7 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/client-types@workspace:packages/generated/client-types" dependencies: - "@medusajs/medusa-oas-cli": 0.2.0-rc.6 + "@medusajs/medusa-oas-cli": 0.2.0 cross-env: ^7.0.3 execa: ^5.1.1 jest: ^27.4.7 @@ -5739,13 +5739,13 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/event-bus-local@1.8.0-rc.4, @medusajs/event-bus-local@workspace:packages/event-bus-local": +"@medusajs/event-bus-local@1.8.0, @medusajs/event-bus-local@workspace:packages/event-bus-local": version: 0.0.0-use.local resolution: "@medusajs/event-bus-local@workspace:packages/event-bus-local" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 cross-env: ^5.2.1 jest: ^25.5.2 ts-jest: ^25.5.1 @@ -5757,15 +5757,15 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/event-bus-redis@workspace:packages/event-bus-redis" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 awilix: ^8.0.0 bullmq: ^3.5.6 cross-env: ^5.2.1 ioredis: ^5.2.5 jest: ^25.5.2 - medusa-test-utils: ^1.1.40-rc.0 + medusa-test-utils: ^1.1.40 ts-jest: ^25.5.1 typescript: ^4.4.4 languageName: unknown @@ -5775,9 +5775,9 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/inventory@workspace:packages/inventory" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 awilix: ^8.0.0 cross-env: ^5.2.1 jest: ^25.5.4 @@ -5787,7 +5787,7 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/medusa-cli@1.3.9-rc.2, @medusajs/medusa-cli@workspace:packages/medusa-cli": +"@medusajs/medusa-cli@1.3.9, @medusajs/medusa-cli@workspace:packages/medusa-cli": version: 0.0.0-use.local resolution: "@medusajs/medusa-cli@workspace:packages/medusa-cli" dependencies: @@ -5796,7 +5796,7 @@ __metadata: "@babel/plugin-proposal-class-properties": ^7.7.4 "@babel/plugin-transform-runtime": ^7.7.6 "@babel/preset-env": ^7.7.5 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/utils": 1.8.0 axios: ^0.21.4 chalk: ^4.0.0 configstore: 5.0.1 @@ -5811,7 +5811,7 @@ __metadata: is-valid-path: ^0.1.1 jest: ^25.5.4 meant: ^1.0.3 - medusa-core-utils: ^1.2.0-rc.0 + medusa-core-utils: ^1.2.0 medusa-telemetry: 0.0.16 open: ^8.0.6 ora: ^5.4.1 @@ -5831,11 +5831,11 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/medusa-js@^2.0.0-rc.6, @medusajs/medusa-js@workspace:packages/medusa-js": +"@medusajs/medusa-js@2.0.0, @medusajs/medusa-js@workspace:packages/medusa-js": version: 0.0.0-use.local resolution: "@medusajs/medusa-js@workspace:packages/medusa-js" dependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 "@types/uuid": ^9.0.0 axios: ^0.24.0 cross-env: ^7.0.3 @@ -5847,16 +5847,16 @@ __metadata: typescript: ^4.9.5 uuid: ^9.0.0 peerDependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 languageName: unknown linkType: soft -"@medusajs/medusa-oas-cli@0.2.0-rc.6, @medusajs/medusa-oas-cli@workspace:packages/oas/medusa-oas-cli": +"@medusajs/medusa-oas-cli@0.2.0, @medusajs/medusa-oas-cli@workspace:packages/oas/medusa-oas-cli": version: 0.0.0-use.local resolution: "@medusajs/medusa-oas-cli@workspace:packages/oas/medusa-oas-cli" dependencies: - "@medusajs/medusa": 1.8.0-rc.6 - "@medusajs/openapi-typescript-codegen": 0.2.0-rc.0 + "@medusajs/medusa": 1.8.0 + "@medusajs/openapi-typescript-codegen": 0.2.0 "@readme/openapi-parser": ^2.4.0 "@types/lodash": ^4.14.191 commander: ^10.0.0 @@ -5874,14 +5874,14 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/medusa@1.8.0-rc.6, @medusajs/medusa@workspace:packages/medusa": +"@medusajs/medusa@1.8.0, @medusajs/medusa@workspace:packages/medusa": version: 0.0.0-use.local resolution: "@medusajs/medusa@workspace:packages/medusa" dependencies: - "@medusajs/medusa-cli": 1.3.9-rc.2 - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/medusa-cli": 1.3.9 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 "@types/express": ^4.17.17 "@types/ioredis": ^4.28.10 "@types/jsonwebtoken": ^8.5.9 @@ -5911,10 +5911,10 @@ __metadata: jest: ^25.5.4 jsonwebtoken: ^8.5.1 lodash: ^4.17.21 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 medusa-telemetry: ^0.0.16 - medusa-test-utils: ^1.1.40-rc.0 + medusa-test-utils: ^1.1.40 morgan: ^1.9.1 multer: ^1.4.4 node-schedule: ^2.1.1 @@ -5936,20 +5936,20 @@ __metadata: uuid: ^8.3.2 winston: ^3.8.2 peerDependencies: - "@medusajs/types": 0.0.2-rc.1 - medusa-interfaces: 1.3.7-rc.0 + "@medusajs/types": 1.8.0 + medusa-interfaces: 1.3.7 typeorm: ^0.3.11 bin: medusa: ./cli.js languageName: unknown linkType: soft -"@medusajs/modules-sdk@0.1.0-rc.4, @medusajs/modules-sdk@workspace:packages/modules-sdk": +"@medusajs/modules-sdk@1.8.0, @medusajs/modules-sdk@workspace:packages/modules-sdk": version: 0.0.0-use.local resolution: "@medusajs/modules-sdk@workspace:packages/modules-sdk" dependencies: - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 awilix: ^8.0.0 cross-env: ^5.2.1 glob: 7.1.6 @@ -5965,7 +5965,7 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/oas-github-ci@workspace:packages/oas/oas-github-ci" dependencies: - "@medusajs/medusa-oas-cli": 0.2.0-rc.6 + "@medusajs/medusa-oas-cli": 0.2.0 "@readme/openapi-parser": ^2.4.0 "@redocly/cli": 1.0.0-beta.123 execa: ^5.1.1 @@ -5973,7 +5973,7 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/openapi-typescript-codegen@0.2.0-rc.0, @medusajs/openapi-typescript-codegen@workspace:packages/oas/openapi-typescript-codegen": +"@medusajs/openapi-typescript-codegen@0.2.0, @medusajs/openapi-typescript-codegen@workspace:packages/oas/openapi-typescript-codegen": version: 0.0.0-use.local resolution: "@medusajs/openapi-typescript-codegen@workspace:packages/oas/openapi-typescript-codegen" dependencies: @@ -6014,9 +6014,9 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/stock-location@workspace:packages/stock-location" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 awilix: ^8.0.0 cross-env: ^5.2.1 jest: ^25.5.4 @@ -6026,7 +6026,7 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/types@0.0.2-rc.1, @medusajs/types@workspace:packages/types": +"@medusajs/types@1.8.0, @medusajs/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@medusajs/types@workspace:packages/types" dependencies: @@ -6038,11 +6038,11 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/utils@0.0.2-rc.2, @medusajs/utils@workspace:packages/utils": +"@medusajs/utils@1.8.0, @medusajs/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@medusajs/utils@workspace:packages/utils" dependencies: - "@medusajs/types": 0.0.2-rc.1 + "@medusajs/types": 1.8.0 "@types/express": ^4.17.17 awilix: ^8.0.0 class-transformer: ^0.5.1 @@ -23351,14 +23351,14 @@ __metadata: "@babel/cli": ^7.12.10 "@babel/core": ^7.12.10 "@babel/node": ^7.12.10 - "@medusajs/cache-inmemory": 1.8.0-rc.3 - "@medusajs/event-bus-local": 1.8.0-rc.4 - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/cache-inmemory": 1.8.0 + "@medusajs/event-bus-local": 1.8.0 + "@medusajs/medusa": 1.8.0 babel-preset-medusa-package: "*" faker: ^5.5.3 jest: ^26.6.3 jest-environment-node: 26.6.2 - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 typeorm: ^0.3.11 languageName: unknown linkType: soft @@ -23370,16 +23370,16 @@ __metadata: "@babel/cli": ^7.12.10 "@babel/core": ^7.12.10 "@babel/node": ^7.12.10 - "@medusajs/cache-inmemory": 1.8.0-rc.3 - "@medusajs/event-bus-local": 1.8.0-rc.4 - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/cache-inmemory": 1.8.0 + "@medusajs/event-bus-local": 1.8.0 + "@medusajs/medusa": 1.8.0 babel-preset-medusa-package: "*" faker: ^5.5.3 jest: ^26.6.3 jest-environment-node: 26.6.2 - medusa-fulfillment-webshipper: 1.3.8-rc.1 - medusa-interfaces: 1.3.7-rc.0 - medusa-plugin-sendgrid: 1.3.8-rc.0 + medusa-fulfillment-webshipper: 1.3.8 + medusa-interfaces: 1.3.7 + medusa-plugin-sendgrid: 1.3.8 typeorm: ^0.3.11 languageName: unknown linkType: soft @@ -23391,11 +23391,11 @@ __metadata: "@babel/cli": ^7.12.10 "@babel/core": ^7.12.10 "@babel/node": ^7.12.10 - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 babel-preset-medusa-package: "*" jest: ^26.6.3 jest-environment-node: 26.6.2 - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 typeorm: ^0.3.11 languageName: unknown linkType: soft @@ -28272,7 +28272,7 @@ __metadata: languageName: node linkType: hard -"medusa-core-utils@1.2.0-rc.0, medusa-core-utils@^1.2.0-rc.0, medusa-core-utils@workspace:packages/medusa-core-utils": +"medusa-core-utils@1.2.0, medusa-core-utils@^1.2.0, medusa-core-utils@workspace:packages/medusa-core-utils": version: 0.0.0-use.local resolution: "medusa-core-utils@workspace:packages/medusa-core-utils" dependencies: @@ -28331,11 +28331,11 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28359,11 +28359,11 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28387,12 +28387,12 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 stripe: ^8.50.0 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28412,14 +28412,14 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft -"medusa-fulfillment-webshipper@1.3.8-rc.1, medusa-fulfillment-webshipper@workspace:packages/medusa-fulfillment-webshipper": +"medusa-fulfillment-webshipper@1.3.8, medusa-fulfillment-webshipper@workspace:packages/medusa-fulfillment-webshipper": version: 0.0.0-use.local resolution: "medusa-fulfillment-webshipper@workspace:packages/medusa-fulfillment-webshipper" dependencies: @@ -28430,7 +28430,7 @@ __metadata: "@babel/plugin-transform-runtime": ^7.7.6 "@babel/preset-env": ^7.7.5 "@babel/runtime": ^7.9.6 - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 axios: ^0.20.0 body-parser: ^1.19.0 client-sessions: ^0.8.0 @@ -28438,14 +28438,14 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft -"medusa-interfaces@1.3.7-rc.0, medusa-interfaces@^1.3.7-rc.0, medusa-interfaces@workspace:packages/medusa-interfaces": +"medusa-interfaces@1.3.7, medusa-interfaces@^1.3.7, medusa-interfaces@workspace:packages/medusa-interfaces": version: 0.0.0-use.local resolution: "medusa-interfaces@workspace:packages/medusa-interfaces" dependencies: @@ -28460,8 +28460,8 @@ __metadata: "@babel/runtime": ^7.9.6 cross-env: ^5.2.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-test-utils: ^1.1.40 typescript: ^4.4.4 languageName: unknown linkType: soft @@ -28488,11 +28488,11 @@ __metadata: cross-env: ^7.0.3 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28517,11 +28517,11 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28542,10 +28542,10 @@ __metadata: "@babel/runtime": ^7.9.6 cross-env: ^5.2.1 jest: ^25.5.4 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28553,7 +28553,7 @@ __metadata: version: 0.0.0-use.local resolution: "medusa-payment-paypal@workspace:packages/medusa-payment-paypal" dependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 "@paypal/checkout-server-sdk": ^1.0.3 "@types/stripe": ^8.0.417 axios: ^1.3.4 @@ -28561,10 +28561,10 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 + medusa-core-utils: ^1.2.0 typescript: ^4.4.4 peerDependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 languageName: unknown linkType: soft @@ -28572,17 +28572,17 @@ __metadata: version: 0.0.0-use.local resolution: "medusa-payment-stripe@workspace:packages/medusa-payment-stripe" dependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 "@types/stripe": ^8.0.417 body-parser: ^1.19.0 cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 + medusa-core-utils: ^1.2.0 stripe: ^11.10.0 typescript: ^4.9.5 peerDependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 languageName: unknown linkType: soft @@ -28590,9 +28590,9 @@ __metadata: version: 0.0.0-use.local resolution: "medusa-plugin-algolia@workspace:packages/medusa-plugin-algolia" dependencies: - "@medusajs/modules-sdk": 0.1.0-rc.4 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/modules-sdk": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 algoliasearch: ^4.15.0 client-sessions: ^0.8.0 cross-env: ^5.2.1 @@ -28623,12 +28623,12 @@ __metadata: cross-env: ^7.0.3 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 randomatic: ^3.1.1 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28652,12 +28652,12 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 redis: ^3.0.2 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28680,11 +28680,11 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 randomatic: ^3.1.1 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28708,12 +28708,12 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 moment: ^2.27.0 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28732,9 +28732,9 @@ __metadata: axios: ^0.20.0 cross-env: ^5.2.1 jest: ^25.5.4 - medusa-interfaces: ^1.3.7-rc.0 + medusa-interfaces: ^1.3.7 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28759,11 +28759,11 @@ __metadata: express: ^4.17.1 jest: ^25.5.4 mailchimp-api-v3: ^1.14.0 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28771,9 +28771,9 @@ __metadata: version: 0.0.0-use.local resolution: "medusa-plugin-meilisearch@workspace:packages/medusa-plugin-meilisearch" dependencies: - "@medusajs/medusa": 1.8.0-rc.6 - "@medusajs/types": 0.0.2-rc.1 - "@medusajs/utils": 0.0.2-rc.2 + "@medusajs/medusa": 1.8.0 + "@medusajs/types": 1.8.0 + "@medusajs/utils": 1.8.0 body-parser: ^1.19.0 cross-env: ^5.2.1 jest: ^25.5.4 @@ -28797,14 +28797,14 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 pg: ^8.5.1 ulid: ^2.3.0 peerDependencies: - "@medusajs/medusa": 1.8.0-rc.6 - medusa-interfaces: 1.3.7-rc.0 + "@medusajs/medusa": 1.8.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28829,15 +28829,15 @@ __metadata: eslint: ^6.8.0 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft -"medusa-plugin-sendgrid@1.3.8-rc.0, medusa-plugin-sendgrid@workspace:packages/medusa-plugin-sendgrid": +"medusa-plugin-sendgrid@1.3.8, medusa-plugin-sendgrid@workspace:packages/medusa-plugin-sendgrid": version: 0.0.0-use.local resolution: "medusa-plugin-sendgrid@workspace:packages/medusa-plugin-sendgrid" dependencies: @@ -28857,11 +28857,11 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28885,12 +28885,12 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 moment: ^2.27.0 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28911,12 +28911,12 @@ __metadata: body-parser: ^1.19.0 cross-env: ^5.2.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 twilio: ^3.49.1 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft @@ -28939,21 +28939,21 @@ __metadata: cross-env: ^5.2.1 express: ^4.17.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 languageName: unknown linkType: soft -"medusa-react@5.0.0-rc.6, medusa-react@workspace:packages/medusa-react": +"medusa-react@5.0.0, medusa-react@workspace:packages/medusa-react": version: 0.0.0-use.local resolution: "medusa-react@workspace:packages/medusa-react" dependencies: "@babel/core": ^7.16.0 - "@medusajs/medusa": 1.8.0-rc.6 - "@medusajs/medusa-js": ^2.0.0-rc.6 + "@medusajs/medusa": 1.8.0 + "@medusajs/medusa-js": 2.0.0 "@storybook/addon-essentials": ^6.3.12 "@storybook/addon-links": ^6.3.12 "@storybook/addons": ^6.3.12 @@ -28979,7 +28979,7 @@ __metadata: tslib: ^2.3.1 tsup: ^6.5.0 peerDependencies: - "@medusajs/medusa": 1.8.0-rc.6 + "@medusajs/medusa": 1.8.0 "@tanstack/react-query": ^4.22.0 react: ^16.8 || ^17.0 || ^18.0 react-dom: ^16.8 || ^17.0 || ^18.0 @@ -29009,11 +29009,11 @@ __metadata: ioredis: ^4.27.9 jest: ^25.5.4 lodash: ^4.17.21 - medusa-core-utils: ^1.2.0-rc.0 - medusa-interfaces: ^1.3.7-rc.0 - medusa-test-utils: ^1.1.40-rc.0 + medusa-core-utils: ^1.2.0 + medusa-interfaces: ^1.3.7 + medusa-test-utils: ^1.1.40 peerDependencies: - medusa-interfaces: 1.3.7-rc.0 + medusa-interfaces: 1.3.7 typeorm: 0.x languageName: unknown linkType: soft @@ -29041,7 +29041,7 @@ __metadata: languageName: unknown linkType: soft -"medusa-test-utils@^1.1.40-rc.0, medusa-test-utils@workspace:packages/medusa-test-utils": +"medusa-test-utils@^1.1.40, medusa-test-utils@workspace:packages/medusa-test-utils": version: 0.0.0-use.local resolution: "medusa-test-utils@workspace:packages/medusa-test-utils" dependencies: @@ -29054,7 +29054,7 @@ __metadata: "@babel/runtime": ^7.9.6 cross-env: ^5.2.1 jest: ^25.5.4 - medusa-core-utils: ^1.2.0-rc.0 + medusa-core-utils: ^1.2.0 randomatic: ^3.1.1 languageName: unknown linkType: soft